WoW:Hooking functions: Difference between revisions

m
catfix, Replaced: <br>{{ood → {{Ood (2)
mNo edit summary
m (catfix, Replaced: <br>{{ood → {{Ood (2))
Line 9: Line 9:


== How to Hook a Function ==
== How to Hook a Function ==
{{ood}}
{{Ood|}}
Let's say we wanted to show the target's level instead of the skull for players and monsters much higher level than us.  The function responsible for hiding the level is TargetFrame_CheckLevel(), so we need to hook that function to make it un-hide the level.
Let's say we wanted to show the target's level instead of the skull for players and monsters much higher level than us.  The function responsible for hiding the level is TargetFrame_CheckLevel(), so we need to hook that function to make it un-hide the level.


Line 135: Line 135:


== Hook Chains ==
== Hook Chains ==
{{ood}}
{{Ood|}}
This can be a little tricky, but it works.  Let's say there are two separate addons, one that attaches the player tooltip to the mouse, and one that replaces ?? with the player's level.  One addon is called "AnchorToolTip", and the other is called "ShowLevel"
This can be a little tricky, but it works.  Let's say there are two separate addons, one that attaches the player tooltip to the mouse, and one that replaces ?? with the player's level.  One addon is called "AnchorToolTip", and the other is called "ShowLevel"


Line 187: Line 187:
* Warning! Blizzard '''does''' add new arguments and return values to their functions. See [[HOWTO: Hook functions in a safer way]] for a solution!
* Warning! Blizzard '''does''' add new arguments and return values to their functions. See [[HOWTO: Hook functions in a safer way]] for a solution!


[[Category: HOWTOs|Hook a Function]]
[[Category:HOWTOs|Hook a Function]]
Anonymous user