fix: game tooltip override fix

This commit is contained in:
Salikh Gurgenidze
2025-11-18 03:07:08 +04:00
parent c2d9831c08
commit 8f47879955
+6 -3
View File
@@ -136,30 +136,33 @@ function Tooltip:Initialize()
-- Hook SetBagItem -- Hook SetBagItem
local oldSetBagItem = GameTooltip.SetBagItem local oldSetBagItem = GameTooltip.SetBagItem
function GameTooltip:SetBagItem(bag, slot) function GameTooltip:SetBagItem(bag, slot)
oldSetBagItem(self, bag, slot) local ret = oldSetBagItem(self, bag, slot)
local link = GetContainerItemLink(bag, slot) local link = GetContainerItemLink(bag, slot)
if link then if link then
Tooltip:AddInventoryInfo(self, link) Tooltip:AddInventoryInfo(self, link)
end end
return ret
end end
-- Hook SetHyperlink for chat links -- Hook SetHyperlink for chat links
local oldSetHyperlink = GameTooltip.SetHyperlink local oldSetHyperlink = GameTooltip.SetHyperlink
function GameTooltip:SetHyperlink(link) function GameTooltip:SetHyperlink(link)
oldSetHyperlink(self, link) local ret = oldSetHyperlink(self, link)
if link and strfind(link, "item:") then if link and strfind(link, "item:") then
Tooltip:AddInventoryInfo(self, link) Tooltip:AddInventoryInfo(self, link)
end end
return ret
end end
-- Hook SetInventoryItem for character paperdoll -- Hook SetInventoryItem for character paperdoll
local oldSetInventoryItem = GameTooltip.SetInventoryItem local oldSetInventoryItem = GameTooltip.SetInventoryItem
function GameTooltip:SetInventoryItem(unit, slot) function GameTooltip:SetInventoryItem(unit, slot)
oldSetInventoryItem(self, unit, slot) local ret = oldSetInventoryItem(self, unit, slot)
local link = GetInventoryItemLink(unit, slot) local link = GetInventoryItemLink(unit, slot)
if link then if link then
Tooltip:AddInventoryInfo(self, link) Tooltip:AddInventoryInfo(self, link)
end end
return ret
end end
-- Also hook ItemRefTooltip for chat links -- Also hook ItemRefTooltip for chat links