@@ -109,7 +109,9 @@ local TradeQueryGeneratorClass = newClass("TradeQueryGenerator", function(self,
109
109
self .queryTab = queryTab
110
110
self .itemsTab = queryTab .itemsTab
111
111
self .calcContext = { }
112
-
112
+ self .lastMaxPrice = nil
113
+ self .lastMaxPriceTypeIndex = nil
114
+ self .lastMaxLevel = nil
113
115
end )
114
116
115
117
local function fetchStats ()
@@ -655,7 +657,37 @@ function TradeQueryGeneratorClass:OnFrame()
655
657
end
656
658
end
657
659
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
+
658
680
function 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
+
659
691
-- Figure out what type of item we're searching for
660
692
local existingItem = slot and self .itemsTab .items [slot .selItemId ]
661
693
local testItemType = existingItem and existingItem .baseName or " Unset Amulet"
@@ -924,12 +956,12 @@ function TradeQueryGeneratorClass:FinishQuery()
924
956
end
925
957
end
926
958
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
+ }
933
965
end
934
966
935
967
if options .maxPrice and options .maxPrice > 0 then
@@ -1075,35 +1107,19 @@ function TradeQueryGeneratorClass:RequestQuery(slot, context, statWeights, callb
1075
1107
end
1076
1108
1077
1109
-- 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
- }
1097
1110
local currencyDropdownNames = { }
1098
1111
for _ , currency in ipairs (currencyTable ) do
1099
1112
t_insert (currencyDropdownNames , currency .name )
1100
1113
end
1101
1114
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 " "
1102
1116
controls .maxPriceType = new (" DropDownControl" , {" LEFT" ,controls .maxPrice ," RIGHT" }, {5 , 0 , 150 , 18 }, currencyDropdownNames , nil )
1117
+ controls .maxPriceType .selIndex = self .lastMaxPriceTypeIndex or 1
1103
1118
controls .maxPriceLabel = new (" LabelControl" , {" RIGHT" ,controls .maxPrice ," LEFT" }, {- 5 , 0 , 0 , 16 }, " ^7Max Price:" )
1104
1119
updateLastAnchor (controls .maxPrice )
1105
1120
1106
1121
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 " "
1107
1123
controls .maxLevelLabel = new (" LabelControl" , {" RIGHT" ,controls .maxLevel ," LEFT" }, {- 5 , 0 , 0 , 16 }, " Max Level:" )
1108
1124
updateLastAnchor (controls .maxLevel )
1109
1125
@@ -1180,10 +1196,13 @@ function TradeQueryGeneratorClass:RequestQuery(slot, context, statWeights, callb
1180
1196
end
1181
1197
if controls .maxPrice .buf then
1182
1198
options .maxPrice = tonumber (controls .maxPrice .buf )
1199
+ self .lastMaxPrice = options .maxPrice
1183
1200
options .maxPriceType = currencyTable [controls .maxPriceType .selIndex ].id
1201
+ self .lastMaxPriceTypeIndex = controls .maxPriceType .selIndex
1184
1202
end
1185
1203
if controls .maxLevel .buf then
1186
1204
options .maxLevel = tonumber (controls .maxLevel .buf )
1205
+ self .lastMaxLevel = options .maxLevel
1187
1206
end
1188
1207
if controls .sockets and controls .sockets .buf then
1189
1208
options .sockets = tonumber (controls .sockets .buf )
0 commit comments