Thread Tools Display Modes
09-01-16, 09:26 AM   #1
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
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'

Last edited by p3lim : 09-01-16 at 09:32 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Wish List » Simplified event handling via callbacks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off