My take on an event handler:
https://github.com/p3lim-wow/Inomena...ore/events.lua
Code:
-- this will register and assign a method in the function creation itself, handled by metatables
function E:PLAYER_LOGIN()
-- do something
return true -- unregister
end
-- also normal functionality
E:RegisterEvent('PLAYER_LOGIN', methodName)
E:UnregisterEvent('PLAYER_LOGIN', methodName)
-- manually execute all methods for an event
E:Call('PLAYER_LOGIN', arg1, arg2, ...)
No support for unit events tho'