View Single Post
04-24-17, 11:54 PM   #14
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
Originally Posted by Dejablue View Post
Any way to recycle the frames? Hmmm.
That's what we're doing.

You may also be having trouble with positioning. If you /fstack over the buttons you'll probably find you have a bunch of "BMUDButton"..xxx buttons positioned over the top of each other.

Edit: Thanks syncrow. You will need to keep a tally rather than just using the last itemCount value for the text.

The recycle code

Lua Code:
  1. local BMUDButton
  2. if not _G["BMUDButton"..name] then -- Button does not exist so create it
  3.     BMUDButton = CreateFrame("Button", "BMUDButton"..name, UIParent, "SecureActionButtonTemplate");
  4.     -- BMUDButton points to a shiney new button
  5. else
  6.     BMUDButton = _G["BMUDButton"..name]
  7.     -- BMUDButton points to the previously created button
  8. end
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 04-25-17 at 12:15 AM.
  Reply With Quote