58 lines
1.4 KiB
Lua
58 lines
1.4 KiB
Lua
--[[ $Id$ ]]
|
|
|
|
local getFunc, setFunc
|
|
do
|
|
function getFunc(info)
|
|
return (info.arg and Bartender4.db.profile[info.arg] or Bartender4.db.profile[info[#info]])
|
|
end
|
|
|
|
function setFunc(info, value)
|
|
local key = info.arg or info[#info]
|
|
Bartender4.db.profile[key] = value
|
|
end
|
|
end
|
|
|
|
function Bartender4:SetupOptions()
|
|
self.options = {
|
|
type = "group",
|
|
name = "Bartender4",
|
|
icon = "Interface\\Icons\\INV_Drink_05",
|
|
childGroups = "tree",
|
|
plugins = {},
|
|
args = {
|
|
general = {
|
|
order = 10,
|
|
type = "group",
|
|
--cmdInline = true,
|
|
name = "General Settings",
|
|
get = getFunc,
|
|
set = setFunc,
|
|
args = {
|
|
--[[ blue = {
|
|
type = "toggle",
|
|
name = "Test",
|
|
get = function() end,
|
|
set = function() end,
|
|
} ]]
|
|
},
|
|
},
|
|
lock = {
|
|
dialogHidden = true,
|
|
type = "toggle",
|
|
name = "Lock/Unlock the bars.",
|
|
get = function() return Bartender4.Locked end,
|
|
set = function(info, value) Bartender4:ToggleLock(value) end,
|
|
},
|
|
},
|
|
}
|
|
LibStub("AceConfig-3.0"):RegisterOptionsTable("Bartender4", self.options)
|
|
local optFunc = function() LibStub("AceConfigDialog-3.0"):Open("Bartender4") end
|
|
LibStub("AceConsole-3.0"):RegisterChatCommand( "bar", optFunc)
|
|
LibStub("AceConsole-3.0"):RegisterChatCommand( "bt", optFunc)
|
|
LibStub("AceConsole-3.0"):RegisterChatCommand( "bt4", optFunc)
|
|
end
|
|
|
|
function Bartender4:RegisterModuleOptions(key, table)
|
|
self.options.plugins[key] = { [key] = table }
|
|
end
|