mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: start of game mode icons
This commit is contained in:
1 parent
6ada813dd5
commit
3e00860f7f
4 files changed
+43
-24
No files matched your search
@@ -400,6 +400,16 @@ interface AvailableNationsYaml {
|
|||||||
available_nations: string[];
|
available_nations: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface SquadBattleTypeUI {
|
||||||
|
Prototypes: {
|
||||||
|
components: {
|
||||||
|
UIDataLocalBindingsComponent: {
|
||||||
|
data: [string, string, 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,
|
||||||
@@ -486,33 +496,18 @@ export async function definitions(production: boolean) {
|
|||||||
`${DATA}/camouflages.yaml.dvpl`,
|
`${DATA}/camouflages.yaml.dvpl`,
|
||||||
);
|
);
|
||||||
const camouflagesXmlEntries = Object.entries(camouflagesXml.root.camouflages);
|
const camouflagesXmlEntries = Object.entries(camouflagesXml.root.camouflages);
|
||||||
|
const squadBattleTypeUI = await readYAMLDVPL<SquadBattleTypeUI>(
|
||||||
|
`${DATA}/UI/Screens3/Lobby/Hangar/Squad/SquadBattleType.yaml.dvpl`,
|
||||||
|
);
|
||||||
|
|
||||||
for (const match of (
|
for (const match of squadBattleTypeUI.Prototypes[0].components.UIDataLocalBindingsComponent.data[1][2].matchAll(
|
||||||
await readYAMLDVPL<{
|
/"(\d+)" -> "(battleType\/[a-zA-Z]+)"/g,
|
||||||
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 id = Number(match[1]);
|
||||||
const name = strings[`battleType/${id}`];
|
const name = strings[match[2]];
|
||||||
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] = {
|
gameDefinitions.gameModes[id] = {
|
||||||
name,
|
name,
|
||||||
description,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { readYAMLDVPL } from '../../src/core/blitz/readYAMLDVPL';
|
||||||
|
import { DATA } from './constants';
|
||||||
|
import { SquadBattleTypeUI } from './definitions';
|
||||||
|
|
||||||
|
// enum EGameMode {
|
||||||
|
// Rating = 7,
|
||||||
|
// Scuffle = 22,
|
||||||
|
// }
|
||||||
|
|
||||||
|
export async function gameModeIcons(production: boolean) {
|
||||||
|
const squadBattleTypeUI = await readYAMLDVPL<SquadBattleTypeUI>(
|
||||||
|
`${DATA}/UI/Screens3/Lobby/Hangar/Squad/SquadBattleType.yaml.dvpl`,
|
||||||
|
);
|
||||||
|
|
||||||
|
for (const match of squadBattleTypeUI.Prototypes[0].components.UIDataLocalBindingsComponent.data[0][2].matchAll(
|
||||||
|
/"(\d+)" -> "(battleType\/[a-zA-Z]+)"/g,
|
||||||
|
)) {
|
||||||
|
const id = Number(match[1]);
|
||||||
|
|
||||||
|
// gameDefinitions.gameModes[id] = {
|
||||||
|
// name,
|
||||||
|
// };
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -29,6 +29,7 @@ import { videos } from './videos';
|
|||||||
if (!targets && !allTargets) throw new Error('No target(s) specified');
|
if (!targets && !allTargets) throw new Error('No target(s) specified');
|
||||||
|
|
||||||
const methods = [
|
const methods = [
|
||||||
|
// gameModeIcons,
|
||||||
definitions,
|
definitions,
|
||||||
tankIcons,
|
tankIcons,
|
||||||
videos,
|
videos,
|
||||||
|
|||||||
@@ -3,13 +3,12 @@ import { fetchCdonLz4 } from './fetchCdonLz4';
|
|||||||
|
|
||||||
interface GameMode {
|
interface GameMode {
|
||||||
name: string;
|
name: string;
|
||||||
description: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GameDefinitions {
|
export interface GameDefinitions {
|
||||||
version: string;
|
version: string;
|
||||||
nations: string[];
|
nations: string[];
|
||||||
gameModes: Record<string, GameMode>;
|
gameModes: Record<number, GameMode>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const gameDefinitions = fetchCdonLz4<GameDefinitions>(
|
export const gameDefinitions = fetchCdonLz4<GameDefinitions>(
|
||||||
|
|||||||
Reference in new issue
Block a user