Let's compare methods between WoW and ESO so that you can get your bearings.
In WoW:
Lua Code:
local f = CreateFrame("Frame", nil, UIParent)
f:RegisterEvent("ADDON_LOADED")
f:SetScript("OnEvent", function(self, event, addon)
if addon == "MyAddon" then
--do stuff
end
end)
In ESO:
Lua Code:
local f = CreateTopLevelWindow("MyAddonFrame")
f:RegisterForEvent(EVENT_ADD_ON_LOADED, function(event, addon)
if addon == "MyFrame" then
--do stuff
end
end)
or, you can do it this way in ESO (register your event through the game's EVENT_MANAGER instead of through a frame)
Lua Code:
EVENT_MANAGER:RegisterForEvent("MyAddon", EVENT_ADD_ON_LOADED, function(event, addon)
if addon == "MyAddon" then
--do stuff
end
end)
As you can see, both WoW and ESO pass the event name/code through the event handler before the args that come with the event.