Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added max level field to the trade query generator #6595

Merged
merged 2 commits into from
Sep 6, 2023
Merged
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
25 changes: 24 additions & 1 deletion src/Classes/TradeQueryGenerator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,19 @@ function TradeQueryGeneratorClass:FinishQuery()
end
end

if options.maxLevel and options.maxLevel > 0 then
queryTable.query.filters.req_filters = {
disabled = false,
filters = {
lvl = {
max = options.maxLevel
}
}
}
end



if options.maxPrice and options.maxPrice > 0 then
queryTable.query.filters.trade_filters = {
filters = {
Expand Down Expand Up @@ -957,7 +970,7 @@ function TradeQueryGeneratorClass:RequestQuery(slot, context, statWeights, callb

local controls = { }
local options = { }
local popupHeight = 97
local popupHeight = 110

local isJewelSlot = slot and slot.slotName:find("Jewel") ~= nil
local isAbyssalJewelSlot = slot and slot.slotName:find("Abyssal") ~= nil
Expand Down Expand Up @@ -1052,6 +1065,13 @@ function TradeQueryGeneratorClass:RequestQuery(slot, context, statWeights, callb
controls.maxPriceLabel = new("LabelControl", {"RIGHT",controls.maxPrice,"LEFT"}, -5, 0, 0, 16, "^7Max Price:")
lastItemAnchor = controls.maxPrice
popupHeight = popupHeight + 23


controls.maxLevel = new("EditControl", {"TOPLEFT",lastItemAnchor,"BOTTOMLEFT"}, 0, 5, 100, 18, nil, nil, "%D", nil, function(buf) end)
controls.maxLevelLabel = new("LabelControl", {"RIGHT",controls.maxLevel,"LEFT"}, -5, 0, 0, 16, "Max Level:")

lastItemAnchor = controls.maxLevel
popupHeight = popupHeight + 23

for i, stat in ipairs(statWeights) do
controls["sortStatType"..tostring(i)] = new("LabelControl", {"TOPLEFT",lastItemAnchor,"BOTTOMLEFT"}, 0, i == 1 and 5 or 3, 70, 16, i < (#statWeights < 6 and 10 or 5) and s_format("^7%.2f: %s", stat.weightMult, stat.label) or ("+ "..tostring(#statWeights - 4).." Additional Stats"))
Expand Down Expand Up @@ -1082,6 +1102,9 @@ function TradeQueryGeneratorClass:RequestQuery(slot, context, statWeights, callb
if controls.includeCorrupted then
self.lastIncludeCorrupted, options.includeCorrupted = controls.includeCorrupted.state, controls.includeCorrupted.state
end
if controls.maxLevel.buf then
options.maxLevel = tonumber(controls.maxLevel.buf)
end
if controls.includeSynthesis then
self.lastIncludeSynthesis, options.includeSynthesis = controls.includeSynthesis.state, controls.includeSynthesis.state
end
Expand Down