Friday, April 13, 2012

OnLeave not working with GameTooltip Hook OnTooltipSetItem

[:1]Basically, I am hooking OnTooltipSetItem with GameTooltip but I want to be able to do something when the tooltip leave focus. I've tried SetScript OnLeave but this does not seem to work with Character Info equipped items. What am I doing wrong?


Code:
-- hooks
GameTooltip:SetScript("OnLeave", GameTooltip_OnLeave)
GameTooltip:HookScript("OnTooltipSetItem", GameTooltip_OnTooltipSetItem)

-- func
function GameTooltip_OnLeave()
[...]
end
function GameTooltip_OnTooltipSetItem()
[...]
end
|||I guess I'll answer my own questions. Instead of using OnLeave, I used OnTooltipCleared.


Code:
-- hooks
GameTooltip:HookScript("OnTooltipCleared", GameTooltip_OnTooltipCleared)
GameTooltip:HookScript("OnTooltipSetItem", GameTooltip_OnTooltipSetItem)

-- func
function GameTooltip_OnTooltipCleared()
[...]
end
function GameTooltip_OnTooltipSetItem()
[...]
end

No comments:

Post a Comment