Hi Fizzlemizz
Thanks for that, using
_G[] does get rid of the errors yet it does not give me the desired button layout.
With every button selected I get just 2 visible, (btns 6 and 10), and neither is anchored to the frame.
I have commented out the original buttons setpoints to test.
Here is my table of variables and the updated function;
Lua Code:
local VariableList = {
currentParentAnchorPoint = "BOTTOM",
currentAnchorButton = NewbDevBoxButtonFrameReloadButton,
currentChildAnchorPoint = "TOP",
currentSideGap = 0,
currentYGap = NumberList.actionButtonYGap,
currentButtonCount = 2,
topAnchorButton = NewbDevBoxInterfaceFrameReloadButton
}
local function buttonFrameButtonLayout()
for k, v in pairs(NewbDevBoxDisplayButtonTable) do
if v then
thisButton = _G["NewbDevBoxButtonFrame" .. k]
thisButton:ClearAllPoints()
thisButton:SetPoint(
VariableList.currentParentAnchorPoint,
VariableList.currentAnchorButton,
VariableList.currentChildAnchorPoint,
VariableList.currentSideGap,
VariableList.currentYGap
)
if VariableList.currentButtonCount == 3 then
VariableList.currentParentAnchorPoint = "LEFT"
VariableList.currentAnchorButton = VariableList.topAnchorButton
VariableList.currentChildAnchorPoint = "RIGHT"
VariableList.currentSideGap = NumberList.actionButtonSideGap
VariableList.currentYGap = 0
VariableList.currentButtonCount = 1
elseif VariableList.currentButtonCount == 1 then
VariableList.currentParentAnchorPoint = "BOTTOM"
VariableList.currentAnchorButton = thisButton
VariableList.currentChildAnchorPoint = "TOP"
VariableList.currentSideGap = 0
VariableList.currentYGap = NumberList.actionButtonYGap
VariableList.currentButtonCount = VariableList.currentButtonCount + 1
VariableList.topAnchorButton = thisButton
else
VariableList.currentParentAnchorPoint = "BOTTOM"
VariableList.currentAnchorButton = thisButton
VariableList.currentChildAnchorPoint = "TOP"
VariableList.currentSideGap = 0
VariableList.currentYGap = NumberList.actionButtonYGap
VariableList.currentButtonCount = VariableList.currentButtonCount + 1
end
end
end
end
I have uploaded both my
lua and
toc files to pasbin