Files
ice-hud/modules/TargetCast.lua
iceroth 7740ef9f74 Version 0.8
- 2.0 compatible
- Removed bunch of unused libs (recommended to delete your /libs folder before updating)
- Added a restriction to open configuration settings only out of combat
- TargetInfo module optimized (no longer eats your memory and babies when changing options)
- Shows up to 40 buffs/debuffs, ability to filter buffs (never/in combat/always)
- No longer uses SpellStatus lib (new events do everything worth doing)
- New module TargetCast, basically does what Blizzard target frame cast bar does
- Removed module TimerBar (it was next to useless)
- Brackets around bar texts now toggleable
- Some misc. bug fixes (eg. colors now change properly when a duel starts)
2006-12-04 15:58:07 +00:00

58 lines
1.2 KiB
Lua

local AceOO = AceLibrary("AceOO-2.0")
local TargetCast = AceOO.Class(IceCastBar)
-- Constructor --
function TargetCast.prototype:init()
TargetCast.super.prototype.init(self, "TargetCast")
self.unit = "target"
end
-- 'Public' methods -----------------------------------------------------------
-- OVERRIDE
function TargetCast.prototype:GetDefaultSettings()
local settings = TargetCast.super.prototype.GetDefaultSettings(self)
settings["side"] = IceCore.Side.Right
settings["offset"] = 3
settings["flashInstants"] = "Never"
settings["flashFailures"] = "Never"
return settings
end
-- OVERRIDE
function TargetCast.prototype:Enable(core)
TargetCast.super.prototype.Enable(self, core)
self:RegisterEvent("PLAYER_TARGET_CHANGED", "TargetChanged")
end
function TargetCast.prototype:TargetChanged(unit)
if not (UnitExists(self.unit)) then
self:StopBar()
return
end
local spell = UnitCastingInfo(self.unit)
if (spell) then
self:StartBar(IceCastBar.Actions.Cast)
return
end
local channel = UnitChannelInfo(self.unit)
if (channel) then
self:StartBar(IceCastBar.Actions.Channel)
return
end
end
-------------------------------------------------------------------------------
-- Load us up
TargetCast:new()