@@ -596,24 +596,7 @@ function buildMode:Init(dbFileName, buildName, buildXML, convertBuild, importLin
596596 -- special rebuild to properly initialise boss placeholders
597597 self .configTab :BuildModList ()
598598
599- -- Initialise class dropdown
600- for classId , class in pairs (self .latestTree .classes ) do
601- local ascendancies = {}
602- -- Initialise ascendancy dropdown
603- for i = 0 , # class .classes do
604- local ascendClass = class .classes [i ]
605- t_insert (ascendancies , {
606- label = ascendClass .name ,
607- ascendClassId = i ,
608- })
609- end
610- t_insert (self .controls .classDrop .list , {
611- label = class .name ,
612- classId = classId ,
613- ascendancies = ascendancies ,
614- })
615- end
616- table.sort (self .controls .classDrop .list , function (a , b ) return a .label < b .label end )
599+ self :UpdateClassDropdowns ()
617600
618601 -- so we ran into problems with converted trees, trying to check passive tree routes and also consider thread jewels
619602 -- but we can't check jewel info because items have not been loaded yet, and they come after passives in the xml.
@@ -1195,6 +1178,29 @@ function buildMode:OnFrame(inputEvents)
11951178 self :DrawControls (main .viewPort )
11961179end
11971180
1181+ function buildMode :UpdateClassDropdowns (treeVersion )
1182+ local classes = main .tree [treeVersion or latestTreeVersion ].classes
1183+ wipeTable (self .controls .classDrop .list )
1184+ -- Initialise class dropdown
1185+ for classId , class in pairs (classes ) do
1186+ local ascendancies = {}
1187+ -- Initialise ascendancy dropdown
1188+ for i = 0 , # class .classes do
1189+ local ascendClass = class .classes [i ]
1190+ t_insert (ascendancies , {
1191+ label = ascendClass .name ,
1192+ ascendClassId = i ,
1193+ })
1194+ end
1195+ t_insert (self .controls .classDrop .list , {
1196+ label = class .name ,
1197+ classId = classId ,
1198+ ascendancies = ascendancies ,
1199+ })
1200+ end
1201+ table.sort (self .controls .classDrop .list , function (a , b ) return a .label < b .label end )
1202+ end
1203+
11981204-- Opens the game version conversion popup
11991205function buildMode :OpenConversionPopup ()
12001206 local controls = { }
0 commit comments