- fixed bar text not properly hiding on bars that use RegisterUnitWatch to control visibility

This commit is contained in:
Parnic
2010-10-16 03:07:19 +00:00
parent 998ff6167f
commit d315ee3e3c
5 changed files with 20 additions and 16 deletions

View File

@ -60,12 +60,32 @@ function IceBarElement.prototype:Enable()
end end
self:RegisterFontStrings() self:RegisterFontStrings()
-- allows frames that show/hide via RegisterUnitWatch to not show text when they shouldn't
self.frame:SetScript("OnHide", function()
if self.moduleSettings.textVisible["upper"] then
self.frame.bottomUpperText:Hide()
end
if self.moduleSettings.textVisible["upper"] then
self.frame.bottomLowerText:Hide()
end
end)
self.frame:SetScript("OnShow", function()
if self.moduleSettings.textVisible["upper"] then
self.frame.bottomUpperText:Show()
end
if self.moduleSettings.textVisible["upper"] then
self.frame.bottomLowerText:Show()
end
end)
end end
function IceBarElement.prototype:Disable(core) function IceBarElement.prototype:Disable(core)
IceBarElement.super.prototype.Disable(self, core) IceBarElement.super.prototype.Disable(self, core)
self.frame:SetScript("OnUpdate", nil) self.frame:SetScript("OnUpdate", nil)
self.frame:SetScript("OnHide", nil)
self.frame:SetScript("OnShow", nil)
end end

View File

@ -114,10 +114,6 @@ function IceCustomHealth.prototype:Enable(core)
self:CreateFrame() self:CreateFrame()
self.scheduledEvent = self:ScheduleRepeatingTimer("Update", IceHUD.IceCore:UpdatePeriod()) self.scheduledEvent = self:ScheduleRepeatingTimer("Update", IceHUD.IceCore:UpdatePeriod())
if not IceHUD.IceCore:ShouldUseDogTags() then
self.frame:SetScript("OnHide", function() self:SetBottomText1("") self:SetBottomText2("") end)
end
end end
function IceCustomHealth.prototype:Disable(core) function IceCustomHealth.prototype:Disable(core)

View File

@ -258,10 +258,6 @@ function FocusHealth.prototype:Enable(core)
-- for showing/hiding the frame based on unit visibility -- for showing/hiding the frame based on unit visibility
self.frame:SetAttribute("unit", self.unit) self.frame:SetAttribute("unit", self.unit)
RegisterUnitWatch(self.frame) RegisterUnitWatch(self.frame)
if not IceHUD.IceCore:ShouldUseDogTags() then
self.frame:SetScript("OnHide", function() self:SetBottomText1("") self:SetBottomText2("") end)
end
end end
function FocusHealth.prototype:CreateBackground() function FocusHealth.prototype:CreateBackground()

View File

@ -70,10 +70,6 @@ function PetHealth.prototype:Enable(core)
self.frame:SetAttribute("unit", self.unit) self.frame:SetAttribute("unit", self.unit)
RegisterUnitWatch(self.frame) RegisterUnitWatch(self.frame)
if not IceHUD.IceCore:ShouldUseDogTags() then
self.frame:SetScript("OnHide", function() self:SetBottomText1("") self:SetBottomText2("") end)
end
self:CheckPet() self:CheckPet()
end end

View File

@ -646,10 +646,6 @@ function IceTargetHealth.prototype:Enable(core)
self:Update(self.unit) self:Update(self.unit)
RegisterUnitWatch(self.frame) RegisterUnitWatch(self.frame)
if not IceHUD.IceCore:ShouldUseDogTags() then
self.frame:SetScript("OnHide", function() self:SetBottomText1("") self:SetBottomText2("") end)
end
end end