I am about to lose my mind with this issue. I've done it a million different ways, but cannot for the life of me get this to work.
I'm simply trying to create an invisible frame, subscribe it to a few events and print those events when they fire.
Addon.toc
Code:
## Interface: 90200
## Title: |cff93E9BEAddon Title
## Version: 0.1
## Author: cosmic_kid
## SavedVariables: CKNdb
## DefaultState: enabled
Addon.lua
Addon.lua
Lua Code:
local AddonParent = CreateFrame("Frame")
print("HELLOOOOOOOO") -- This prints
local OnLoad = function(self)
print("ONLOAD") -- This does not print
self:RegisterEvent("PLAYER_LOGIN")
self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("ARENA_OPPONENT_UPDATE")
end
local OnEvent = function(self, event, ...)
print(event) -- This does not print
end
AddonParent:SetScript("OnEvent", OnEvent)
AddonParent:SetScript("OnLoad", OnLoad)