View Single Post
08-03-12, 01:47 PM   #191
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Originally Posted by Vladinator View Post
So at some point they made in QueueStatusFrame.lua a global wrapFunc function, should be local if you ask me. :P

Also a bit intrigued by the new Frame:RegisterUnitEvent("event", "unit1"[, "unitN"])

For example the buff frame uses :RegisterUnitEvent("UNIT_AURA", "player", "vehicle") instead of the regular event registering then checking if the first argument equals player or vehicle, e.g. I wonder if this means we can use this to technically check if the first argument equals one of our given arguments or if it's hard coded to work with only some events.

I got to test it, seems that it works. Basically any event where you wish the first argument to be one of the "fake units" when doing the RegisterUnitEvent call, then the OnEvent will fire your function. It works like regular events and all, only you can avoid having the "x or y or z ..." check in your function as it's done before it even fires. I guess it's more performance friendly when done in C level? Considering all the "UNIT_" events.
Huh.. that seems weird. Should really rename that function then. But if it stays, it could be neat. RegisterUnitEvent("ADDON_LOADED", "MyAddon") \o/
__________________
Grab your sword and fight the Horde!