View Single Post
08-04-12, 05:07 AM   #192
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
Originally Posted by Lombra View Post
Huh.. that seems weird. Should really rename that function then. But if it stays, it could be neat. RegisterUnitEvent("ADDON_LOADED", "MyAddon") \o/
Exactly, saves us having the if-check like this!

If you call it from the root of the file you can even :RegisterUnitEvent("ADDON_LOADED", (...)) since ... contains the addon name too, hehe. It's in parenthesis to strip away the table argument, maybe it will bug it or it may compare the string with the table, quite unnecessary.

*Edit*

Hmm, sadly, I tested using this:
Code:
/run CreateFrame("Frame","T")T:RegisterUnitEvent("ADDON_LOADED","Blizzard_PetJournal")T:SetScript("OnEvent",print)
And it fired the print each time ADDON_LOADED fired, not just for the Blizzard_PetJournal :'(

Last edited by Vlad : 08-04-12 at 07:48 AM.