From ESOUI Wiki
This event fires when the game has finished loading (or attempting to load) all of an add-on's files. Add-ons typically use this event to perform initialization tasks.
- A numeric constant; the value of the global variable EVENT_ADD_ON_LOADED.
- A string containing the name of the add-on that has loaded.
local function Initialize() d("Hello, world!") -- -- When this runs, all of our code has loaded, so everything we've defined -- is accessible and ready for use. end local function _onAddonLoaded(eventCode, addonName) if addonName == "MyCoolAddon" then Initialize() end end EVENT_MANAGER:RegisterForEvent("MyExampleEvent", EVENT_ADD_ON_LOADED, _onAddonLoaded)
- Make sure that your event handler is defined before you call RegisterForEvent.
- Add-ons are reloaded from scratch when the user first loads into the game after selecting their character, and whenever something reloads the UI (e.g. the /reloadui command).
- This event will fire even if some of an add-on's files fail to load, whether due to Lua errors or because the files are missing.