fix issue with hiding bars on disable

This commit is contained in:
Hendrik Leppkes
2008-07-04 16:57:19 +00:00
parent caa897af46
commit b5fcb19415
6 changed files with 23 additions and 18 deletions
+1 -2
View File
@@ -222,8 +222,7 @@ function BT4ActionBars:DisableBar(id)
if not bar then return end
bar.config.enabled = false
bar.disabled = true
bar:Hide()
bar:Disable()
self:CreateBarOption(id, self.disabledoptions)
end
+2 -3
View File
@@ -32,15 +32,14 @@ function BagBarMod:OnEnable()
-- TODO: real start position
self.bar:SetPoint("CENTER")
end
self.bar.disabled = nil
self.bar:Enable()
self:ToggleOptions()
self.bar:ApplyConfig(self.db.profile)
end
function BagBarMod:OnDisable()
if not self.bar then return end
self.bar.disabled = true
self.bar:Hide()
self.bar:Disable()
self:ToggleOptions()
end
+13
View File
@@ -471,6 +471,19 @@ function Bar:DisableVisibilityDriver()
self:Show()
end
function Bar:Enable()
if not self.disabled then return end
self.disabled = nil
end
function Bar:Disable()
if self.disabled then return end
self.disabled = true
self:UnregisterAllEvents()
self:DisableVisibilityDriver()
self:Hide()
end
--[[
Lazyness functions
]]
+2 -4
View File
@@ -49,16 +49,14 @@ function MicroMenuMod:OnEnable()
-- TODO: real start position
self.bar:SetPoint("CENTER")
end
self.bar.disabled = nil
self.bar:Enable()
self:ToggleOptions()
self.bar:ApplyConfig(self.db.profile)
end
function MicroMenuMod:OnDisable()
if not self.bar then return end
self.bar.disabled = true
self.bar:UnregisterAllEvents()
self.bar:Hide()
self.bar:Disable()
self:ToggleOptions()
end
+3 -5
View File
@@ -42,7 +42,7 @@ function PetBarMod:OnEnable()
self.bar:SetAttribute("unit", "pet")
end
self.bar.disabled = nil
self.bar:Enable()
RegisterUnitWatch(self.bar, false)
@@ -66,12 +66,10 @@ end
function PetBarMod:OnDisable()
if not self.bar then return end
self.bar.disabled = true
UnregisterUnitWatch(self.bar)
self.bar:UnregisterAllEvents()
self.bar:Hide()
self.bar:Disable()
self:ToggleOptions()
end
+2 -4
View File
@@ -34,7 +34,7 @@ function StanceBarMod:OnEnable()
self.bar:ClearSetPoint("CENTER")
self.bar:SetScript("OnEvent", StanceBar.OnEvent)
end
self.bar.disabled = nil
self.bar:Enable()
self:ToggleOptions()
self.bar:RegisterEvent("PLAYER_ENTERING_WORLD")
@@ -51,9 +51,7 @@ end
function StanceBarMod:OnDisable()
if not self.bar then return end
self.bar.disabled = true
self.bar:UnregisterAllEvents()
self.bar:Hide()
self.bar:Disable()
self:ToggleOptions()
end