@@ -109,7 +109,9 @@ local TradeQueryGeneratorClass = newClass("TradeQueryGenerator", function(self,
109109 self .queryTab = queryTab
110110 self .itemsTab = queryTab .itemsTab
111111 self .calcContext = { }
112-
112+ self .lastMaxPrice = nil
113+ self .lastMaxPriceTypeIndex = nil
114+ self .lastMaxLevel = nil
113115end )
114116
115117local function fetchStats ()
@@ -655,7 +657,37 @@ function TradeQueryGeneratorClass:OnFrame()
655657 end
656658end
657659
660+ local currencyTable = {
661+ { name = " Chaos Orb Equivalent" , id = nil },
662+ { name = " Chaos Orb" , id = " chaos" },
663+ { name = " Divine Orb" , id = " divine" },
664+ { name = " Orb of Alchemy" , id = " alch" },
665+ { name = " Orb of Alteration" , id = " alt" },
666+ { name = " Chromatic Orb" , id = " chrome" },
667+ { name = " Exalted Orb" , id = " exalted" },
668+ { name = " Blessed Orb" , id = " blessed" },
669+ { name = " Cartographer's Chisel" , id = " chisel" },
670+ { name = " Gemcutter's Prism" , id = " gcp" },
671+ { name = " Jeweller's Orb" , id = " jewellers" },
672+ { name = " Orb of Scouring" , id = " scour" },
673+ { name = " Orb of Regret" , id = " regret" },
674+ { name = " Orb of Fusing" , id = " fusing" },
675+ { name = " Orb of Chance" , id = " chance" },
676+ { name = " Regal Orb" , id = " regal" },
677+ { name = " Vaal Orb" , id = " vaal" }
678+ }
679+
658680function TradeQueryGeneratorClass :StartQuery (slot , options )
681+ if self .lastMaxPrice then
682+ options .maxPrice = self .lastMaxPrice
683+ end
684+ if self .lastMaxPriceTypeIndex then
685+ options .maxPriceType = currencyTable [self .lastMaxPriceTypeIndex ].id
686+ end
687+ if self .lastMaxLevel then
688+ options .maxLevel = self .lastMaxLevel
689+ end
690+
659691 -- Figure out what type of item we're searching for
660692 local existingItem = slot and self .itemsTab .items [slot .selItemId ]
661693 local testItemType = existingItem and existingItem .baseName or " Unset Amulet"
@@ -924,12 +956,12 @@ function TradeQueryGeneratorClass:FinishQuery()
924956 end
925957 end
926958 if not options .includeMirrored then
927- queryTable .query .filters .misc_filters = {
928- disabled = false ,
929- filters = {
930- mirrored = false ,
931- }
932- }
959+ queryTable .query .filters .misc_filters = {
960+ disabled = false ,
961+ filters = {
962+ mirrored = false ,
963+ }
964+ }
933965 end
934966
935967 if options .maxPrice and options .maxPrice > 0 then
@@ -1075,35 +1107,19 @@ function TradeQueryGeneratorClass:RequestQuery(slot, context, statWeights, callb
10751107 end
10761108
10771109 -- Add max price limit selection dropbox
1078- local currencyTable = {
1079- { name = " Chaos Orb Equivalent" , id = nil },
1080- { name = " Chaos Orb" , id = " chaos" },
1081- { name = " Divine Orb" , id = " divine" },
1082- { name = " Orb of Alchemy" , id = " alch" },
1083- { name = " Orb of Alteration" , id = " alt" },
1084- { name = " Chromatic Orb" , id = " chrome" },
1085- { name = " Exalted Orb" , id = " exalted" },
1086- { name = " Blessed Orb" , id = " blessed" },
1087- { name = " Cartographer's Chisel" , id = " chisel" },
1088- { name = " Gemcutter's Prism" , id = " gcp" },
1089- { name = " Jeweller's Orb" , id = " jewellers" },
1090- { name = " Orb of Scouring" , id = " scour" },
1091- { name = " Orb of Regret" , id = " regret" },
1092- { name = " Orb of Fusing" , id = " fusing" },
1093- { name = " Orb of Chance" , id = " chance" },
1094- { name = " Regal Orb" , id = " regal" },
1095- { name = " Vaal Orb" , id = " vaal" }
1096- }
10971110 local currencyDropdownNames = { }
10981111 for _ , currency in ipairs (currencyTable ) do
10991112 t_insert (currencyDropdownNames , currency .name )
11001113 end
11011114 controls .maxPrice = new (" EditControl" , {" TOPLEFT" ,lastItemAnchor ," BOTTOMLEFT" }, {0 , 5 , 70 , 18 }, nil , nil , " %D" )
1115+ controls .maxPrice .buf = self .lastMaxPrice and tostring (self .lastMaxPrice ) or " "
11021116 controls .maxPriceType = new (" DropDownControl" , {" LEFT" ,controls .maxPrice ," RIGHT" }, {5 , 0 , 150 , 18 }, currencyDropdownNames , nil )
1117+ controls .maxPriceType .selIndex = self .lastMaxPriceTypeIndex or 1
11031118 controls .maxPriceLabel = new (" LabelControl" , {" RIGHT" ,controls .maxPrice ," LEFT" }, {- 5 , 0 , 0 , 16 }, " ^7Max Price:" )
11041119 updateLastAnchor (controls .maxPrice )
11051120
11061121 controls .maxLevel = new (" EditControl" , {" TOPLEFT" ,lastItemAnchor ," BOTTOMLEFT" }, {0 , 5 , 100 , 18 }, nil , nil , " %D" )
1122+ controls .maxLevel .buf = self .lastMaxLevel and tostring (self .lastMaxLevel ) or " "
11071123 controls .maxLevelLabel = new (" LabelControl" , {" RIGHT" ,controls .maxLevel ," LEFT" }, {- 5 , 0 , 0 , 16 }, " Max Level:" )
11081124 updateLastAnchor (controls .maxLevel )
11091125
@@ -1180,10 +1196,13 @@ function TradeQueryGeneratorClass:RequestQuery(slot, context, statWeights, callb
11801196 end
11811197 if controls .maxPrice .buf then
11821198 options .maxPrice = tonumber (controls .maxPrice .buf )
1199+ self .lastMaxPrice = options .maxPrice
11831200 options .maxPriceType = currencyTable [controls .maxPriceType .selIndex ].id
1201+ self .lastMaxPriceTypeIndex = controls .maxPriceType .selIndex
11841202 end
11851203 if controls .maxLevel .buf then
11861204 options .maxLevel = tonumber (controls .maxLevel .buf )
1205+ self .lastMaxLevel = options .maxLevel
11871206 end
11881207 if controls .sockets and controls .sockets .buf then
11891208 options .sockets = tonumber (controls .sockets .buf )
0 commit comments