WoW:Hooking functions: Difference between revisions
Jump to navigation
Jump to search
Modified a word,it wasn't spelled right.
mNo edit summary |
(Modified a word,it wasn't spelled right.) |
||
| Line 2: | Line 2: | ||
'''Hooking functions''' allows you to replace a function value in an accessible environment by a function of your own, calling the original function before or after execution of new code. Hooking enables addons to modify and/or extend the behavior of the default UI and API. | '''Hooking functions''' allows you to replace a function value in an accessible environment by a function of your own, calling the original function before or after execution of new code. Hooking enables addons to modify and/or extend the behavior of the default UI and API. | ||
Depending on how the behavior of the original function is | Depending on how the behavior of the original function is modified, one or more of three hook types may be used: | ||
;Pre-hooks : New code executes before calling the original function, potentially choosing to modify the parameters passed to it, or not call it at all | ;Pre-hooks : New code executes before calling the original function, potentially choosing to modify the parameters passed to it, or not call it at all | ||
;Post-hooks : New code executes after the original function, potentially using the original function's return values. | ;Post-hooks : New code executes after the original function, potentially using the original function's return values. | ||