From 5ac4a90b865f2487d44a0f7b7c29fe210be308a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0=20=D0=A2=D1=80=D0=BE?= =?UTF-8?q?=D1=8F=D0=BD=D0=BE=D0=B2?= <36129181+n1tr0xs@users.noreply.github.com> Date: Sat, 31 Aug 2024 05:07:55 +0300 Subject: [PATCH] Added ignore mirrored items checkbox to trade query options. (#8184) * added checkbox for mirrored items * added query generation for mirrored items --- src/Classes/TradeQueryGenerator.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Classes/TradeQueryGenerator.lua b/src/Classes/TradeQueryGenerator.lua index 91566f5bdb..46ef2995d7 100644 --- a/src/Classes/TradeQueryGenerator.lua +++ b/src/Classes/TradeQueryGenerator.lua @@ -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