- build the config on demand (might break stuff, srsly)

- add options for configuring the modifier switching
This commit is contained in:
Hendrik Leppkes
2008-04-08 10:31:40 +00:00
parent 7bed8cdf21
commit b6adf401f6
6 changed files with 221 additions and 127 deletions
+8 -3
View File
@@ -20,7 +20,6 @@ local defaults = { profile = Bartender4:Merge({
function PetBarMod:OnInitialize()
self.db = Bartender4.db:RegisterNamespace("PetBar", defaults)
self:SetEnabledState(self.db.profile.enabled)
self:SetupOptions()
end
function PetBarMod:OnEnable()
@@ -56,7 +55,7 @@ function PetBarMod:OnEnable()
self.bar:RegisterEvent("PET_BAR_HIDEGRID")
self:ApplyConfig()
self:SetupOptions()
self:ToggleOptions()
self:RegisterEvent("UPDATE_BINDINGS", "ReassignBindings")
self:ReassignBindings()
@@ -70,7 +69,7 @@ function PetBarMod:OnDisable()
self.bar:UnregisterAllEvents()
self.bar:Hide()
self:SetupOptions()
self:ToggleOptions()
end
local function onEnter(self, ...)
@@ -149,6 +148,12 @@ function PetBarMod:SetupOptions()
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
end
function PetBarMod:ToggleOptions()
if self.options then
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
end
end
function PetBarMod:ReassignBindings()
if not self.bar or not self.bar.buttons then return end
ClearOverrideBindings(self.bar)