That means it's only receiving the "self" argument, without any information about the link. You'll have to keep track of that yourself:
Code:
local lastLink, lastText, useGameTooltip
local function OnHyperlinkEnter(frame, link, text)
lastLink, lastText, useGameTooltip = link, text, showLinkType[link:match("(%a+):%d+")]
if useGameTooltip then
GameTooltip:SetOwner(ChatFrame1Tab, "ANCHOR_TOPLEFT", 20, 20)
GameTooltip:SetHyperlink(link)
GameTooltip:Show()
elseif useGameTooltip == false then
-- Uses a special tooltip, just let the default function handle it.
SetItemRef(link, text, "LeftButton", frame)
end
end
local function OnHyperlinkLeave(frame)
if useGameTooltip then
GameTooltip:Hide()
elseif useGameTooltip == false then
-- Uses a special tooltip, just let the default function handle it.
SetItemRef(lastLink, lastText, "LeftButton", frame)
end
lastLink, lastText, lastLinkIsNormal = nil, nil, nil
end
Green lines are new.
Yellow lines are changed. A few lines were removed, too. (On a side note, you can just do "if X then" instead of "if X == true then" if your only need to to make sure X isn't false or nil.)