From 4715fcba6763035acdbb207a7f6d31cc05d41443 Mon Sep 17 00:00:00 2001 From: Salikh Gurgenidze Date: Sat, 22 Nov 2025 04:14:01 +0400 Subject: [PATCH] fix: bank slot tooltips and bagslot tooltips --- Core/Tooltip.lua | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/Core/Tooltip.lua b/Core/Tooltip.lua index a4b33dc..df3d899 100644 --- a/Core/Tooltip.lua +++ b/Core/Tooltip.lua @@ -331,19 +331,35 @@ function Tooltip:Initialize() -- Hook SetBagItem local oldSetBagItem = GameTooltip.SetBagItem + local oldSetInventoryItem = GameTooltip.SetInventoryItem function GameTooltip:SetBagItem(bag, slot) return WithDeferredMoney(self, function() - local ret = oldSetBagItem(self, bag, slot) - local link = GetContainerItemLink(bag, slot) - if link then - Tooltip:AddInventoryInfo(self, link) + local bankFrame = getglobal("BankFrame") + if bag == -1 and bankFrame and bankFrame:IsVisible() then + local invSlot = BankButtonIDToInvSlotID(slot) + if invSlot then + -- Use the inventory item method for bank main bag + local ret = oldSetInventoryItem(self, "player", invSlot) + local link = GetInventoryItemLink("player", invSlot) + if link then + Tooltip:AddInventoryInfo(self, link) + end + return ret + end + return nil + else + local ret = oldSetBagItem(self, bag, slot) + local link = GetContainerItemLink(bag, slot) + if link then + Tooltip:AddInventoryInfo(self, link) + end + return ret end - return ret end) end - -- Hook SetHyperlink for hyperlinks from chat and cached links - local oldSetHyperlink = GameTooltip.SetHyperlink + -- Hook SetHyperlink for hyperlinks from chat and cached links + local oldSetHyperlink = GameTooltip.SetHyperlink function GameTooltip:SetHyperlink(link) return WithDeferredMoney(self, function() local _, _, inner = string.find(link or "", "|H(.+)|h")