Perhaps you can take a look at OnHyperlinkEnter, OnHyperlinkLeave?
Lua Code:
local function chatHoverIn(cf, link, text)
local typ = string.match(link, "^(.-):")
--[[ print(typ,link)
local tbl = { strsplit(":", link) }
for k,v in pairs(tbl) do
print(v)
end
]]--
if(typ == "item" or typ == "enchant" or typ == "spell" or typ == "quest" or typ == "currency") then
GameTooltip:SetOwner(UIParent, "ANCHOR_CURSOR")
GameTooltip:SetHyperlink(link)
ShowUIPanel(GameTooltip)
elseif(typ == "player") then
local typ, name = string.match(link, "^(.-):(.*):(.*):")
if(name) then
GameTooltip:SetOwner(UIParent, "ANCHOR_CURSOR")
GameTooltip:SetUnit(name)
ShowUIPanel(GameTooltip)
end
end
end
local function chatHoverOut(cf, link, text)
HideUIPanel(GameTooltip)
end
for i = 1, NUM_CHAT_WINDOWS do
local cfn = format('ChatFrame%i',i)
local cf = _G[cfn]
cf:HookScript("OnHyperlinkEnter",chatHoverIn)
cf:HookScript("OnHyperlinkLeave",chatHoverOut)
end