View Single Post
11-27-07, 05:03 PM   #3
Tekkub
A Molten Giant
 
Tekkub's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 960
Not quite Slakah, he wants to hook a script handler not a function...

Code:
local orig = GameTooltip:GetScript("OnTooltipSetItem")
GameTooltip:SetScript("OnTooltipSetItem", function(frame, ...)
	-- do crap

	--Call hook, if it exists
	-- It might not exist if nothing else was using this script handler!
	if orig then return orig(frame, ...) end
end)
Also Slakah, if you don't return the values passed back from your hook call at the end, you risk breaking the hook chain. Always pass all args forward and returns back in the chain!
  Reply With Quote