Skip to content
Open
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
31 changes: 18 additions & 13 deletions src/Classes/TradeQueryRequests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -397,24 +397,27 @@ function TradeQueryRequestsClass:FetchResultBlock(url, callback)
item.implicitMods = item.implicitMods or { }
item.explicitMods = item.explicitMods or { }

t_insert(rawLines, "Implicits: " .. (#item.enchantMods + #item.runeMods + #item.implicitMods))
for _, modLine in ipairs(item.enchantMods) do
t_insert(rawLines, "{enchant}" .. escapeGGGString(modLine))
end
for _, modLine in ipairs(item.runeMods) do
t_insert(rawLines, "{enchant}{rune}" .. escapeGGGString(modLine))
end
for _, modLine in ipairs(item.implicitMods) do
t_insert(rawLines, escapeGGGString(modLine))
end
for _, modLine in ipairs(item.explicitMods) do
local function processLine(modLine)
local s = ""
for flagName, flag in pairs(modLine.flags or {}) do
if flag then
s = s .. string.format("{%s}", flagName)
end
end
t_insert(rawLines, s .. escapeGGGString(modLine.description))
return escapeGGGString(modLine.description)
end
t_insert(rawLines, "Implicits: " .. (#item.enchantMods + #item.runeMods + #item.implicitMods))
for _, modLine in ipairs(item.enchantMods or {}) do
t_insert(rawLines, "{enchant}" .. processLine(modLine))
end
for _, modLine in ipairs(item.runeMods or {}) do
t_insert(rawLines, "{enchant}{rune}" .. processLine(modLine))
end
for _, modLine in ipairs(item.implicitMods or {}) do
t_insert(rawLines, processLine(modLine))
end
for _, modLine in ipairs(item.explicitMods or {}) do
t_insert(rawLines, processLine(modLine))
end
if item.mirrored then
t_insert(rawLines, "Mirrored")
Expand All @@ -428,14 +431,16 @@ function TradeQueryRequestsClass:FetchResultBlock(url, callback)
t_insert(rawLines, "Sanctified")
end

local pseudoMod = trade_entry.item.pseudoMods and trade_entry.item.pseudoMods[1]
local pseudoModLine = pseudoMod and (pseudoMod.description or pseudoMod)
table.insert(items, {
amount = trade_entry.listing.price.amount,
currency = trade_entry.listing.price.currency,
priceType = trade_entry.listing.price.type,
item_string = table.concat(rawLines, "\n"),
whisper = trade_entry.listing.whisper,
trader = trade_entry.listing.account.name,
weight = trade_entry.item.pseudoMods and trade_entry.item.pseudoMods[1]:match("Sum: (.+)") or "0",
weight = trade_entry.item.pseudoMods and pseudoModLine:match("Sum: (.+)") or "0",
id = trade_entry.id
})
end
Expand Down
Loading