Battle pets have their own tooltip object; they don't use the GameTooltip at all. Battle pet abilities, garrison followers, follower abilities, and missions also have their own tooltips objects. You can see how the default UI handles those
here, though really it would be a lot easier to just call
the click function on mouseover instead of recreating it:
Code:
chat:HookScript('OnHyperlinkEnter', ChatFrame_OnHyperlinkShow)
If you wanted to filter out certain types of links, and/or not have it treat "mouseover while shift is down" as a shift-click, then this would still be simpler:
Code:
local linktypes = {
-- These use GameTooltip:
achievement = true,
enchant = true,
glyph = true,
item = true,
instancelock = true,
quest = true,
spell = true,
talent = true,
unit = true,
-- This uses FloatingBattlePetTooltip:
battlepet = true,
-- This uses FloatingPetBattleAbilityTooltip:
battlePetAbil = true,
-- This uses FloatingGarrisonFollowerTooltip:
garrfollower = true,
-- This uses FloatingGarrisonFollowerAbilityTooltip:
garrfollowerability = true,
-- This uses FloatingGarrisonMissionTooltip:
garrmission = true,
}
local function OnHyperlinkEnter(frame, link, text)
local linkType = strsplit(":", link)
if linktypes[linktype] and not IsModifiedClick() then
ChatFrame_OnHyperlinkShow(frame, link, text, "LeftButton")
end
end
chat:HookScript('OnHyperlinkEnter', OnHyperlinkEnter)
Remember to update your OnHyperlinkLeave script to also hide those additional tooltip objects.
Also you can just use HookScript instead of manually storing and replacing and calling the original script. If there is no original script then HookScript behaves exactly like SetScript.