View Single Post
01-19-14, 11:24 PM   #6
pelf
Sentient Plasmoid
 
pelf's Avatar
Premium Member
Join Date: May 2008
Posts: 133
Originally Posted by semlar View Post
You need to make sure you only hook it once.
Right, I forgot about that. Well, I guess that's a problem in that addon I copied that from :\.

Well, actually... If there's code like this:
Code:
frame:SetScript("OnEnter", something)
frame:HookScript("OnEnter", somethingElse)
frame:SetScript("OnEnter", something)
frame:HookScript("OnEnter", somethingElse)
Do calls to SetScript clear all hooks when the script is set to something else, or would the hooks persist? The Blizzard code for the armor tooltip sets the script every time, IIRC.

Update: Tested. SetScript clears the hook, so in this case, because of what the Blizzard code does, it will need to be re-hooked each time.

Last edited by pelf : 01-20-14 at 10:07 AM. Reason: more information
  Reply With Quote