fix module enabling/disabling in various modules

This commit is contained in:
Hendrik Leppkes
2008-05-28 10:27:51 +00:00
parent 88f2eca87c
commit 3e3bd90c37
4 changed files with 11 additions and 1 deletions
+1
View File
@@ -291,6 +291,7 @@ function Bar:SetShow(show)
if not self.unlocked then
self[self.config.show and "Show" or "Hide"](self)
else
self:Show()
if not self.config.show then
self.overlay:SetBackdropColor(1, 0, 0, 0.5)
else
+6 -1
View File
@@ -41,6 +41,7 @@ end
function Bartender4:UpdateModuleConfigs()
self:Lock()
for k,v in AceAddon:IterateModulesOfAddon(self) do
v:ToggleModule()
if v:IsEnabled() and type(v.ApplyConfig) == "function" then
v:ApplyConfig()
end
@@ -88,7 +89,11 @@ end
Bartender4.modulePrototype = {}
function Bartender4.modulePrototype:ToggleModule(info, value)
self.db.profile.enabled = value
if value ~= nil then
self.db.profile.enabled = value
else
value = self.db.profile.enabled
end
if value and not self:IsEnabled() then
self:Enable()
elseif not value and self:IsEnabled() then
+1
View File
@@ -125,6 +125,7 @@ function onDragStart(button)
end
function onReceiveDrag(button)
if InCombatLockdown() then return end
PlaceAction(button.action)
button:UpdateState()
button:UpdateFlash()
+3
View File
@@ -33,6 +33,8 @@ function StanceBarMod:OnEnable()
self.bar:ClearSetPoint("CENTER")
self.bar:SetScript("OnEvent", StanceBar.OnEvent)
end
self.bar.disabled = nil
self:ToggleOptions()
self.bar:RegisterEvent("PLAYER_ENTERING_WORLD")
self.bar:RegisterEvent("UPDATE_SHAPESHIFT_FORMS")
@@ -48,6 +50,7 @@ end
function StanceBarMod:OnDisable()
if not self.bar then return end
self.bar.disabled = true
self.bar:UnregisterAllEvents()
self.bar:Hide()
self:ToggleOptions()