Lore archive · Warcraft Wiki, 2023 dump
AddOn loading process
Last wiki revision 2021-12-20
This page details how AddOns load and unload, including the order when information becomes available such as SavedVariables and character details.
Blizzard's AddOns usually load first (the native UI), followed by custom AddOns in alphabetical order. However, .toc directives can override this behaviour (e.g. or ).
Within an AddOn:
- XML and Lua files load sequentially as listed in the .toc file, and also when reaching or tags in XML.
- Saved variables load after the last file, overwriting any default values set earlier.
- Finally, fires to indicate the AddOn has finished loading. This is the earliest time for an AddOn to read its saved variables.
AddOns load in parallel to the login screen, but can register for events to access information as it becomes available. However, LoadOnDemand AddOns might trigger part-way or after all steps have finished:
Normal sequence:
- 1) * Fires when each AddOn finishes loading, including all files and saved variables.
- 2) * Confirm which AddOn loaded using the first argument (in case a LoadOnDemand AddOn loaded in parallel), access saved variables, and deregister from ADDON_LOADED to avoid repeated callbacks.
- 1) * Fires during the loading screen when logging in or reloading, before the first . Most information about the game world is available to the UI.
- 2) * Finish any one-time initialization and frame placement, so they are in place when the load screen disappears.
- 1) * Fires during any loading screen including logging in, reloading or entering an instance. The first time happens after . If this is a reload, talent information is also available.
- 2) * Finish any reoccuring (ie, instance-dependent) initialization and frame placement, so they are in place when the load screen disappears.
- 1) * Fires when the player is entering combat lockdown. If the player is in combat while reloading, it will follow.
- 2) * Finish any outstanding modifications to secure frames, as they are unalterable during combat lockdown.
- 1) * Fires when spells in the spellbook is populated, and again when it changes. Currently, this event fires after the preceeding events (but it was not always this way).
- 2) * Update any pertinent non-secure frames.
- Error condition:
- Fires when the client runs out of memory while attempting to load saved variables, after.
- Usually there is no further action; the client displays a popup informing the user of the error.
- 1) * Does not imply logout, as it may preceed another loading screen (instances, continents, etc.).
- 1) * Last chance to modify SavedVariables before AddOns unload.
- 1) * All AddOns commit SavedVariables prior to reloading, quitting or logging off. Called once only, rather than for each AddOn. This does not occur during a crash or Alt-F4.
LoadingOrder.toc file1.lua file2.xml file3.lua file1.lua file2.xml file2.5.lua file3.lua
- 1) Interface:
- 2) Title: Loading Order Demo
- 3) SavedVariables: LoadingOrderSavedVar
- Handling events for information on how to sign up to receive event notifications
Source
https://warcraft.wiki.gg/wiki/AddOn_loading_process · retrieved 2023-11-13 · CC BY-SA 4.0
Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.
This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.