About ADDON_LOADED and VARIABLES_LOADED events
The description of ADDON_LOADED:
Fires when an addon and its saved variables are loaded. Fires once for each addon (i.e. an addon loaded early in sequence will see ADDON_LOADED events for all addons loaded later).
The description of VARIABLES_LOADED:
Fires when non-addon-specific saved variables are loaded. Addons should generally use ADDON_LOADED to determine whether their saved variables have loaded.
Now here is an example of my own experience.
I use ADDON_LOADED to detect when my addon and the variables are loaded, for all my addons. Now the interesting part is that at some point in some addon I actually used the variables after ADDON_LOADED and they were not yet populated, so I played a bit and added VARIABLES_LOADED so after addon loaded I would also register VARIABLES_LOADED and after the variables one, THEN my variable was truly loaded.
It was weird, anyone else had such experience? :/
|