commit 5624c972f4bc858884a707a0253266cbe9434650 Author: Marvin Dalheimer Date: Mon Apr 24 21:31:56 2023 +0200 Init diff --git a/ChatlinkTooltip.lua b/ChatlinkTooltip.lua new file mode 100755 index 0000000..ce62427 --- /dev/null +++ b/ChatlinkTooltip.lua @@ -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 \ No newline at end of file diff --git a/ChatlinkTooltip.toc b/ChatlinkTooltip.toc new file mode 100755 index 0000000..7a40c52 --- /dev/null +++ b/ChatlinkTooltip.toc @@ -0,0 +1,7 @@ +## Interface: 11403 +## Title: ChatlinkTooltip +## Notes: +## Author: Rinma +## Version: 0.0.1 + +ChatlinkTooltip.lua \ No newline at end of file