diff --git a/src/Classes/TimelessJewelListControl.lua b/src/Classes/TimelessJewelListControl.lua index fb985769b5..9b005d721c 100644 --- a/src/Classes/TimelessJewelListControl.lua +++ b/src/Classes/TimelessJewelListControl.lua @@ -73,6 +73,14 @@ function TimelessJewelListControlClass:AddValueTooltip(tooltip, index, data) if not self.noTooltip then if self.list[index].label:match("B2B2B2") == nil then tooltip:AddLine(16, "^7Double click to add this jewel to your build.") + if self.build.timelessData.socketAllocate then + local socketId = data.socketId or (self.sharedList.socket and self.sharedList.socket.id) + if socketId and self.build.spec.allocNodes[socketId] and self.build.itemsTab.sockets[socketId] then + tooltip:AddLine(16, "^7It will be socketed into " .. (data.socketLabel or (self.sharedList.socket and self.sharedList.socket.label) or socketId) .. ".") + else + tooltip:AddLine(16, colorCodes.WARNING .. "That jewel socket is not allocated, so the jewel will only be added to your items.") + end + end else tooltip:AddLine(16, "^7" .. self.sharedList.type.label .. " " .. data.seed .. " was successfully added to your build.") end @@ -309,8 +317,18 @@ Historic ]] end local item = new("Item"):Item(itemData) - self.build.itemsTab:AddItem(item, true) - self.build.itemsTab:PopulateSlots() + local itemsTab = self.build.itemsTab + itemsTab:AddItem(item, true) + if self.build.timelessData.socketAllocate then + local socketId = data.socketId or (self.sharedList.socket and self.sharedList.socket.id) + local socketControl = socketId and itemsTab.sockets[socketId] + if socketControl and self.build.spec.allocNodes[socketId] and itemsTab:IsItemValidForSlot(item, socketControl.slotName) then + socketControl:SetSelItemId(item.id) + itemsTab:AddUndoState() + self.build.buildFlag = true + end + end + itemsTab:PopulateSlots() self.list[index].label = "^xB2B2B2" .. self.list[index].label end end diff --git a/src/Classes/TreeTab.lua b/src/Classes/TreeTab.lua index c9cb48c211..7f9e38ce6a 100644 --- a/src/Classes/TreeTab.lua +++ b/src/Classes/TreeTab.lua @@ -1639,6 +1639,19 @@ function TreeTabClass:FindTimelessJewel() end controls.socketFilter.state = timelessData.socketFilter + -- sits on the same row as the socket filter, right of the node distance slider it can show + controls.socketAllocate = new("CheckBoxControl"):CheckBoxControl({"LEFT", controls.socketFilter, "RIGHT"}, {165, 0, rowHeight}, nil, function(value) + timelessData.socketAllocate = value + end) + controls.socketAllocateLabel = new("LabelControl"):LabelControl({"RIGHT", controls.socketAllocate, "LEFT"}, {-labelSpacing, 0, 0, labelHeight}, "^7Socket Jewel:") + controls.socketAllocate.tooltipFunc = function(tooltip, mode, index, value) + tooltip:Clear() + tooltip:AddLine(16, "^7Double clicking a result also equips the jewel in its jewel socket.") + tooltip:AddLine(16, "^7The socket must be allocated on your current tree; if it isn't, the jewel is only added to your item list.") + tooltip:AddLine(16, "^7A jewel already in that socket is replaced.") + end + controls.socketAllocate.state = timelessData.socketAllocate + -- Protect notables that must not be replaced by Militant Faith or Reclaimed Malevolence. controls.protectAllocatedLabel = new("LabelControl"):LabelControl({ "TOPLEFT", nil, "TOPLEFT" }, { 15,