I have this block of code but the line pointed to insists that I am anchoring the button to itself but try as I might I can't see why as the idx is clearly different. Now a similar block of code that doesn't go on a second line works fine and I used that code as a base for this. The only difference between the buttons outside of their alignment is that the working block contains CheckButtons that aren't inherited from SecureActionButtonTemplate with checkbutton functionality for toggling whilst the one with problems are Buttons that are inherited from SecureActionButtonTemplate with a cooldown frame added, other than that they have the same base xml framework
The problem block that has 2 lines of buttons
Lua Code:
local function InitialiseButtons()
for idx = 1,10 do
local button = XMP_Main.ButtonFrame.Buttons[idx]
local prevButton = XMP_Main.ButtonFrame.Buttons[idx - 1]
if idx == 1 then
button:SetPoint("TOPLEFT",5,-5)
elseif idx == 6 then
button:SetPoint("BOTTOMLEFT",5,5)
else
button:SetPoint("TOPLEFT",prevButton,"TOPRIGHT",5,0) -- < HERE
end
button:SetWidth(48)
button:SetHeight(48)
button:Show()
end
end
This is the code I used as a basis for the one above .. this one does a straight line of x buttons and works completely fine
Lua Code:
local idx = 1
for i,v in pairs(addonData.TaxiMaps) do
local button = frame.Buttons[idx]
local prevButton = frame.Buttons[idx-1]
if idx == 1 then
button:SetPoint("LEFT",10,0)
else
button:SetPoint("TOPLEFT",prevButton,"TOPRIGHT", 5, 0)
end
idx = idx + 1
end
It's bound to be something really simple that is staring me in the face but I can't see it at all so any help is appreciated.