View Single Post
03-26-16, 11:28 AM   #3
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
Originally Posted by Fizzlemizz View Post
Rather than tremove and tinsert (which don't return anything) add the frame name to your table by name
Code:
    local frame = TDButton_FramePool['TDButton_Overlay_' .. id]
    if not frame then
        frame = CreateFrame('Frame', 'TDButton_Overlay_' .. id, parent);
        TDButton_FramePool['TDButton_Overlay_' .. id] = frame
-- You waon't need to set the name attribute
    end
Except that tremove returns the value that's been removed. In your snippet above, you're only adding the frame to the pool if it's newly-created, but the destroy function removes them all so this will be an issue.
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.
  Reply With Quote