Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/Classes/ItemsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ local m_min = math.min
local m_ceil = math.ceil
local m_floor = math.floor
local m_modf = math.modf
local buySimilar = LoadModule("Classes/CompareBuySimilar")

local rarityDropList = {
{ label = colorCodes.NORMAL.."Normal", rarity = "NORMAL" },
Expand Down Expand Up @@ -409,6 +410,15 @@ holding Shift will put it in the second.]])
self:SetDisplayItem()
end)

self.controls.displayItemBuySimilar = new("ButtonControl",
{ "LEFT", self.controls.removeDisplayItem, "RIGHT", true },
{ 8, 0, 100, 20 }, "Buy similar", function()
local itemSlot = self:GetComparisonSlotNameForItem(self.displayItem)
buySimilar.openPopup(self.displayItem, itemSlot, self.build)
end)
self.controls.displayItemBuySimilar.shown = function()
return self.displayItem
end
-- Section: Variant(s)

self.controls.displayItemSectionVariant = new("Control", {"TOPLEFT",self.controls.addDisplayItem,"BOTTOMLEFT"}, {0, 8, 0, function()
Expand Down
4 changes: 4 additions & 0 deletions src/Classes/TradeHelpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ end
---@return number? value returned if the mod is an option and uses values. e.g. timeless jewel
function M.findTradeHash(item, modLine, modType, isDesecrated)
local formattedLine = M.formatDatabaseText(modLine)
-- hack for belt implicits not matching. TODO: use stat_descriptions instead, which define what
-- description is the canonical form that is used on the trade site, either by assuming it's the
-- first one, or one with a marker called "canonical_line"
formattedLine = formattedLine:gsub("Has # Charm Slots", "Has # Charm Slot")
-- the data export splits some mods into different parts, even though they
-- are technically just one stat. we handle that here
local isUnique = item.rarity == "UNIQUE" or item.rarity == "RELIC"
Expand Down
Loading