Skip to content

Commit e87589f

Browse files
authored
Rebuild all timeless data on load (#4893)
* Rebuild all timeless data on load * Add keystone names to generated variants * Fix typo
1 parent 48208c6 commit e87589f

File tree

3 files changed

+48
-27
lines changed

3 files changed

+48
-27
lines changed

src/Classes/TimelessJewelListControl.lua

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ Timeless Jewel
6767
League: Legion
6868
Requires Level: 20
6969
Limited to: 1
70-
Variant: Cadiro
71-
Variant: Victario
72-
Variant: Caspiro
70+
Variant: Cadiro (Supreme Decadence)
71+
Variant: Victario (Supreme Grandstanding)
72+
Variant: Caspiro (Supreme Ostentation)
7373
Selected Variant: ]] .. variant .. [[
7474
Radius: Large
7575
Implicits: 0
@@ -86,9 +86,9 @@ Timeless Jewel
8686
League: Legion
8787
Requires Level: 20
8888
Limited to: 1
89-
Variant: Doryani
90-
Variant: Xibaqua
91-
Variant: Ahuana
89+
Variant: Doryani (Corrupted Soul)
90+
Variant: Xibaqua (Divine Flesh)
91+
Variant: Ahuana (Immortal Ambition)
9292
Selected Variant: ]] .. variant .. [[
9393
Radius: Large
9494
Implicits: 0
@@ -105,9 +105,9 @@ Timeless Jewel
105105
League: Legion
106106
Requires Level: 20
107107
Limited to: 1
108-
Variant: Kaom
109-
Variant: Rakiata
110-
Variant: Akoya
108+
Variant: Kaom (Strength of Blood)
109+
Variant: Rakiata (Tempered by War)
110+
Variant: Akoya (Chainbreaker)
111111
Selected Variant: ]] .. variant .. [[
112112
Radius: Large
113113
Implicits: 0
@@ -124,9 +124,9 @@ Timeless Jewel
124124
League: Legion
125125
Requires Level: 20
126126
Limited to: 1
127-
Variant: Asenath
128-
Variant: Nasima
129-
Variant: Balbala
127+
Variant: Asenath (Dance with Death)
128+
Variant: Nasima (Second Sight)
129+
Variant: Balbala (The Traitor)
130130
Selected Variant: ]] .. variant .. [[
131131
Radius: Large
132132
Implicits: 0
@@ -150,9 +150,9 @@ Requires Level: 20
150150
Limited to: 1
151151
Has Alt Variant: true
152152
Has Alt Variant Two: true
153-
Variant: Avarius
154-
Variant: Dominus
155-
Variant: Maxarius
153+
Variant: Avarius (Power of Purpose)
154+
Variant: Dominus (Inner Conviction)
155+
Variant: Maxarius (Transcendence)
156156
Variant: Totem Damage
157157
Variant: Brand Damage
158158
Variant: Channelling Damage

src/Classes/TreeTab.lua

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,17 @@ function TreeTabClass:FindTimelessJewel()
771771
{ label = "Militant Faith", name = "templar", id = 4 },
772772
{ label = "Elegant Hubris", name = "eternal", id = 5 }
773773
}
774-
timelessData.jewelType = next(timelessData.jewelType) and timelessData.jewelType or jewelTypes[1]
774+
-- rebuild `timelessData.jewelType` as we only store the minimum amount of `jewelType` data in build XML
775+
if next(timelessData.jewelType) then
776+
for idx, jewelType in ipairs(jewelTypes) do
777+
if jewelType.id == timelessData.jewelType.id then
778+
timelessData.jewelType = jewelType
779+
break
780+
end
781+
end
782+
else
783+
timelessData.jewelType = jewelTypes[1]
784+
end
775785
local conquerorTypes = {
776786
[1] = {
777787
{ label = "Doryani (Corrupted Soul)", id = 1 },
@@ -799,7 +809,17 @@ function TreeTabClass:FindTimelessJewel()
799809
{ label = "Caspiro (Supreme Ostentation)", id = 3 }
800810
}
801811
}
802-
timelessData.conquerorType = next(timelessData.conquerorType) and timelessData.conquerorType or conquerorTypes[timelessData.jewelType.id][1]
812+
-- rebuild `timelessData.conquerorType` as we only store the minimum amount of `conquerorType` data in build XML
813+
if next(timelessData.conquerorType) then
814+
for idx, conquerorType in ipairs(conquerorTypes[timelessData.jewelType.id]) do
815+
if conquerorType.id == timelessData.conquerorType.id then
816+
timelessData.conquerorType = conquerorType
817+
break
818+
end
819+
end
820+
else
821+
timelessData.conquerorType = conquerorTypes[timelessData.jewelType.id][1]
822+
end
803823
local jewelSockets = { }
804824
for socketId, socketData in pairs(self.build.spec.nodes) do
805825
if socketData.isJewelSocket then
@@ -828,7 +848,17 @@ function TreeTabClass:FindTimelessJewel()
828848
end
829849
end
830850
t_sort(jewelSockets, function(a, b) return a.label < b.label end)
831-
timelessData.jewelSocket = next(timelessData.jewelSocket) and timelessData.jewelSocket or jewelSockets[1]
851+
-- rebuild `timelessData.jewelSocket` as we only store the minimum amount of `jewelSocket` data in build XML
852+
if next(timelessData.jewelSocket) then
853+
for idx, jewelSocket in ipairs(jewelSockets) do
854+
if jewelSocket.id == timelessData.jewelSocket.id then
855+
timelessData.jewelSocket = jewelSocket
856+
break
857+
end
858+
end
859+
else
860+
timelessData.jewelSocket = jewelSockets[1]
861+
end
832862

833863
local function buildMods()
834864
wipeTable(modData)
@@ -1010,13 +1040,6 @@ function TreeTabClass:FindTimelessJewel()
10101040
timelessData.jewelSocket = value
10111041
self.build.modFlag = true
10121042
end, self.build, socketViewer)
1013-
-- we need to search through `jewelSockets` for the correct `id` as the `idx` can become stale due to dynamic sorting
1014-
for idx, jewelSocket in ipairs(jewelSockets) do
1015-
if jewelSocket.id == timelessData.jewelSocket.id then
1016-
controls.socketSelect.selIndex = idx
1017-
break
1018-
end
1019-
end
10201043

10211044
controls.socketFilterLabel = new("LabelControl", { "TOPRIGHT", nil, "TOPLEFT" }, 405, 100, 0, 16, "^7Filter Nodes:")
10221045
controls.socketFilter = new("CheckBoxControl", { "LEFT", controls.socketFilterLabel, "RIGHT" }, 10, 0, 18, nil, function(value)

src/Modules/Build.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,6 @@ function buildMode:Load(xml, fileName)
793793
end
794794
elseif child.elem == "TimelessData" then
795795
self.timelessData.jewelType = {
796-
name = child.attrib.jewelTypeName,
797796
id = tonumber(child.attrib.jewelTypeId)
798797
}
799798
self.timelessData.conquerorType = {
@@ -874,7 +873,6 @@ function buildMode:Save(xml)
874873
local timelessData = {
875874
elem = "TimelessData",
876875
attrib = {
877-
jewelTypeName = next(self.timelessData.jewelType) and tostring(self.timelessData.jewelType.name),
878876
jewelTypeId = next(self.timelessData.jewelType) and tostring(self.timelessData.jewelType.id),
879877
conquerorTypeId = next(self.timelessData.conquerorType) and tostring(self.timelessData.conquerorType.id),
880878
jewelSocketId = next(self.timelessData.jewelSocket) and tostring(self.timelessData.jewelSocket.id),

0 commit comments

Comments
 (0)