@@ -558,15 +558,15 @@ Highest Weight - Displays the order retrieved from trade]]
558558 end
559559
560560 row_count = row_count + 1
561- self .slotTables [row_count ] = { slotName = " Heart of the Well" , unique = true }
561+ self .slotTables [row_count ] = { slotName = " Heart of the Well" , unique = true , selectedJewelNodeId = activeSocketList [ 1 ] }
562562 self :PriceItemRowDisplay (row_count , top_pane_alignment_ref , row_vertical_padding , row_height )
563563 self .controls [" name" .. row_count ].y = self .controls [" name" .. row_count ].y + (row_height + row_vertical_padding )
564564 self .controls [" name" .. row_count ].shown = function ()
565565 return hideRowFunc (self , row_count )
566566 end
567567
568568 row_count = row_count + 1
569- self .slotTables [row_count ] = { slotName = " Against the Darkness" , unique = true }
569+ self .slotTables [row_count ] = { slotName = " Against the Darkness" , unique = true , selectedJewelNodeId = activeSocketList [ 1 ] }
570570 self :PriceItemRowDisplay (row_count , top_pane_alignment_ref , row_vertical_padding , row_height )
571571 self .controls [" name" .. row_count ].y = self .controls [" name" .. row_count ].y + (row_height + row_vertical_padding )
572572 self .controls [" name" .. row_count ].shown = function ()
@@ -794,7 +794,9 @@ function TradeQueryClass:GetResultEvaluation(row_idx, result_index, calcFunc, ba
794794 self .lastComparedWeightList [row_idx ][result_index ] = self .statSortSelectionList
795795 end
796796
797- local slotName = self .slotTables [row_idx ].nodeId and " Jewel " .. tostring (self .slotTables [row_idx ].nodeId ) or self .slotTables [row_idx ].slotName
797+ local slotTbl = self .slotTables [row_idx ]
798+ local jewelNodeId = slotTbl .nodeId or slotTbl .selectedJewelNodeId
799+ local slotName = jewelNodeId and " Jewel " .. tostring (jewelNodeId ) or slotTbl .slotName
798800 if slotName == " Megalomaniac" then
799801 local addedNodes = {}
800802 for nodeName in (result .item_string .. " \r\n " ):gmatch (" Allocates (.-)\r ?\n " ) do
@@ -1086,14 +1088,19 @@ you can add them, copy the link here, and press "Price Item" to evaluate the ite
10861088 local isAuthorized = main .api .authToken ~= nil
10871089 local validURL = controls [" uri" .. row_idx ].validURL
10881090 local isSearching = controls [" priceButton" .. row_idx ].label == " Searching..."
1089- return isAuthorized and validURL and not isSearching
1091+ local selectedJewelSlot = slotTbl .selectedJewelNodeId and self .itemsTab .sockets [slotTbl .selectedJewelNodeId ]
1092+ local hasRequiredJewelSlot = not slotTbl .unique or slotTbl .slotName == " Megalomaniac" or selectedJewelSlot and not selectedJewelSlot .inactive
1093+ return isAuthorized and validURL and not isSearching and hasRequiredJewelSlot
10901094 end
10911095 controls [" priceButton" .. row_idx ].tooltipFunc = function (tooltip )
10921096 tooltip :Clear ()
10931097 if not main .api .authToken then
10941098 tooltip :AddLine (16 , " You must log in to use the search feature" )
10951099 elseif not controls [" uri" .. row_idx ].validURL then
10961100 tooltip :AddLine (16 , " Enter a valid trade URL" )
1101+ elseif slotTbl .unique and slotTbl .slotName ~= " Megalomaniac"
1102+ and (not slotTbl .selectedJewelNodeId or not self .itemsTab .sockets [slotTbl .selectedJewelNodeId ] or self .itemsTab .sockets [slotTbl .selectedJewelNodeId ].inactive ) then
1103+ tooltip :AddLine (16 , " Requires an active Jewel Socket" )
10971104 end
10981105 end
10991106 local clampItemIndex = function (index )
@@ -1124,7 +1131,8 @@ you can add them, copy the link here, and press "Price Item" to evaluate the ite
11241131 end
11251132 local item = new (" Item" , result .item_string )
11261133 tooltip :Clear ()
1127- self .itemsTab :AddItemTooltip (tooltip , item , activeSlot )
1134+ local tooltipSlot = slotTbl .selectedJewelNodeId and self .itemsTab .sockets [slotTbl .selectedJewelNodeId ] or activeSlot
1135+ self .itemsTab :AddItemTooltip (tooltip , item , tooltipSlot )
11281136 tooltip :AddSeparator (10 )
11291137 tooltip :AddLine (16 , string.format (" ^7Price: %s %s" , result .amount , result .currency ))
11301138 end
@@ -1134,8 +1142,9 @@ you can add them, copy the link here, and press "Price Item" to evaluate the ite
11341142 -- pass "true" to not auto equip it as we will have our own logic
11351143 self .itemsTab :AddDisplayItem (true )
11361144 -- Autoequip it
1137- local slot = slotTbl .nodeId and self .itemsTab .sockets [slotTbl .nodeId ] or self .itemsTab .slots [slotTbl .slotName ]
1138- if slot and slotTbl .slotName == slot .label and slot :IsShown () and self .itemsTab :IsItemValidForSlot (item , slot .slotName ) then
1145+ local jewelNodeId = slotTbl .nodeId or slotTbl .selectedJewelNodeId
1146+ local slot = jewelNodeId and self .itemsTab .sockets [jewelNodeId ] or self .itemsTab .slots [slotTbl .slotName ]
1147+ if slot and (jewelNodeId or slotTbl .slotName == slot .label ) and slot :IsShown () and self .itemsTab :IsItemValidForSlot (item , slot .slotName ) then
11391148 slot :SetSelItemId (item .id )
11401149 self .itemsTab :PopulateSlots ()
11411150 self .itemsTab :AddUndoState ()
@@ -1151,7 +1160,8 @@ you can add them, copy the link here, and press "Price Item" to evaluate the ite
11511160 -- item.baseName is nil and throws error in the following AddItemTooltip func
11521161 -- if the item is unidentified
11531162 local item = new (" Item" , item_string )
1154- self .itemsTab :AddItemTooltip (tooltip , item , activeSlot , true )
1163+ local tooltipSlot = slotTbl .selectedJewelNodeId and self .itemsTab .sockets [slotTbl .selectedJewelNodeId ] or activeSlot
1164+ self .itemsTab :AddItemTooltip (tooltip , item , tooltipSlot , true )
11551165 end
11561166 end
11571167 controls [" importButton" .. row_idx ].enabled = function ()
0 commit comments