mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 06:40:13 -05:00
Enable/disable for TargetInfo and TargetofTarget now works properly
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
## Name: IceHUD
|
||||
## Title: IceHUD |cff7fff7f -Ace2-|r
|
||||
## Notes: Another HUD addon
|
||||
## Version: 0.8.1 ($Revision$)
|
||||
## Version: 0.8.2 ($Revision$)
|
||||
## SavedVariables: IceCoreDB
|
||||
## OptionalDeps: Ace2, DewdropLib, DruidBar, SoleManax, MobHealth
|
||||
## X-Embeds: Ace2, DewdropLib
|
||||
|
@ -50,6 +50,16 @@ function TargetInfo.prototype:Enable(core)
|
||||
self:RegisterEvent("UNIT_DYNAMIC_FLAGS", "TargetFlags")
|
||||
|
||||
self:RegisterEvent("RAID_TARGET_UPDATE", "UpdateRaidTargetIcon")
|
||||
|
||||
RegisterUnitWatch(self.frame)
|
||||
end
|
||||
|
||||
|
||||
-- OVERRIDE
|
||||
function TargetInfo.prototype:Disable(core)
|
||||
TargetInfo.super.prototype.Disable(self, core)
|
||||
|
||||
UnregisterUnitWatch(self.frame)
|
||||
end
|
||||
|
||||
|
||||
@ -284,9 +294,8 @@ function TargetInfo.prototype:CreateFrame(redraw)
|
||||
|
||||
self.frame:SetScale(self.moduleSettings.scale)
|
||||
|
||||
-- register showing/hiding the frame depending on current target
|
||||
-- set showing/hiding the frame depending on current target
|
||||
self.frame:SetAttribute("unit", target)
|
||||
RegisterUnitWatch(self.frame)
|
||||
|
||||
self.frame:SetFrameStrata("BACKGROUND")
|
||||
self.frame:SetWidth(self.width)
|
||||
|
@ -133,13 +133,18 @@ function TargetOfTarget.prototype:Enable(core)
|
||||
|
||||
self:ScheduleRepeatingEvent(self.elementName, self.Update, 0.3, self)
|
||||
|
||||
RegisterUnitWatch(self.frame)
|
||||
|
||||
self:Update()
|
||||
end
|
||||
|
||||
|
||||
function TargetOfTarget.prototype:Disable(core)
|
||||
TargetOfTarget.super.prototype.Disable(self, core)
|
||||
|
||||
self:CancelScheduledEvent(self.elementName)
|
||||
|
||||
UnregisterUnitWatch(self.frame)
|
||||
end
|
||||
|
||||
|
||||
@ -150,7 +155,6 @@ function TargetOfTarget.prototype:CreateFrame()
|
||||
if not (self.frame) then
|
||||
self.frame = CreateFrame("Button", "IceHUD_"..self.elementName, self.parent, "SecureUnitButtonTemplate")
|
||||
self.frame:SetAttribute("unit", self.unit)
|
||||
RegisterUnitWatch(self.frame)
|
||||
end
|
||||
|
||||
self.frame:SetFrameStrata("BACKGROUND")
|
||||
|
Reference in New Issue
Block a user