fix: poor tooltip for mailboxframe
This commit is contained in:
+6
-6
@@ -101,10 +101,13 @@ scanTooltip:SetOwner(WorldFrame, "ANCHOR_NONE")
|
||||
|
||||
-- Get item link from mailbox attachment (WoW 1.12.1 workaround)
|
||||
function Utils:GetInboxItemLink(index, itemIndex)
|
||||
-- Try global function first (if it exists on this server/version)
|
||||
if GetInboxItemLink then
|
||||
local link = GetInboxItemLink(index)
|
||||
if link then return link end
|
||||
end
|
||||
|
||||
-- In 1.12.1, GameTooltip:GetHyperlink() does not exist.
|
||||
-- Actually, in 1.12.1, there's no official API to get the link from a mailbox item
|
||||
-- if GetInboxItemLink(index) is not available (it's often NOT available in Vanilla).
|
||||
|
||||
-- Let's try to use GetItemInfo(name) as the primary way.
|
||||
local name = GetInboxItem(index, itemIndex)
|
||||
if name then
|
||||
@@ -114,9 +117,6 @@ function Utils:GetInboxItemLink(index, itemIndex)
|
||||
end
|
||||
end
|
||||
|
||||
-- Fallback: If we still don't have it, we might try to scan the tooltip for the name
|
||||
-- but GetInboxItem already gave us the name.
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user