fix: tooltip

This commit is contained in:
Salikh Gurgenidze
2025-12-28 00:52:51 +04:00
parent 89db6d04fa
commit 0b1b3e2dc0
5 changed files with 116 additions and 34 deletions
+10 -1
View File
@@ -7,7 +7,10 @@ addon.Modules.Tooltip = Tooltip
-- Helper function to get item ID from link (Lua 5.0 compatible)
local function GetItemIDFromLink(link)
if not link then return nil end
local _, _, itemID = strfind(link, "item:(%d+):?")
if type(link) == "number" then return link end
-- Try to find itemID in a standard link or a raw item:ID string
local _, _, itemID = string.find(link, "item:(%d+)")
return itemID and tonumber(itemID) or nil
end
local function CountCurrentCharacterItems(itemID)
@@ -277,6 +280,12 @@ function Tooltip:AddInventoryInfo(tooltip, link)
return
end
-- Guard against double-adding for the same item on the same tooltip
if tooltip.GudaInventoryAdded == itemID then
return
end
tooltip.GudaInventoryAdded = itemID
local totalBags = 0
local totalBank = 0
local totalMail = 0