mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
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)
This commit is contained in:
57
modules/TargetCast.lua
Normal file
57
modules/TargetCast.lua
Normal file
@ -0,0 +1,57 @@
|
||||
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()
|
Reference in New Issue
Block a user