Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions src/Classes/TimelessJewelListControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
13 changes: 13 additions & 0 deletions src/Classes/TreeTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading