@@ -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 )
0 commit comments