mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
- 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)
58 lines
1.2 KiB
Lua
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()
|