Skip to content

Commit

Permalink
Added ignore mirrored items checkbox to trade query options. (#8184)
Browse files Browse the repository at this point in the history
* added checkbox for mirrored items

* added query generation for mirrored items
  • Loading branch information
n1tr0xs committed Aug 31, 2024
1 parent a08b6a0 commit 5ac4a90
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Classes/TradeQueryGenerator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5ac4a90

Please sign in to comment.