I may have just answered my own question, but am still looking to make sure I am along the right lines.
This:
Lua Code:
FooAddon = {}
FooAddon.name = "FooAddon"
function FooAddon.Activated()
d("Activated")
end
function FooAddon:Initialize()
d("Initialize")
EVENT_MANAGER:RegisterForEvent(FooAddon.name, EVENT_PLAYER_ACTIVATED, FooAddon.Activated)
end
function FooAddon.OnAddOnLoaded(event, addonName)
if addonName ~= "FooAddon" then
return
else
FooAddon:Initialize()
end
end
EVENT_MANAGER:RegisterForEvent("FooAddon", EVENT_ADD_ON_LOADED, FooAddon.OnAddOnLoaded)
This outputs the "Activated" again but not Initialize. So it is indeed checking the names of the addons and executing the Initialize() function. Am I correct in assuming that the OnAddOnLoaded function just completes itself before the game is actually out of the loading screen? So anything that it tries to do just doesn't work because the game hasn't actually finished loading?