View Single Post
06-22-21, 08:21 PM   #7
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
Using the Pastebin code and assuming all your button names are consistant starting with "NewbDevBoxButtonFrame" and prefixed with the name in ButtonTable ie.

Code:
local xxx = CreateFrame("Button", "NewbDevBoxButtonFrameLogoutButton", NewbDevBoxButtonFrame, "SecureActionButtonTemplate, GameMenuButtonTemplate")
You could use:
Lua Code:
  1. local function buttonFrameButtonLayout()
  2.     for k, v in pairs(ButtonTable) do
  3.         thisButton = _G["NewbDevBoxButtonFrame"..k] -- use the name to get the button from the global table.
  4.         thisButton:ClearAllPoints()
  5.             -- ...
  6.         end
  7.     end
  8. end

Edit: typos.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 06-22-21 at 08:59 PM.
  Reply With Quote