fix issue with hiding bars on disable
This commit is contained in:
+1
-2
@@ -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
@@ -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
|
||||
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user