Commit 6c287e9f authored by Robin Schoonover's avatar Robin Schoonover

Only hook tooltips where the normal tooltip methods exist.

parent 1ba5325c
......@@ -32,8 +32,13 @@ function addon:HookTipScript(...)
end
function addon:HookTip(method, hookfunc)
hooksecurefunc(GameTooltip, method, function(self, ...) hookfunc(GameTooltip, ...) end)
hooksecurefunc(ItemRefTooltip, method, function(self, ...) hookfunc(ItemRefTooltip, ...) end)
if GameTooltip[method] then
hooksecurefunc(GameTooltip, method, function(self, ...) hookfunc(GameTooltip, ...) end)
end
if ItemRefTooltip[method] then
hooksecurefunc(ItemRefTooltip, method, function(self, ...) hookfunc(ItemRefTooltip, ...) end)
end
end
addon:HookTipScript("OnTooltipCleared", function(self)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment