Hi all
,
I am trying to make an interface options with AceConfig-3.0 and here's what I got so far.
Lua Code:
local anchorList = {TOPLEFT = "TOPLEFT", TOPRIGHT = "TOPRIGHT", BOTTOMRIGHT = "BOTTOMRIGHT", BOTTOMLEFT = "BOTTOMLEFT", LEFT = "LEFT", TOP = "TOP", RIGHT = "RIGHT", BOTTOM = "BOTTOM", CENTER = "CENTER"};
local selectedUnit = "Player";
local testOption = {
type = "group",
childGroups = "tab",
name = "TestOption",
args = {
selected = {
order = 1,
type = "select",
name = "Selected Unit",
values = {Player = "Player", Pet = "Pet", Target = "Target", TargetTarget = "TargetTarget", Focus = "Focus"},
get = function(info)
return selectedUnit;
end,
set = function(info, ...)
selectedUnit = ...;
end,
},
general = {
order = 2,
type = "group",
name = "General",
args = {
p = {
order = 1,
type = "select",
name = "Point",
values = anchorList,
},
rT = {
order = 2,
type = "input",
name = "Relative To",
},
rP = {
order = 3,
type = "select",
name = "Relative Point",
values = anchorList,
},
oX = {
order = 4,
type = "input",
name = "X-Offset",
},
oY = {
order = 5,
type = "input",
name = "Y-Offset",
},
},
},
health = {
order = 3,
type = "group",
name = "Health",
args = {
height = {
order = 1,
type = "range",
name = "Height",
min = 4,
max = 32,
step = 1,
},
texture = {
order = 2,
type = "select",
name = "Texture",
dialogControl = "LSM30_Statusbar",
values = AceGUIWidgetLSMlists.statusbar,
},
},
},
power = {
order = 4,
type = "group",
name = "Power",
args = {
height = {
order = 1,
type = "range",
name = "Height",
min = 4,
max = 32,
step = 1,
},
texture = {
order = 2,
type = "select",
name = "Texture",
dialogControl = "LSM30_Statusbar",
values = AceGUIWidgetLSMlists.statusbar,
},
},
},
},
};
ACR:RegisterOptionsTable("TestOption", testOption);
ACD:AddToBlizOptions("TestOption", nil, nil);
The question is, is it possible to re-use those General, Health and Power tabs, but only change the db entry based on the selected unit? Or should I re-construct all those tabs whenever the unit changes?