Thread Tools Display Modes
03-28-06, 02:52 PM   #1
JIM the Inventor
A Cyclonian
 
JIM the Inventor's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 42
"Event Handler Wrapper"?

I've just been browsing through the 1.10 discussion thread, shown here:

http://forums.worldofwarcraft.com/th...n&T=286547&P=8

On that page, Iriel and slouken discuss the passing of parameters to On- events (in XML):

Q u o t e:
I'm not sure if that's doable either, but if the globals were still set the way they are now, code written in On* blocks could stay as it is today, and code that wishes to take advantage of parameters in the XML could call this:SetScript in the OnLoad block.

-- end Iriel quote -- begin slouken quote --

That means that every dispatch of a handler would have to both set global variables and put them on the stack. It seems like a lot of work for a minority case.

I'll point out that you could easily have this in your own code by creating an event dispatch wrapper that does this.
Whoa! I thought the events were generally untouchable by us authors! What's he talking about? How would one write an event wrapper? Does this imply that we can produce events as well?
  Reply With Quote
03-28-06, 03:04 PM   #2
Esamynn
Featured Artist
Premium Member
Featured
Join Date: Jan 2005
Posts: 395
By a wrapper, slouken was refering to an event dispatch system for your own AddOn. I believe Ace does something like this in that Ace AddOns register events with a dispatch system that is part of Ace instead of the with the default API. When an event fires the API passes the event to the wrapper which in turn passes the event to the OnEvent function.
  Reply With Quote
03-28-06, 03:18 PM   #3
Kaelten
Jack's raging bile duct
 
Kaelten's Avatar
Featured
Join Date: May 2005
Posts: 782
acttually in ace's case we do something like this in the lua

self:Hook("function")

and that will call the same named function thats part of your addon.
__________________
WowAce.com & CurseForge.com Adminstrator
Developer of Ace3, OneBag3, and many other addons and libraries
Project lead and Mac developer for the Curse Client

Anyone that needs what they want
And doesn't want what they need
I want nothing to do with
  Reply With Quote
03-28-06, 03:37 PM   #4
JIM the Inventor
A Cyclonian
 
JIM the Inventor's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 42
Originally Posted by jbcc
By a wrapper, slouken was refering to an event dispatch system for your own AddOn. <snip>. When an event fires the API passes the event to the wrapper which in turn passes the event to the OnEvent function.
Ah. Disappointing.

Okay then. Thank you very much. (I'll just go on faking Blizzard events as best I can. )
  Reply With Quote
03-28-06, 03:47 PM   #5
Kaelten
Jack's raging bile duct
 
Kaelten's Avatar
Featured
Join Date: May 2005
Posts: 782
thea fun thing is you can simulate fake events and even trigger events using Ace's system
__________________
WowAce.com & CurseForge.com Adminstrator
Developer of Ace3, OneBag3, and many other addons and libraries
Project lead and Mac developer for the Curse Client

Anyone that needs what they want
And doesn't want what they need
I want nothing to do with
  Reply With Quote
03-28-06, 06:40 PM   #6
Esamynn
Featured Artist
Premium Member
Featured
Join Date: Jan 2005
Posts: 395
Originally Posted by Kaelten
acttually in ace's case we do something like this in the lua

self:Hook("function")

and that will call the same named function thats part of your addon.
Yah, I didn't really know any details, I just knew that Ace has a centralized event system so it made a good example.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » "Event Handler Wrapper"?

Thread Tools
Display Modes

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