restructuring, preparing for new changes

This commit is contained in:
Hendrik Leppkes
2008-09-01 11:12:43 +00:00
parent dca3b31f9d
commit 6acaa9e6a1
27 changed files with 44 additions and 56 deletions
+48
View File
@@ -0,0 +1,48 @@
--[[ $Id$ ]]
local L = LibStub("AceLocale-3.0"):GetLocale("Bartender4")
-- module
local StanceBarMod = Bartender4:GetModule("StanceBar")
-- fetch upvalues
local ButtonBar = Bartender4.ButtonBar.prototype
function StanceBarMod:SetupOptions()
if not self.options then
self.optionobject = ButtonBar:GetOptionObject()
self.optionobject.table.general.args.rows.max = self.button_count
local enabled = {
type = "toggle",
order = 1,
name = L["Enabled"],
desc = L["Enable the StanceBar"],
get = function() return self.db.profile.enabled end,
set = "ToggleModule",
handler = self,
}
self.optionobject:AddElement("general", "enabled", enabled)
self.disabledoptions = {
general = {
type = "group",
name = L["General Settings"],
cmdInline = true,
order = 1,
args = {
enabled = enabled,
}
}
}
self.options = {
order = 30,
type = "group",
name = L["Stance Bar"],
desc = L["Configure the Stance Bar"],
childGroups = "tab",
disabled = function(info) return GetNumShapeshiftForms() == 0 end,
}
Bartender4:RegisterBarOptions("StanceBar", self.options)
end
self.options.args = self:IsEnabled() and self.optionobject.table or self.disabledoptions
end