@@ -61,7 +61,7 @@ internal record TypeMapping(Type type, bool shouldCreateCache = true);
6161 {
6262 if ( duringEnumCacheCreation )
6363 {
64- Registry . customTribes . Add ( ( TribeType ) Registry . autoidx ) ;
64+ Registry . customTribes . Add ( ( TribeType ) ( int ) token [ "idx" ] ) ;
6565 token [ "style" ] = Registry . climateAutoidx ;
6666 token [ "climate" ] = Registry . climateAutoidx ;
6767 Registry . climateAutoidx ++ ;
@@ -183,18 +183,21 @@ out TribeAbility.Type tribeAbilityType
183183 }
184184 else
185185 {
186+ string improvementId = Util . GetJTokenName ( token ) ;
186187 if ( token [ "attractsResource" ] != null )
187188 {
188- string improvementId = Util . GetJTokenName ( token ) ;
189189 string attractsId = token [ "attractsResource" ] . ToString ( ) ;
190190 Main . attractsResourceNames [ improvementId ] = attractsId ;
191191 }
192192 if ( token [ "attractsToTerrain" ] != null )
193193 {
194- string improvementId = Util . GetJTokenName ( token ) ;
195194 string attractsId = token [ "attractsToTerrain" ] . ToString ( ) ;
196195 Main . attractsTerrainNames [ improvementId ] = attractsId ;
197196 }
197+ if ( token [ "infoOverride" ] != null )
198+ {
199+ Loc . buildingsInfoOverrides [ improvementId ] = Loc . ReplaceDashesWithDots ( token [ "infoOverride" ] . ToString ( ) ) ;
200+ }
198201 }
199202 } )
200203 } ,
@@ -912,6 +915,7 @@ internal static void ProcessGameLogicData(GameLogicData gameLogicData, JObject r
912915 try
913916 {
914917 CreateMappings ( rootObject ) ;
918+ ProcessCustomTribes ( ) ;
915919 ProcessPrefabs ( ) ;
916920 ProcessEmbarkOverrides ( ) ;
917921 ProcessAttractOverrides ( ) ;
@@ -922,6 +926,17 @@ internal static void ProcessGameLogicData(GameLogicData gameLogicData, JObject r
922926 }
923927 }
924928
929+ internal static void ProcessCustomTribes ( )
930+ {
931+ foreach ( var tribe in Registry . customTribes )
932+ {
933+ if ( ! GameLogicData . legacyTribeTypesOrder . Contains ( tribe ) )
934+ {
935+ GameLogicData . legacyTribeTypesOrder . Add ( tribe ) ;
936+ }
937+ }
938+ }
939+
925940 /// <summary>
926941 /// Creates EnumCache mappings for custom enum values and invokes type handlers.
927942 /// </summary>
0 commit comments