diff --git a/IceCore.lua b/IceCore.lua index e6cac6a..a38f62f 100644 --- a/IceCore.lua +++ b/IceCore.lua @@ -446,7 +446,7 @@ function IceCore.prototype:Disable(userToggle) self:ConfigModeToggle(false) - for i = 1, table.getn(self.elements) do + for i=1, #self.elements do if (self.elements[i]:IsEnabled()) then self.elements[i]:Disable(true) end diff --git a/modules/CustomBar.lua b/modules/CustomBar.lua index abc67fe..1bc89ee 100644 --- a/modules/CustomBar.lua +++ b/modules/CustomBar.lua @@ -89,12 +89,6 @@ function IceCustomBar.prototype:TargetChanged() self:UpdateCustomBar(self.unit) end -function IceCustomBar.prototype:Disable(core) - IceHUD.IceCore:RequestUpdates(self, nil) - - IceCustomBar.super.prototype.Disable(self, core) -end - -- OVERRIDE function IceCustomBar.prototype:GetDefaultSettings() local settings = IceCustomBar.super.prototype.GetDefaultSettings(self) @@ -367,7 +361,7 @@ function IceCustomBar.prototype:GetOptions() end, order = 30.9 } - + opts["displayWhenTargeting"] = { type = 'toggle', name = L["Display when targeting"], @@ -749,7 +743,12 @@ function IceCustomBar.prototype:OutCombat() self:UpdateCustomBar(self.unit) end -function IceCustomBar.prototype:Show(bShouldShow) +function IceCustomBar.prototype:Show(bShouldShow, bForceHide) + if bForceHide then + IceCustomBar.super.prototype.Show(self, bShouldShow, bForceHide) + return + end + if self.moduleSettings.displayWhenTargeting and self.target then IceCustomBar.super.prototype.Show(self, true) elseif self.moduleSettings.displayWhenEmpty then