View Single Post
02-10-12, 04:37 AM   #8
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
ADDON_LOADED fires every time any addon loads. This includes LOD addons, which can (and usually do) load after the initial login sequence completes.

If you register for ADDON_LOADED and PLAYER_LOGIN, and print messages each time they fire, you might see something like this:
  1. *Player clicks Enter World from the character selection screen*
  2. ADDON_LOADED, AddonLoader
  3. ADDON_LOADED, BadBoy
  4. ADDON_LOADED, Blizzard_ClientSavedVariables
  5. ADDON_LOADED, Blizzard_CombatLog
  6. ADDON_LOADED, Clique
  7. ADDON_LOADED, Grid
  8. ADDON_LOADED, Macaroon
  9. ADDON_LOADED, Squire2
  10. ADDON_LOADED, TomTom
  11. PLAYER_LOGIN
  12. *Loading screen disappears and player can see the game world*
  13. ADDON_LOADED, Bazooka
  14. ADDON_LOADED, TourGuide
  15. *Player types /squire to open the options for the addon Squire2*
  16. ADDON_LOADED, Squire2_Config
  17. *Player opens the mailbox*
  18. ADDON_LOADED, Postal
  19. *Player opens the auction house*
  20. ADDON_LOADED, Blizzard_AuctionUI
  21. *Player opens the currency/token frame*
  22. ADDON_LOADED, Blizzard_TokenUI
  23. ADDON_LOADED, Exonumist
Everything before PLAYER_LOGIN was a "normal" addon, not LOD.

The next two addons (Bazooka and TourGuide) are not LOD, but they do specify a LoadManager and that LoadManager is present (in this case AddonLoader), so they are treated as LOD. In this case, other data tells AddonLoader to load them "Always", so they get loaded immediately after login. This technique is often used to help reduce the amount of time users spend waiting for the loading screen.

Squire2_Config is LOD, and is loaded "manually" by Squire2 when the user requests the options panel.

Postal is not LOD either, but is treated as such because its LoadManager exists (AddonLoader again), and its load condition tells AddonLoader to load it when the mailbox opens.

Blizzard_AuctionUI is LOD, and is loaded by the game when the user wants the auction house.

Blizzard_TokenUI is also LOD, and is loaded by the game when the user wants the token frame.

Exonumist is not LOD, but is treated as such because it specifies a LoadsWith condition. In this case, it specifies that it should load with the Blizzard_TokenUI, so when that addon loads, so does this one. If the addon listed under LoadsWith was not LOD, and was loaded during the initial login sequence, this addon would also load at that time. If the addon listed under LoadsWith did not exist, this addon would never load, although LoadsWith is not the same as Dependencies, so manually calling LoadAddOn("Exonumist") would force it to load, whereas calling LoadAddOn on an addon whose Dependencies were missing would fail.

As for your code, honestly I did not read through all of it. It's very long, and just sitting down and reading someone else's addon code like a novel from start to finish is not something most people would call fun.
  Reply With Quote