Quantcast
About add-ons optimization - WoWInterface
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
01-16-18, 06:04 AM   #24
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 328
Originally Posted by Resike View Post
What do you mean by pre-hooking? Of course if your hook is wrong it's not gonna work. Or if a hook does not actually hook than don't call it a hook.
Lua Code:
  1. local oldBlizzFunc = BlizzFunc
  2.  
  3. function BlizzFunc(...)
  4.     -- your stuff here
  5.  
  6.     oldBlizzFunc(...)
  7. end

People either do this thingy or replace Blizz function entirely to prevent it from doing something, quite common for bag addons.

In this case, if you create an upvalue for a function before some other addon redefines it, you'll be calling original function.

It's not a proper hook, that's why I wrote it in quotes.
__________________

Last edited by lightspark : 01-16-18 at 06:09 AM.
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » About add-ons optimization

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