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 ignore mirrored items checkbox to trade query options. #8184

Merged
merged 2 commits into from
Aug 31, 2024
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
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
Loading