Hi all,
I am trying to tweak my options table and create a tab only for a specific unit and here's what I've got so far.
Lua Code:
function CreateOption()
if not option then
option = {
order = A:GetModuleOrder(),
type = "group",
childGroups = "tab",
name = "Unitframe",
args = {
unit = {
order = 1,
type = "group",
childGroups = "tab",
name = "Unit",
args = CreateUnitOption(),
},
},
};
end
return option;
end
function CreateUnitOption()
local option = {
selected = {
order = 1,
type = "select",
name = "Selected Unit",
values = unitList,
get = function(info)
return selectedUnit;
end,
set = function(info, ...)
selectedUnit = ...;
end,
},
general = CreateGeneralOption(),
};
for _, bar in pairs({"Health", "Power"}) do
option[string.lower(bar)] = CreateBarOption(bar);
end
return option;
end
On red colored section, as shown on the image above, I would like to create a "ClassPower" tab only when the selected unit is player.
(Which will obviously be hidden when the other units are selected
)
What would be the best way to achieve such thing?
Thank you in advance and I wish you all the best!!