more work done and fixes applied

This commit is contained in:
Hendrik Leppkes
2007-12-11 13:02:06 +00:00
parent 13300aae6e
commit 37520f8b58
5 changed files with 85 additions and 12 deletions
+30
View File
@@ -16,6 +16,9 @@ function Bartender4:OnInitialize()
self.db.RegisterCallback(self, "OnProfileReset", "UpdateModuleConfigs")
self:SetupOptions()
self.Locked = true
self:RegisterEvent("PLAYER_REGEN_DISABLED", "CombatLockdown")
end
function Bartender4:RegisterDefaultsKey(key, subdefaults)
@@ -25,6 +28,7 @@ function Bartender4:RegisterDefaultsKey(key, subdefaults)
end
function Bartender4:UpdateModuleConfigs()
self:Lock()
for k,v in AceAddon:IterateModulesOfAddon("Bartender4") do
if type(v.ApplyConfig) == "function" then
v:ApplyConfig()
@@ -40,6 +44,32 @@ function Bartender4:Update()
end
end
function Bartender4:CombatLockdown()
self:Lock()
end
function Bartender4:ToggleLock()
if self.Locked then
self:Unlock()
else
self:Lock()
end
end
function Bartender4:Unlock()
if self.Locked then
self.Locked = false
Bartender4.Bar:ForAll("Unlock")
end
end
function Bartender4:Lock()
if not self.Locked then
self.Locked = true
Bartender4.Bar:ForAll("Lock")
end
end
function Bartender4:Merge(target, source)
if not target then target = {} end
for k,v in pairs(source) do