mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
feat: gamemode defs
This commit is contained in:
1 parent
643c7272ca
commit
6ada813dd5
3 files changed
+37
-1
No files matched your search
@@ -419,6 +419,7 @@ export async function definitions(production: boolean) {
|
||||
).then((response) => response.json())) as {
|
||||
data: { [key: number]: { description: null | string } };
|
||||
};
|
||||
|
||||
const gameDefinitions: GameDefinitions = {
|
||||
version: (await readStringDVPL(`${DATA}/version.txt.dvpl`))
|
||||
.split(' ')[0]
|
||||
@@ -430,6 +431,7 @@ export async function definitions(production: boolean) {
|
||||
`${DATA}/available_nations.yaml.dvpl`,
|
||||
)
|
||||
).available_nations,
|
||||
gameModes: {},
|
||||
};
|
||||
const tankDefinitions: TankDefinitions = {};
|
||||
const camouflageDefinitions: CamouflageDefinitions = {};
|
||||
@@ -485,6 +487,35 @@ export async function definitions(production: boolean) {
|
||||
);
|
||||
const camouflagesXmlEntries = Object.entries(camouflagesXml.root.camouflages);
|
||||
|
||||
for (const match of (
|
||||
await readYAMLDVPL<{
|
||||
Prototypes: {
|
||||
components: {
|
||||
UIDataLocalBindingsComponent: {
|
||||
data: string[][];
|
||||
};
|
||||
};
|
||||
}[];
|
||||
}>(`${DATA}/UI/Screens3/Lobby/Hangar/Squad/SquadBattleType.yaml.dvpl`)
|
||||
).Prototypes[0].components.UIDataLocalBindingsComponent.data[1][2].matchAll(
|
||||
/battleType\/([a-zA-Z]+)/g,
|
||||
)) {
|
||||
const id = match[1];
|
||||
const name = strings[`battleType/${id}`];
|
||||
const description = (
|
||||
strings[`hangar/battleType/${id}ShortDescription`] ??
|
||||
strings[
|
||||
`hangar/battleType/${id.slice(0, 1).toUpperCase() + id.slice(1)}ShortDescription`
|
||||
] ??
|
||||
strings[`hangar/battleType/${id}Description`]
|
||||
).split('\n')[0];
|
||||
|
||||
gameDefinitions.gameModes[id] = {
|
||||
name,
|
||||
description,
|
||||
};
|
||||
}
|
||||
|
||||
camouflagesXmlEntries.forEach(([camoKey, camo]) => {
|
||||
const yamlEntry = camouflagesYaml[camoKey];
|
||||
const fullName = yamlEntry.userString
|
||||
|
||||
Reference in new issue
Block a user