@@ -967,32 +967,65 @@ function TradeQueryGeneratorClass:RequestQuery(slot, context, statWeights, callb
967967
968968 local isJewelSlot = slot and slot .slotName :find (" Jewel" ) ~= nil
969969
970+ local lastItemAnchor
971+ local function updateLastAnchor (anchor , height )
972+ lastItemAnchor = anchor
973+ popupHeight = popupHeight + (height or 23 )
974+ end
975+
970976 controls .includeCorrupted = new (" CheckBoxControl" , {" TOP" ,nil ," TOP" }, {- 40 , 30 , 18 }, " Corrupted Mods:" , function (state ) end , " Includes corruption implicit modifiers in the weighted sum.\n Note that there is a maximum search filter count which means this might cause other weights to not be included." )
971977 controls .includeCorrupted .state = not context .slotTbl .alreadyCorrupted and (self .lastIncludeCorrupted == nil or self .lastIncludeCorrupted == true )
972978 controls .includeCorrupted .enabled = not context .slotTbl .alreadyCorrupted
979+ updateLastAnchor (controls .includeCorrupted )
973980
974- local canHaveRunes = slot and (slot .slotName :find (" Weapon 1" ) or slot .slotName :find (" Weapon 2" ) or slot .slotName :find (" Helmet" ) or slot .slotName :find (" Body Armour" ) or slot .slotName :find (" Gloves" ) or slot .slotName :find (" Boots" ))
975- controls .includeRunes = new (" CheckBoxControl" , {" TOPRIGHT" ,controls .includeCorrupted ," BOTTOMRIGHT" }, {0 , 5 , 18 }, " Rune Mods:" , function (state ) end )
976- controls .includeRunes .state = canHaveRunes and (self .lastIncludeRunes == nil or self .lastIncludeRunes == true )
977- controls .includeRunes .enabled = canHaveRunes
978981
979- local lastItemAnchor = controls . includeRunes
982+
980983
981- local function updateLastAnchor (anchor , height )
982- lastItemAnchor = anchor
983- popupHeight = popupHeight + (height or 23 )
984+ controls .includeMirrored = new (" CheckBoxControl" , {" TOPRIGHT" ,lastItemAnchor ," BOTTOMRIGHT" }, {0 , 5 , 18 }, " Mirrored Items:" , function (state ) end )
985+ controls .includeMirrored .state = (self .lastIncludeMirrored == nil or self .lastIncludeMirrored == true )
986+ updateLastAnchor (controls .includeMirrored )
987+
988+ -- there are also some exceptions like the darkness enthroned belt, but runes on these are not yet working pob
989+ local isAugmentableSlot = slot and (slot .slotName :find (" Weapon 1" ) or slot .slotName :find (" Weapon 2" ) or slot .slotName :find (" Helmet" ) or slot .slotName :find (" Body Armour" ) or slot .slotName :find (" Gloves" ) or slot .slotName :find (" Boots" ))
990+ if isAugmentableSlot then
991+ local augmentTooltip = [[ Controls how augments are used in the search.
992+
993+ Copy Current: augments in weights are skipped and augments are replaced with the current augments when possible.
994+ Usually the best opinion as this ensures the augments makes sense for your build.
995+
996+ Keep: augments will be included in weights and will not be changed on items.
997+ Best used when you value an augment greatly, and cannot add it yourself.
998+
999+ Remove: augments are completely ignored, and removed from items.]]
1000+ controls .augmentBehaviour = new (" DropDownControl" , {" TOPLEFT" , lastItemAnchor , " BOTTOMLEFT" }, {0 , 5 , 110 , 18 }, {" Copy Current" , " Keep" , " Remove" }, function (state ) end , augmentTooltip )
1001+ controls .augmentBehaviour :SetSel (self .lastAugmentBehaviourIdx or 1 )
1002+ controls .augmentBehaviourLabel = new (" LabelControl" , { " RIGHT" , controls .augmentBehaviour , " LEFT" },
1003+ { - 4 , 0 , 80 , 16 }, " Rune Behaviour:" )
1004+ updateLastAnchor (controls .augmentBehaviour )
1005+ end
1006+
1007+ local isAmulet = slot and (slot .slotName :find (" Amulet" ))
1008+ if isAmulet then
1009+ local augmentTooltip = [[ Controls how anoints are used in the search.
1010+
1011+ Copy Current: anoints are replaced with the current anoint when possible.
1012+ Usually the best opinion as this ensures the anoint makes sense for your build.
1013+
1014+ Keep: anoints will not be changed on items.
1015+ Best used when you cannot add one yourself. Note that weights cannot be generated for anoints.
1016+
1017+ Remove: anoints are completely ignored, and removed from items.]]
1018+ controls .anointBehaviour = new (" DropDownControl" , {" TOPLEFT" , lastItemAnchor , " BOTTOMLEFT" }, {0 , 5 , 110 , 18 }, {" Copy Current" , " Keep" , " Remove" }, function (state ) end , augmentTooltip )
1019+ controls .anointBehaviour :SetSel (self .lastAnointBehaviourIdx or 1 )
1020+ controls .anointBehaviourLabel = new (" LabelControl" , { " RIGHT" , controls .anointBehaviour , " LEFT" },
1021+ { - 4 , 0 , 80 , 16 }, " Anoint Behaviour:" )
1022+ updateLastAnchor (controls .anointBehaviour )
9841023 end
9851024
9861025 if context .slotTbl .unique then
9871026 options .special = { itemName = context .slotTbl .slotName }
9881027 end
9891028
990- controls .includeMirrored = new (" CheckBoxControl" , {" TOPRIGHT" ,lastItemAnchor ," BOTTOMRIGHT" }, {0 , 5 , 18 }, " Mirrored Items:" , function (state ) end )
991- controls .includeMirrored .state = (self .lastIncludeMirrored == nil or self .lastIncludeMirrored == true )
992- updateLastAnchor (controls .includeMirrored )
993-
994- -- TODO: aug copy
995-
9961029
9971030 if isJewelSlot then
9981031 controls .jewelType = new (" DropDownControl" , {" TOPLEFT" ,lastItemAnchor ," BOTTOMLEFT" }, {0 , 5 , 100 , 18 }, { " Any" , " Base" , " Radius" }, function (index , value ) end ) -- this does nothing atm
@@ -1054,17 +1087,25 @@ function TradeQueryGeneratorClass:RequestQuery(slot, context, statWeights, callb
10541087
10551088 self .tradeTypeIndex = context .controls .tradeTypeSelection .selIndex
10561089
1057- -- TODO: copy aug
1058- -- self.lastCopyEnchantMode = controls.copyEnchantMode and controls.copyEnchantMode:GetSelValue()
1059-
10601090 if controls .includeMirrored then
10611091 self .lastIncludeMirrored , options .includeMirrored = controls .includeMirrored .state , controls .includeMirrored .state
10621092 end
10631093 if controls .includeCorrupted then
10641094 self .lastIncludeCorrupted , options .includeCorrupted = controls .includeCorrupted .state , controls .includeCorrupted .state
10651095 end
1066- if controls .includeRunes then
1067- self .lastIncludeRunes , options .includeRunes = controls .includeRunes .state , controls .includeRunes .state
1096+ if controls .augmentBehaviour then
1097+ -- remember setting
1098+ self .lastAugmentBehaviourIdx = controls .augmentBehaviour .selIndex
1099+ -- used by TradeQuery to change augments accordingly
1100+ self .lastAugmentBehaviour = controls .augmentBehaviour :GetSelValue ()
1101+ -- whether weights should be generated
1102+ options .includeRunes = controls .augmentBehaviour :GetSelValue () == " Keep"
1103+ end
1104+ if controls .anointBehaviour then
1105+ -- remember setting
1106+ self .lastAnointBehaviourIdx = controls .anointBehaviour .selIndex
1107+ -- used by TradeQuery to change anoints accordingly
1108+ self .lastAnointBehaviour = controls .anointBehaviour :GetSelValue ()
10681109 end
10691110 if controls .jewelType then
10701111 self .lastJewelType = controls .jewelType .selIndex
0 commit comments