mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
feat: fire ADDON_LOADED event after each addon finishes loading
Fire ADDON_LOADED(addonName) after all of an addon's files have been
executed. This is the standard WoW pattern for addon initialization —
addons register for this event to set up defaults after SavedVariables
are loaded:
local f = CreateFrame("Frame")
f:RegisterEvent("ADDON_LOADED")
f:SetScript("OnEvent", function(self, event, name)
if name == "MyAddon" then
MyAddonDB = MyAddonDB or {defaults}
end
end)
Total addon events: 20.
This commit is contained in:
parent
05a37036c7
commit
66431ab762
1 changed files with 6 additions and 0 deletions
|
|
@ -89,6 +89,12 @@ bool AddonManager::loadAddon(const TocFile& addon) {
|
|||
"' in addon '", addon.addonName, "' (XML frames not yet implemented)");
|
||||
}
|
||||
}
|
||||
|
||||
// Fire ADDON_LOADED event after all addon files are executed
|
||||
// This is the standard WoW pattern for addon initialization
|
||||
if (success) {
|
||||
luaEngine_.fireEvent("ADDON_LOADED", {addon.addonName});
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue