fix actionbars config

This commit is contained in:
Crum
2018-06-15 18:26:40 -05:00
parent 8023d934cf
commit 3ed49e205b
+26 -24
View File
@@ -541,15 +541,17 @@ local function BuildABConfig()
} }
for i = 1, 5 do for i = 1, 5 do
local name = L["Bar "]..i local name = L["Bar "]..i
group["bar"..i] = { local barNum = "bar"..i
group[barNum] = {
order = 4 + i, order = 4 + i,
name = name, name = name,
type = "group", type = "group",
disabled = function() return not E.private.actionbar.enable end, disabled = function() return not E.private.actionbar.enable end,
get = function(info) return E.db.actionbar["bar"..i][ info[getn(info)] ] end, get = function(info) return E.db.actionbar[barNum][ info[getn(info)] ] end,
set = function(info, value) set = function(info, value)
E.db.actionbar["bar"..i][ info[getn(info)] ] = value E.db.actionbar[barNum][ info[getn(info)] ] = value
AB:PositionAndSizeBar("bar"..i) AB:PositionAndSizeBar(barNum)
end, end,
args = { args = {
info = { info = {
@@ -562,8 +564,8 @@ local function BuildABConfig()
type = "toggle", type = "toggle",
name = L["Enable"], name = L["Enable"],
set = function(info, value) set = function(info, value)
E.db.actionbar["bar"..i][ info[getn(info)] ] = value E.db.actionbar[barNum][ info[getn(info)] ] = value
AB:PositionAndSizeBar("bar"..i) AB:PositionAndSizeBar(barNum)
end end
}, },
restorePosition = { restorePosition = {
@@ -572,10 +574,10 @@ local function BuildABConfig()
name = L["Restore Bar"], name = L["Restore Bar"],
desc = L["Restore the actionbars default settings"], desc = L["Restore the actionbars default settings"],
func = function() func = function()
E:CopyTable(E.db.actionbar["bar"..i], P.actionbar["bar"..i]) E:CopyTable(E.db.actionbar[barNum], P.actionbar[barNum])
E:ResetMovers(L["Bar "..i]) AB:PositionAndSizeBar("bar"..i) E:ResetMovers(name) AB:PositionAndSizeBar(barNum)
end, end,
disabled = function() return not E.db.actionbar["bar"..i].enabled end disabled = function() return not E.db.actionbar[barNum].enabled end
}, },
spacer = { spacer = {
order = 4, order = 4,
@@ -587,31 +589,31 @@ local function BuildABConfig()
type = "toggle", type = "toggle",
name = L["Backdrop"], name = L["Backdrop"],
desc = L["Toggles the display of the actionbars backdrop."], desc = L["Toggles the display of the actionbars backdrop."],
disabled = function() return not E.db.actionbar["bar"..i].enabled end disabled = function() return not E.db.actionbar[barNum].enabled end
}, },
showGrid = { showGrid = {
order = 6, order = 6,
type = "toggle", type = "toggle",
name = L["Show Empty Buttons"], name = L["Show Empty Buttons"],
set = function(info, value) set = function(info, value)
E.db.actionbar["bar"..i][ info[getn(info)] ] = value E.db.actionbar[barNum][ info[getn(info)] ] = value
AB:UpdateButtonSettingsForBar("bar"..i) AB:UpdateButtonSettingsForBar(barNum)
end, end,
disabled = function() return not E.db.actionbar["bar"..i].enabled end disabled = function() return not E.db.actionbar[barNum].enabled end
}, },
mouseover = { mouseover = {
order = 7, order = 7,
type = "toggle", type = "toggle",
name = L["Mouse Over"], name = L["Mouse Over"],
desc = L["The frame is not shown unless you mouse over the frame."], desc = L["The frame is not shown unless you mouse over the frame."],
disabled = function() return not E.db.actionbar["bar"..i].enabled end disabled = function() return not E.db.actionbar[barNum].enabled end
}, },
inheritGlobalFade = { inheritGlobalFade = {
order = 8, order = 8,
type = "toggle", type = "toggle",
name = L["Inherit Global Fade"], name = L["Inherit Global Fade"],
desc = L["Inherit the global fade, mousing over, targetting, setting focus, losing health, entering combat will set the remove transparency. Otherwise it will use the transparency level in the general actionbar settings for global fade alpha."], desc = L["Inherit the global fade, mousing over, targetting, setting focus, losing health, entering combat will set the remove transparency. Otherwise it will use the transparency level in the general actionbar settings for global fade alpha."],
disabled = function() return not E.db.actionbar["bar"..i].enabled end disabled = function() return not E.db.actionbar[barNum].enabled end
}, },
point = { point = {
order = 9, order = 9,
@@ -619,7 +621,7 @@ local function BuildABConfig()
name = L["Anchor Point"], name = L["Anchor Point"],
desc = L["The first button anchors itself to this point on the bar."], desc = L["The first button anchors itself to this point on the bar."],
values = points, values = points,
disabled = function() return not E.db.actionbar["bar"..i].enabled end disabled = function() return not E.db.actionbar[barNum].enabled end
}, },
buttons = { buttons = {
order = 10, order = 10,
@@ -627,7 +629,7 @@ local function BuildABConfig()
name = L["Buttons"], name = L["Buttons"],
desc = L["The amount of buttons to display."], desc = L["The amount of buttons to display."],
min = 1, max = NUM_ACTIONBAR_BUTTONS, step = 1, min = 1, max = NUM_ACTIONBAR_BUTTONS, step = 1,
disabled = function() return not E.db.actionbar["bar"..i].enabled end disabled = function() return not E.db.actionbar[barNum].enabled end
}, },
buttonsPerRow = { buttonsPerRow = {
order = 11, order = 11,
@@ -635,7 +637,7 @@ local function BuildABConfig()
name = L["Buttons Per Row"], name = L["Buttons Per Row"],
desc = L["The amount of buttons to display per row."], desc = L["The amount of buttons to display per row."],
min = 1, max = NUM_ACTIONBAR_BUTTONS, step = 1, min = 1, max = NUM_ACTIONBAR_BUTTONS, step = 1,
disabled = function() return not E.db.actionbar["bar"..i].enabled end disabled = function() return not E.db.actionbar[barNum].enabled end
}, },
buttonsize = { buttonsize = {
order = 12, order = 12,
@@ -643,7 +645,7 @@ local function BuildABConfig()
name = L["Button Size"], name = L["Button Size"],
desc = L["The size of the action buttons."], desc = L["The size of the action buttons."],
min = 15, max = 60, step = 1, min = 15, max = 60, step = 1,
disabled = function() return not E.db.actionbar["bar"..i].enabled end disabled = function() return not E.db.actionbar[barNum].enabled end
}, },
buttonspacing = { buttonspacing = {
order = 13, order = 13,
@@ -651,7 +653,7 @@ local function BuildABConfig()
name = L["Button Spacing"], name = L["Button Spacing"],
desc = L["The spacing between buttons."], desc = L["The spacing between buttons."],
min = -1, max = 10, step = 1, min = -1, max = 10, step = 1,
disabled = function() return not E.db.actionbar["bar"..i].enabled end disabled = function() return not E.db.actionbar[barNum].enabled end
}, },
backdropSpacing = { backdropSpacing = {
order = 14, order = 14,
@@ -659,7 +661,7 @@ local function BuildABConfig()
name = L["Backdrop Spacing"], name = L["Backdrop Spacing"],
desc = L["The spacing between the backdrop and the buttons."], desc = L["The spacing between the backdrop and the buttons."],
min = 0, max = 10, step = 1, min = 0, max = 10, step = 1,
disabled = function() return not E.db.actionbar["bar"..i].enabled end disabled = function() return not E.db.actionbar[barNum].enabled end
}, },
heightMult = { heightMult = {
order = 15, order = 15,
@@ -667,7 +669,7 @@ local function BuildABConfig()
name = L["Height Multiplier"], name = L["Height Multiplier"],
desc = L["Multiply the backdrops height or width by this value. This is usefull if you wish to have more than one bar behind a backdrop."], desc = L["Multiply the backdrops height or width by this value. This is usefull if you wish to have more than one bar behind a backdrop."],
min = 1, max = 5, step = 1, min = 1, max = 5, step = 1,
disabled = function() return not E.db.actionbar["bar"..i].enabled end disabled = function() return not E.db.actionbar[barNum].enabled end
}, },
widthMult = { widthMult = {
order = 16, order = 16,
@@ -675,7 +677,7 @@ local function BuildABConfig()
name = L["Width Multiplier"], name = L["Width Multiplier"],
desc = L["Multiply the backdrops height or width by this value. This is usefull if you wish to have more than one bar behind a backdrop."], desc = L["Multiply the backdrops height or width by this value. This is usefull if you wish to have more than one bar behind a backdrop."],
min = 1, max = 5, step = 1, min = 1, max = 5, step = 1,
disabled = function() return not E.db.actionbar["bar"..i].enabled end disabled = function() return not E.db.actionbar[barNum].enabled end
}, },
alpha = { alpha = {
order = 17, order = 17,
@@ -683,7 +685,7 @@ local function BuildABConfig()
name = L["Alpha"], name = L["Alpha"],
isPercent = true, isPercent = true,
min = 0, max = 1, step = 0.01, min = 0, max = 1, step = 0.01,
disabled = function() return not E.db.actionbar["bar"..i].enabled end disabled = function() return not E.db.actionbar[barNum].enabled end
} }
} }
} }