View Single Post
12-12-12, 03:01 PM   #12
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by gmarco View Post
Is the use of:

PLAYER_LOGIN

similar ?

So I can save to check with ADDON_LOADED the arg1 ...
It's not recommended to use PLAYER_LOGIN in replacement of ADDON_LOADED. For major reasons, PLAYER_LOGIN is not guaranteed to fire in all circumstances. Firing at inappropriate times or not at all is a side effect of picking a wrong and irrelevant event to register.

The purpose of PLAYER_LOGIN is to tell addons that all unit-specific data for the player is now available, like UnitName(). This fires only once and might not fire when the UI is reloaded. If an addon is LoD, it may never see this event at all.

ADDON_LOADED is specifically meant for this procedure. It signals the entire environment that an addon has finished loading and all global API and saved data provided by said addon is now available.
__________________
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