View Single Post
12-04-12, 05:44 PM   #34
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,315
Originally Posted by semlar View Post
OnTooltipSetUnit fires when it's populated with unit information whether it's from SetUnit or SetHyperlink.

I don't know for sure that you need to wait for it, but I would be careful.
One problem would be if you're to call a function and need a return from it, you can't halt execution to wait for a script to fire. The game only allows a single thread to run the Lua engine, so the resulting script would never run since the thread is occupied in the function. In essence, you'd run yourself into an infinite loop and freeze the entire game client.

The only way around this is to recode the entire thing into a request-and-callback code style, which would add another layer of complexity to it.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote