Skip to content
Merged
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
11 changes: 7 additions & 4 deletions src/Classes/TreeTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -828,9 +828,6 @@ function TreeTabClass:FindTimelessJewel()
end
end
t_sort(jewelSockets, function(a, b) return a.label < b.label end)
for jewelSocketIdx, jewelSocket in pairs(jewelSockets) do
jewelSocket.idx = jewelSocketIdx
end
timelessData.jewelSocket = next(timelessData.jewelSocket) and timelessData.jewelSocket or jewelSockets[1]

local function buildMods()
Expand Down Expand Up @@ -1013,7 +1010,13 @@ function TreeTabClass:FindTimelessJewel()
timelessData.jewelSocket = value
self.build.modFlag = true
end, self.build, socketViewer)
controls.socketSelect.selIndex = timelessData.jewelSocket.idx
-- we need to search through `jewelSockets` for the correct `id` as the `idx` can become stale due to dynamic sorting
for idx, jewelSocket in ipairs(jewelSockets) do
if jewelSocket.id == timelessData.jewelSocket.id then
controls.socketSelect.selIndex = idx
break
end
end

controls.socketFilterLabel = new("LabelControl", { "TOPRIGHT", nil, "TOPLEFT" }, 405, 100, 0, 16, "^7Filter Nodes:")
controls.socketFilter = new("CheckBoxControl", { "LEFT", controls.socketFilterLabel, "RIGHT" }, 10, 0, 18, nil, function(value)
Expand Down
12 changes: 1 addition & 11 deletions src/Modules/Build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -793,19 +793,14 @@ function buildMode:Load(xml, fileName)
end
elseif child.elem == "TimelessData" then
self.timelessData.jewelType = {
label = child.attrib.jewelTypeLabel,
name = child.attrib.jewelTypeName,
id = tonumber(child.attrib.jewelTypeId)
}
self.timelessData.conquerorType = {
label = child.attrib.conquerorTypeLabel,
id = tonumber(child.attrib.conquerorTypeId)
}
self.timelessData.jewelSocket = {
label = child.attrib.jewelSocketLabel,
keystone = child.attrib.jewelSocketKeystone,
id = tonumber(child.attrib.jewelSocketId),
idx = tonumber(child.attrib.jewelSocketIdx)
id = tonumber(child.attrib.jewelSocketId)
}
self.timelessData.fallbackWeightMode = {
idx = tonumber(child.attrib.fallbackWeightModeIdx)
Expand Down Expand Up @@ -879,15 +874,10 @@ function buildMode:Save(xml)
local timelessData = {
elem = "TimelessData",
attrib = {
jewelTypeLabel = next(self.timelessData.jewelType) and tostring(self.timelessData.jewelType.label),
jewelTypeName = next(self.timelessData.jewelType) and tostring(self.timelessData.jewelType.name),
jewelTypeId = next(self.timelessData.jewelType) and tostring(self.timelessData.jewelType.id),
conquerorTypeLabel = next(self.timelessData.conquerorType) and tostring(self.timelessData.conquerorType.label),
conquerorTypeId = next(self.timelessData.conquerorType) and tostring(self.timelessData.conquerorType.id),
jewelSocketLabel = next(self.timelessData.conquerorType) and tostring(self.timelessData.jewelSocket.label),
jewelSocketKeystone = next(self.timelessData.jewelSocket) and tostring(self.timelessData.jewelSocket.keystone),
jewelSocketId = next(self.timelessData.jewelSocket) and tostring(self.timelessData.jewelSocket.id),
jewelSocketIdx = next(self.timelessData.jewelSocket) and tostring(self.timelessData.jewelSocket.idx),
fallbackWeightModeIdx = next(self.timelessData.fallbackWeightMode) and tostring(self.timelessData.fallbackWeightMode.idx),
socketFilter = self.timelessData.socketFilter and "true",
searchList = self.timelessData.searchList and tostring(self.timelessData.searchList),
Expand Down