View Single Post
06-04-14, 10:45 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
I didn't look through your entire addon, but the most likely cause of the problem you described is that SUF doesn't create its frames right away when it loads -- it probably waits for PLAYER_LOGIN or some other later event, which means that your addon needs to do the same. However, there's no guarantee that registering for the same event will make your event handler run after SUF's event handler, so the best solution here would be to just hook the SUF function that creates the frames, eg. if that method is "ShadowedUF:MakeAFrame(unit)" then you'd hook it like so:

Code:
if ShadowedUF then
     hooksecurefunc(ShadowedUF, "MakeAFrame", function(ShadowedUF, unit)
          if unit == "player" then
               -- SUFUnitplayer has already been created by the original function, do what you want with it here
          end
     end)
end
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote