restructure configuration
This commit is contained in:
+5
-69
@@ -46,8 +46,6 @@ local abdefaults = {
|
||||
|
||||
local defaults = {
|
||||
profile = {
|
||||
outofrange = "button",
|
||||
colors = { range = { r = 0.8, g = 0.1, b = 0.1 }, mana = { r = 0.5, g = 0.5, b = 1.0 } },
|
||||
actionbars = abdefaults,
|
||||
}
|
||||
}
|
||||
@@ -126,70 +124,7 @@ function BT4ActionBars:ForAllButtons(...)
|
||||
end
|
||||
|
||||
function BT4ActionBars:SetupOptions()
|
||||
self.options = {
|
||||
order = 20,
|
||||
type = "group",
|
||||
-- cmdInline = true,
|
||||
name = "Action Bars",
|
||||
get = getFunc,
|
||||
args = {
|
||||
range = {
|
||||
order = 1,
|
||||
name = "Out of Range Indicator",
|
||||
desc = "Configure how the Out of Range Indicator should display on the buttons.",
|
||||
type = "select",
|
||||
style = "dropdown",
|
||||
get = function()
|
||||
return BT4ActionBars.db.profile.outofrange
|
||||
end,
|
||||
set = function(info, value)
|
||||
BT4ActionBars.db.profile.outofrange = value
|
||||
BT4ActionBars:ForAllButtons("UpdateUsable")
|
||||
end,
|
||||
values = { none = "No Display", button = "Full Button Mode", hotkey = "Hotkey Mode" },
|
||||
},
|
||||
colors = {
|
||||
order = 3,
|
||||
type = "group",
|
||||
guiInline = true,
|
||||
name = "Colors",
|
||||
get = function(info)
|
||||
local color = BT4ActionBars.db.profile.colors[info[#info]]
|
||||
return color.r, color.g, color.b
|
||||
end,
|
||||
set = function(info, r, g, b)
|
||||
local color = BT4ActionBars.db.profile.colors[info[#info]]
|
||||
color.r, color.g, color.b = r, g, b
|
||||
BT4ActionBars:ForAllButtons("UpdateUsable")
|
||||
end,
|
||||
args = {
|
||||
range = {
|
||||
order = 1,
|
||||
type = "color",
|
||||
name = "Out of Range Indicator",
|
||||
desc = "Specify the Color of the Out of Range Indicator",
|
||||
},
|
||||
mana = {
|
||||
order = 2,
|
||||
type = "color",
|
||||
name = "Out of Mana Indicator",
|
||||
desc = "Specify the Color of the Out of Mana Indicator",
|
||||
},
|
||||
},
|
||||
},
|
||||
tooltip = {
|
||||
order = 2,
|
||||
name = "Button Tooltip",
|
||||
type = "select",
|
||||
desc = "Configure the Button Tooltip.",
|
||||
values = { ["disabled"] = "Disabled", ["nocombat"] = "Disabled in Combat", ["enabled"] = "Enabled" },
|
||||
get = function() return Bartender4.db.profile.tooltip end,
|
||||
set = function(info, value) Bartender4.db.profile.tooltip = value end,
|
||||
},
|
||||
},
|
||||
}
|
||||
Bartender4:RegisterModuleOptions("actionbars", self.options)
|
||||
|
||||
self.options = {}
|
||||
|
||||
self.disabledoptions = {
|
||||
general = {
|
||||
@@ -212,8 +147,8 @@ end
|
||||
|
||||
function BT4ActionBars:CreateBarOption(id, options)
|
||||
id = tostring(id)
|
||||
if not self.options.args[id] then
|
||||
self.options.args[id] = {
|
||||
if not self.options[id] then
|
||||
self.options[id] = {
|
||||
order = 10 + tonumber(id),
|
||||
type = "group",
|
||||
name = ("Bar %s"):format(id),
|
||||
@@ -221,7 +156,8 @@ function BT4ActionBars:CreateBarOption(id, options)
|
||||
childGroups = "tab",
|
||||
}
|
||||
end
|
||||
self.options.args[id].args = options
|
||||
self.options[id].args = options
|
||||
Bartender4:RegisterBarOptions(id, self.options[id])
|
||||
end
|
||||
|
||||
function BT4ActionBars:ReassignBindings()
|
||||
|
||||
Reference in New Issue
Block a user