Thread: Event Chaining
View Single Post
04/15/14, 04:42 AM   #8
Vicster0
 
Vicster0's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 82
Originally Posted by Kith View Post
You could try using the ZO built in prehook. As far as I know there is no posthook though so it'll run before the default code does
Lua Code:
  1. ZO_PreHookHandler(ZO_PlayerInventoryTabsButton7, 'OnMouseUp', function(...)
  2.     -- do your stuff here, the ... is the variables passed
  3. end)
I had no idea there was a built in PreHook in the API. I just made them myself where necessary and store the old event handler separately in case the player turns off the addon. The only problem I have run into here is if the original event handler eventually runs protected/private code somewhere in the stack. Does anyone know if the ZO PreHook accounts for that?
  Reply With Quote