- build the config on demand (might break stuff, srsly)
- add options for configuring the modifier switching
This commit is contained in:
+8
-3
@@ -20,7 +20,6 @@ local defaults = { profile = Bartender4:Merge({
|
||||
function MicroMenuMod:OnInitialize()
|
||||
self.db = Bartender4.db:RegisterNamespace("MicroMenu", defaults)
|
||||
self:SetEnabledState(self.db.profile.enabled)
|
||||
self:SetupOptions()
|
||||
end
|
||||
|
||||
local noopFunc = function() end
|
||||
@@ -53,7 +52,7 @@ function MicroMenuMod:OnEnable()
|
||||
self.bar:ApplyConfig(self.db.profile)
|
||||
end
|
||||
self.bar.disabled = nil
|
||||
self:SetupOptions()
|
||||
self:ToggleOptions()
|
||||
end
|
||||
|
||||
function MicroMenuMod:OnDisable()
|
||||
@@ -61,7 +60,7 @@ function MicroMenuMod:OnDisable()
|
||||
self.bar.disabled = true
|
||||
self.bar:UnregisterAllEvents()
|
||||
self.bar:Hide()
|
||||
self:SetupOptions()
|
||||
self:ToggleOptions()
|
||||
end
|
||||
|
||||
function MicroMenuMod:ApplyConfig()
|
||||
@@ -105,6 +104,12 @@ function MicroMenuMod:SetupOptions()
|
||||
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
|
||||
end
|
||||
|
||||
function MicroMenuMod:ToggleOptions()
|
||||
if self.options then
|
||||
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
|
||||
end
|
||||
end
|
||||
|
||||
function MicroMenuBar:ApplyConfig(config)
|
||||
Bar.ApplyConfig(self, config)
|
||||
self:PerformLayout()
|
||||
|
||||
Reference in New Issue
Block a user