fix: key tooltip

This commit is contained in:
Salikh Gurgenidze
2025-12-24 23:19:35 +04:00
parent 497ffe22d8
commit cf9de34a5d
2 changed files with 21 additions and 31 deletions
+20
View File
@@ -509,6 +509,18 @@ function Guda_ItemButton_SetItem(self, bagID, slotID, itemData, isBank, otherCha
displayTexture = liveTexture
displayCount = liveCount
self.hasItem = true
elseif bagID == -2 then
-- Fallback for keyring in 1.12.1
local link = GetContainerItemLink(bagID, slotID)
if link then
self.hasItem = true
-- We might not have the texture from GetContainerItemInfo, try to get it from GetItemInfo
local _, _, _, _, _, _, _, _, itemTexture = GetItemInfo(link)
displayTexture = itemTexture
displayCount = 1 -- Keyring items are usually unique anyway
else
self.hasItem = false
end
else
-- No item in this slot (even if itemData has cached data)
self.hasItem = false
@@ -955,6 +967,14 @@ function Guda_ItemButton_OnEnter(self)
-- Bank is closed - use cached link
GameTooltip:SetHyperlink(self.itemData.link)
end
elseif self.bagID == -2 then
-- Keyring: SetBagItem might be unreliable for -2 in some 1.12.1 environments, fallback to hyperlink if needed
local link = GetContainerItemLink(self.bagID, self.slotID)
if link then
GameTooltip:SetHyperlink(link)
else
GameTooltip:SetBagItem(self.bagID, self.slotID)
end
else
-- For live mode: use SetBagItem for all bags
GameTooltip:SetBagItem(self.bagID, self.slotID)