Hello, I'm trying to switch a current config over to Ace3.
So here is the issue, i can not figure out how to put a [2] into the config options below is the codes I'm trying to use.
.lua Code
Code:
local ComboColor = C['power'].energy.comboColor
local function SetComboColor(i)
local comboPoints = GetComboPoints('player', 'target') or 0
if (i > comboPoints or UnitIsDeadOrGhost('target')) then
return 1, 1, 1
else
return ComboColor[i].r, ComboColor[i].g, ComboColor[i].b
end
end
Config Code
Code:
C['power'] = {
energy = {
comboColor = {
[1] = {r = 1.0, g = 1.0, b = 1.0}, -- Combo Point #1
[2] = {r = 1.0, g = 1.0, b = 1.0}, -- Combo Point #2
[3] = {r = 1.0, g = 1.0, b = 1.0}, -- Combo Point #3
[4] = {r = 0.9, g = 0.7, b = 0.0}, -- Combo Point #4
[5] = {r = 1.0, g = 0.0, b = 0.0}, -- Combo Point #5
},
},
}
Now in the Ace3 Config It will not let me just do
Code:
[1] = {
order = 8,
type = "color",
name = L["ComboPoint 1 Color"],
hasAlpha = false,
disabled = function() return not db.mainbar.enable end,
get = function(info)
local hb = db.power.energy[ info[#info] ]
return hb.r, hb.g, hb.b
end,
set = function(info, r, g, b)
db.power.energy[ info[#info] ] = {}
local hb = db.power.energy[ info[#info] ]
hb.r, hb.g, hb.b = r, g, b
StaticPopup_Show("CFG_RELOAD")
end,
},
So my question is without rewriting this whole thing how do i set it up for Ace3?
Any Help with this would be great.
Thanks
Coke