This commit is contained in:
Marvin Dalheimer 2023-04-24 21:31:56 +02:00
commit 5624c972f4
Signed by: Rinma
GPG Key ID: 44CAD3A9F1679D8D
2 changed files with 42 additions and 0 deletions

35
ChatlinkTooltip.lua Executable file
View File

@ -0,0 +1,35 @@
local function showTooltip(self, linkData)
local linkType = string.split(":", linkData)
if linkType == "item"
or linkType == "spell"
or linkType == "enchant"
or linkType == "quest"
or linkType == "talent"
or linkType == "glyph"
or linkType == "unit"
or linkType == "achievement" then
GameTooltip:SetOwner(self, "ANCHOR_CURSOR")
GameTooltip:SetHyperlink(linkData)
GameTooltip:Show()
end
end
local function hideTooltip()
GameTooltip:Hode()
end
local function setOrHookHandler(frame, script, func)
if frame:GetScript(script) then
frame:HookScript(script, func)
else
frame:SetScript(script, func)
end
end
for i = 1, NUM_CHAT_WINDOWS do
local frame = getglobal("ChatFrame"..i)
if frame then
setOrHookHandler(frame, "OnHyperlinkEnter", showTooltip)
setOrHookHandler(frame, "OnHyperlinkLeave", hideTooltip)
end
end

7
ChatlinkTooltip.toc Executable file
View File

@ -0,0 +1,7 @@
## Interface: 11403
## Title: ChatlinkTooltip
## Notes:
## Author: Rinma
## Version: 0.0.1
ChatlinkTooltip.lua