mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: abilites
This commit is contained in:
1 parent
b25814e399
commit
e9d5de7e97
10 files changed
+101
-55
No files matched your search
@@ -499,18 +499,33 @@ export async function definitions(production: boolean) {
|
||||
const squadBattleTypeStyles = await readYAMLDVPL<SquadBattleTypeStyles>(
|
||||
`${DATA}/UI/Screens3/Lobby/Hangar/Squad/SquadBattleType.yaml.dvpl`,
|
||||
);
|
||||
const gameTypeSelectorStyles = await readYAMLDVPL<SquadBattleTypeStyles>(
|
||||
`${DATA}/UI/Screens/Lobby/Hangar/GameTypeSelector.yaml.dvpl`,
|
||||
);
|
||||
const gameModeNativeNames: Record<string, number> = {};
|
||||
|
||||
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,
|
||||
)) {
|
||||
const id = Number(match[1]);
|
||||
const name = strings[match[2]];
|
||||
|
||||
gameModeNativeNames[match[3]] = id;
|
||||
gameDefinitions.gameModes[id] = {
|
||||
name,
|
||||
};
|
||||
}
|
||||
|
||||
for (const match of gameTypeSelectorStyles.Prototypes[0].components.UIDataLocalBindingsComponent.data[1][2].matchAll(
|
||||
/eGameMode\.([a-zA-Z]+) -> "~res:\/Gfx\/UI\/Hangar\/GameTypes\/battle-type_([^"]+)"/g,
|
||||
)) {
|
||||
Object.entries(gameModeNativeNames).forEach(([key, value]) => {
|
||||
if (key.toLowerCase() === match[2].toLowerCase()) {
|
||||
gameModeNativeNames[match[1]] = value;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
camouflagesXmlEntries.forEach(([camoKey, camo]) => {
|
||||
const yamlEntry = camouflagesYaml[camoKey];
|
||||
const fullName = yamlEntry.userString
|
||||
@@ -706,7 +721,7 @@ export async function definitions(production: boolean) {
|
||||
|
||||
tankDefinitions[tankId] = {
|
||||
id: tankId,
|
||||
roles: tank.combatRole ?? {},
|
||||
roles: {},
|
||||
camouflages: camouflages.length === 0 ? undefined : camouflages,
|
||||
description:
|
||||
wargamingTankopedia.data[tankId]?.description ?? undefined,
|
||||
@@ -747,6 +762,22 @@ export async function definitions(production: boolean) {
|
||||
tracks: [],
|
||||
};
|
||||
|
||||
if (tank.combatRole) {
|
||||
Object.entries(tank.combatRole).forEach(([gameMode, role]) => {
|
||||
const id = Object.entries(gameModeNativeNames).find(
|
||||
([key]) => key.toLowerCase() === gameMode.toLowerCase(),
|
||||
)?.[1];
|
||||
|
||||
if (id === undefined) {
|
||||
throw new Error(
|
||||
`Unknown game mode in tank ${tankKey}: ${gameMode}`,
|
||||
);
|
||||
}
|
||||
|
||||
tankDefinitions[tankId].roles[id] = role;
|
||||
});
|
||||
}
|
||||
|
||||
if (tankDefinitions[tankId].name === tankDefinitions[tankId].nameFull) {
|
||||
delete tankDefinitions[tankId].nameFull;
|
||||
}
|
||||
@@ -1336,7 +1367,6 @@ export async function definitions(production: boolean) {
|
||||
};
|
||||
});
|
||||
|
||||
return;
|
||||
await commitAssets(
|
||||
'definitions',
|
||||
[
|
||||
|
||||
@@ -6,7 +6,9 @@ import { FileChange } from '../../src/core/blitzkit/commitMultipleFiles';
|
||||
import { DATA } from './constants';
|
||||
import { SquadBattleTypeStyles } from './definitions';
|
||||
|
||||
export async function gameModeIcons(production: boolean) {
|
||||
export async function gameModeBanners(production: boolean) {
|
||||
console.log('Building game mode banners...');
|
||||
|
||||
const changes: FileChange[] = [];
|
||||
const gameTypeSelectorStyles = await readYAMLDVPL<SquadBattleTypeStyles>(
|
||||
`${DATA}/UI/Screens/Lobby/Hangar/GameTypeSelector.yaml.dvpl`,
|
||||
@@ -48,5 +50,5 @@ export async function gameModeIcons(production: boolean) {
|
||||
});
|
||||
}
|
||||
|
||||
await commitAssets('game mode icons', changes, production);
|
||||
await commitAssets('game mode banners', changes, production);
|
||||
}
|
||||
@@ -17,7 +17,7 @@ import { consumableProvisionIcons } from './consumableProvisionIcons';
|
||||
import { currencies } from './currencies';
|
||||
import { definitions } from './definitions';
|
||||
import { equipmentIcons } from './equipmentIcons';
|
||||
import { gameModeIcons } from './gameModeIcons';
|
||||
import { gameModeBanners } from './gameModeBanners';
|
||||
import { moduleIcons } from './moduleIcons';
|
||||
import { scratchedFlags } from './scratchedFlags';
|
||||
import { shellIcons } from './shellIcons';
|
||||
@@ -30,7 +30,7 @@ import { videos } from './videos';
|
||||
if (!targets && !allTargets) throw new Error('No target(s) specified');
|
||||
|
||||
const methods = [
|
||||
gameModeIcons,
|
||||
gameModeBanners,
|
||||
definitions,
|
||||
tankIcons,
|
||||
videos,
|
||||
|
||||
Reference in new issue
Block a user