View Single Post
02/20/15, 11:53 PM   #1
papaoscar90
Join Date: Feb 2015
Posts: 5
Newcomer - Not sure why only one shows

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:
  1. FooAddon = {}
  2.  
  3. FooAddon.name = "FooAddon"
  4.  
  5. function FooAddon:Initialize()
  6.     d("Initialized")
  7. end
  8.  
  9. function FooAddon.OnAddOnLoaded(event, addonName)
  10.     if addonName == "FooAddon" then
  11.         FooAddon:Initialize()
  12.     end
  13. end
  14.  
  15. function FooAddon.Activated()
  16.     d("Activated")
  17. end
  18.  
  19. EVENT_MANAGER:RegisterForEvent("FooAddon", EVENT_ADD_ON_LOADED, FooAddon.OnAddOnLoaded)
  20. 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?
  Reply With Quote