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 if not bar then return end
bar.config.enabled = false bar.config.enabled = false
bar.disabled = true bar:Disable()
bar:Hide()
self:CreateBarOption(id, self.disabledoptions) self:CreateBarOption(id, self.disabledoptions)
end end
+2 -3
View File
@@ -32,15 +32,14 @@ function BagBarMod:OnEnable()
-- TODO: real start position -- TODO: real start position
self.bar:SetPoint("CENTER") self.bar:SetPoint("CENTER")
end end
self.bar.disabled = nil self.bar:Enable()
self:ToggleOptions() self:ToggleOptions()
self.bar:ApplyConfig(self.db.profile) self.bar:ApplyConfig(self.db.profile)
end end
function BagBarMod:OnDisable() function BagBarMod:OnDisable()
if not self.bar then return end if not self.bar then return end
self.bar.disabled = true self.bar:Disable()
self.bar:Hide()
self:ToggleOptions() self:ToggleOptions()
end end
+13
View File
@@ -471,6 +471,19 @@ function Bar:DisableVisibilityDriver()
self:Show() self:Show()
end 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 Lazyness functions
]] ]]
+2 -4
View File
@@ -49,16 +49,14 @@ function MicroMenuMod:OnEnable()
-- TODO: real start position -- TODO: real start position
self.bar:SetPoint("CENTER") self.bar:SetPoint("CENTER")
end end
self.bar.disabled = nil self.bar:Enable()
self:ToggleOptions() self:ToggleOptions()
self.bar:ApplyConfig(self.db.profile) self.bar:ApplyConfig(self.db.profile)
end end
function MicroMenuMod:OnDisable() function MicroMenuMod:OnDisable()
if not self.bar then return end if not self.bar then return end
self.bar.disabled = true self.bar:Disable()
self.bar:UnregisterAllEvents()
self.bar:Hide()
self:ToggleOptions() self:ToggleOptions()
end end
+3 -5
View File
@@ -42,7 +42,7 @@ function PetBarMod:OnEnable()
self.bar:SetAttribute("unit", "pet") self.bar:SetAttribute("unit", "pet")
end end
self.bar.disabled = nil self.bar:Enable()
RegisterUnitWatch(self.bar, false) RegisterUnitWatch(self.bar, false)
@@ -66,12 +66,10 @@ end
function PetBarMod:OnDisable() function PetBarMod:OnDisable()
if not self.bar then return end if not self.bar then return end
self.bar.disabled = true
UnregisterUnitWatch(self.bar) UnregisterUnitWatch(self.bar)
self.bar:UnregisterAllEvents() self.bar:Disable()
self.bar:Hide()
self:ToggleOptions() self:ToggleOptions()
end end
+2 -4
View File
@@ -34,7 +34,7 @@ function StanceBarMod:OnEnable()
self.bar:ClearSetPoint("CENTER") self.bar:ClearSetPoint("CENTER")
self.bar:SetScript("OnEvent", StanceBar.OnEvent) self.bar:SetScript("OnEvent", StanceBar.OnEvent)
end end
self.bar.disabled = nil self.bar:Enable()
self:ToggleOptions() self:ToggleOptions()
self.bar:RegisterEvent("PLAYER_ENTERING_WORLD") self.bar:RegisterEvent("PLAYER_ENTERING_WORLD")
@@ -51,9 +51,7 @@ end
function StanceBarMod:OnDisable() function StanceBarMod:OnDisable()
if not self.bar then return end if not self.bar then return end
self.bar.disabled = true self.bar:Disable()
self.bar:UnregisterAllEvents()
self.bar:Hide()
self:ToggleOptions() self:ToggleOptions()
end end