Added ignore mirrored items checkbox to trade query options. (#8184)

* added checkbox for mirrored items

* added query generation for mirrored items
This commit is contained in:
Никита Троянов
2024-08-31 05:07:55 +03:00
committed by GitHub
parent a08b6a05b0
commit 5ac4a90b86

View File

@@ -924,6 +924,14 @@ function TradeQueryGeneratorClass:FinishQuery()
break
end
end
if not options.includeMirrored then
queryTable.query.filters.misc_filters = {
disabled = false,
filters = {
mirrored = false,
}
}
end
if options.maxPrice and options.maxPrice > 0 then
queryTable.query.filters.trade_filters = {
@@ -1027,6 +1035,10 @@ function TradeQueryGeneratorClass:RequestQuery(slot, context, statWeights, callb
options.special = { itemName = context.slotTbl.slotName }
end
controls.includeMirrored = new("CheckBoxControl", {"TOPRIGHT",lastItemAnchor,"BOTTOMRIGHT"}, 0, 5, 18, "Mirrored items:", function(state) end)
controls.includeMirrored.state = (self.lastIncludeMirrored == nil or self.lastIncludeMirrored == true)
updateLastAnchor(controls.includeMirrored)
if not isJewelSlot and not isAbyssalJewelSlot and includeScourge then
controls.includeScourge = new("CheckBoxControl", {"TOPRIGHT",lastItemAnchor,"BOTTOMRIGHT"}, 0, 5, 18, "Scourge Mods:", function(state) end)
controls.includeScourge.state = (self.lastIncludeScourge == nil or self.lastIncludeScourge == true)
@@ -1138,6 +1150,9 @@ function TradeQueryGeneratorClass:RequestQuery(slot, context, statWeights, callb
controls.generateQuery = new("ButtonControl", { "BOTTOM", nil, "BOTTOM" }, -45, -10, 80, 20, "Execute", function()
main:ClosePopup()
if controls.includeMirrored then
self.lastIncludeMirrored, options.includeMirrored = controls.includeMirrored.state, controls.includeMirrored.state
end
if controls.includeCorrupted then
self.lastIncludeCorrupted, options.includeCorrupted = controls.includeCorrupted.state, controls.includeCorrupted.state
end