feat: numerical role ids

This commit is contained in:
TrèsAbhi committed 2024-08-16 13:05:27 -05:00
1 parent 354be775ad
commit 4811668832
2 files changed
+16 -2

No files matched your search

+15 -1
View File
@@ -410,6 +410,14 @@ export interface SquadBattleTypeStyles {
}[]; }[];
} }
type CombatRolesYaml = Record<
string,
{
id: number;
default_abilities: string[];
}
>;
const blitzShellKindToBlitzkit: Record<ShellKind, ShellType> = { const blitzShellKindToBlitzkit: Record<ShellKind, ShellType> = {
ARMOR_PIERCING: ShellType.AP, ARMOR_PIERCING: ShellType.AP,
ARMOR_PIERCING_CR: ShellType.APCR, ARMOR_PIERCING_CR: ShellType.APCR,
@@ -503,6 +511,9 @@ export async function definitions(production: boolean) {
`${DATA}/UI/Screens/Lobby/Hangar/GameTypeSelector.yaml.dvpl`, `${DATA}/UI/Screens/Lobby/Hangar/GameTypeSelector.yaml.dvpl`,
); );
const gameModeNativeNames: Record<string, number> = {}; const gameModeNativeNames: Record<string, number> = {};
const combatRoles = await readYAMLDVPL<CombatRolesYaml>(
`${DATA}/XML/item_defs/vehicles/common/combat_roles.yaml.dvpl`,
);
for (const match of squadBattleTypeStyles.Prototypes[0].components.UIDataLocalBindingsComponent.data[1][2].matchAll( for (const match of squadBattleTypeStyles.Prototypes[0].components.UIDataLocalBindingsComponent.data[1][2].matchAll(
/"(\d+)" -> "(battleType\/([a-zA-Z]+))"/g, /"(\d+)" -> "(battleType\/([a-zA-Z]+))"/g,
@@ -774,7 +785,9 @@ export async function definitions(production: boolean) {
); );
} }
tankDefinitions[tankId].roles[id] = role; console.log(combatRoles[role].id);
tankDefinitions[tankId].roles[id] = combatRoles[role].id;
}); });
} }
@@ -1367,6 +1380,7 @@ export async function definitions(production: boolean) {
}; };
}); });
return;
await commitAssets( await commitAssets(
'definitions', 'definitions',
[ [
+1 -1
View File
@@ -40,7 +40,7 @@ export type ModuleDefinition =
| GunDefinition; | GunDefinition;
export interface TankDefinition { export interface TankDefinition {
id: number; id: number;
roles: Record<number, string>; roles: Record<number, number>;
description?: string; description?: string;
fixedCamouflage?: boolean; fixedCamouflage?: boolean;
camouflages?: number[]; camouflages?: number[];