I have been doing the "Writing your first addon" tutorial. I get to the part where it should show whether the player enters and exits combat but nothing shows up. So I backed up a little bit and started to try and figure out what is going on. I put in a couple d() with small messages and found out my .AddOnLoaded function never starts.... I followed the tutorial and just cant seem to figure out what is going on.
Folder Struct:
FooAddon
->FooAddon.txt
->FooAddon.lua
Lua Code:
FooAddon = {}
FooAddon.name = "FooAddon"
function FooAddon:Initialize()
d("Initialized")
end
function FooAddon.OnAddOnLoaded(event, addonName)
if addonName == "FooAddon" then
FooAddon:Initialize()
end
end
function FooAddon.Activated()
d("Activated")
end
EVENT_MANAGER:RegisterForEvent("FooAddon", EVENT_ADD_ON_LOADED, FooAddon.OnAddOnLoaded)
EVENT_MANAGER:RegisterForEvent(FooAddon.name, EVENT_PLAYER_ACTIVATED, FooAddon.Activated)
Now I tried the ADD_ON_LOADED one with both "FooAddon" and FooAddon.name. Neither executes the d(). Can somebody tell me what is goin on?