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
local name = L["Bar "]..i
group["bar"..i] = {
local barNum = "bar"..i
group[barNum] = {
order = 4 + i,
name = name,
type = "group",
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)
E.db.actionbar["bar"..i][ info[getn(info)] ] = value
AB:PositionAndSizeBar("bar"..i)
E.db.actionbar[barNum][ info[getn(info)] ] = value
AB:PositionAndSizeBar(barNum)
end,
args = {
info = {
@@ -562,8 +564,8 @@ local function BuildABConfig()
type = "toggle",
name = L["Enable"],
set = function(info, value)
E.db.actionbar["bar"..i][ info[getn(info)] ] = value
AB:PositionAndSizeBar("bar"..i)
E.db.actionbar[barNum][ info[getn(info)] ] = value
AB:PositionAndSizeBar(barNum)
end
},
restorePosition = {
@@ -572,10 +574,10 @@ local function BuildABConfig()
name = L["Restore Bar"],
desc = L["Restore the actionbars default settings"],
func = function()
E:CopyTable(E.db.actionbar["bar"..i], P.actionbar["bar"..i])
E:ResetMovers(L["Bar "..i]) AB:PositionAndSizeBar("bar"..i)
E:CopyTable(E.db.actionbar[barNum], P.actionbar[barNum])
E:ResetMovers(name) AB:PositionAndSizeBar(barNum)
end,
disabled = function() return not E.db.actionbar["bar"..i].enabled end
disabled = function() return not E.db.actionbar[barNum].enabled end
},
spacer = {
order = 4,
@@ -587,31 +589,31 @@ local function BuildABConfig()
type = "toggle",
name = L["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 = {
order = 6,
type = "toggle",
name = L["Show Empty Buttons"],
set = function(info, value)
E.db.actionbar["bar"..i][ info[getn(info)] ] = value
AB:UpdateButtonSettingsForBar("bar"..i)
E.db.actionbar[barNum][ info[getn(info)] ] = value
AB:UpdateButtonSettingsForBar(barNum)
end,
disabled = function() return not E.db.actionbar["bar"..i].enabled end
disabled = function() return not E.db.actionbar[barNum].enabled end
},
mouseover = {
order = 7,
type = "toggle",
name = L["Mouse Over"],
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 = {
order = 8,
type = "toggle",
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."],
disabled = function() return not E.db.actionbar["bar"..i].enabled end
disabled = function() return not E.db.actionbar[barNum].enabled end
},
point = {
order = 9,
@@ -619,7 +621,7 @@ local function BuildABConfig()
name = L["Anchor Point"],
desc = L["The first button anchors itself to this point on the bar."],
values = points,
disabled = function() return not E.db.actionbar["bar"..i].enabled end
disabled = function() return not E.db.actionbar[barNum].enabled end
},
buttons = {
order = 10,
@@ -627,7 +629,7 @@ local function BuildABConfig()
name = L["Buttons"],
desc = L["The amount of buttons to display."],
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 = {
order = 11,
@@ -635,7 +637,7 @@ local function BuildABConfig()
name = L["Buttons Per Row"],
desc = L["The amount of buttons to display per row."],
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 = {
order = 12,
@@ -643,7 +645,7 @@ local function BuildABConfig()
name = L["Button Size"],
desc = L["The size of the action buttons."],
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 = {
order = 13,
@@ -651,7 +653,7 @@ local function BuildABConfig()
name = L["Button Spacing"],
desc = L["The spacing between buttons."],
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 = {
order = 14,
@@ -659,7 +661,7 @@ local function BuildABConfig()
name = L["Backdrop Spacing"],
desc = L["The spacing between the backdrop and the buttons."],
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 = {
order = 15,
@@ -667,7 +669,7 @@ local function BuildABConfig()
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."],
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 = {
order = 16,
@@ -675,7 +677,7 @@ local function BuildABConfig()
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."],
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 = {
order = 17,
@@ -683,7 +685,7 @@ local function BuildABConfig()
name = L["Alpha"],
isPercent = true,
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
}
}
}