Skip to content

Commit

Permalink
Merge pull request #4 from UpG-Labs/patch-1
Browse files Browse the repository at this point in the history
Patch 1
  • Loading branch information
romracer authored Jun 5, 2024
2 parents 06eeb9d + bb8ba26 commit 21618c7
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions ItemRack/ItemRack.lua
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,11 @@ function ItemRack.UpdateClassSpecificStuff()
end

function ItemRack.OnSetBagItem(tooltip, bag, slot)
ItemRack.ListSetsHavingItem(tooltip, ItemRack.GetID(bag, slot))
ItemRack.ListSetsHavingItem(tooltip, ItemRack.GetID(bag, slot), true)
end

function ItemRack.OnSetInventoryItem(tooltip, unit, inv_slot)
ItemRack.ListSetsHavingItem(tooltip, ItemRack.GetID(inv_slot))
ItemRack.ListSetsHavingItem(tooltip, ItemRack.GetID(inv_slot), true)
end

function ItemRack.OnSetHyperlink(tooltip, link)
Expand All @@ -496,16 +496,23 @@ end
do
local data = {}

function ItemRack.ListSetsHavingItem(tooltip, id)
function ItemRack.ListSetsHavingItem(tooltip, id, exact)
if ItemRackSettings.ShowSetInTooltip ~= "ON" then
return
end
local same_ids = ItemRack.SameID
if not id or id == 0 then return end
local same_ids = ItemRack.SameID
for name, set in pairs(ItemRackUser.Sets) do
for _, item in pairs(set.equip) do
if same_ids(item, id) then
data[name] = true
if exact then
item = ItemRack.UpdateIRString(item)
if item==id then
data[name] = true
end
else
if same_ids(item, id) then
data[name] = true
end
end
end
end
Expand Down Expand Up @@ -966,6 +973,7 @@ function ItemRack.PopulateKnownItems()
end
end
end
ItemRack.KnownItems = known
end

--[[ Timers ]]
Expand Down

0 comments on commit 21618c7

Please sign in to comment.