mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
(2) some definitions headers
This commit is contained in:
1 parent
17c54be1c8
commit
fd8448b0a6
8 files changed
+189
-151
No files matched your search
@@ -2,18 +2,24 @@ import {
|
|||||||
AbstractVFS,
|
AbstractVFS,
|
||||||
BlitzStrings,
|
BlitzStrings,
|
||||||
CamouflageDefinitions,
|
CamouflageDefinitions,
|
||||||
|
CamouflagesXml,
|
||||||
|
CamouflagesYaml,
|
||||||
|
CombatRolesYaml,
|
||||||
ConsumableDefinitions,
|
ConsumableDefinitions,
|
||||||
ConsumablesCommon,
|
ConsumablesCommon,
|
||||||
EquipmentDefinitions,
|
EquipmentDefinitions,
|
||||||
I18nString,
|
I18nString,
|
||||||
MapDefinitions,
|
MapDefinitions,
|
||||||
|
MapsYaml,
|
||||||
ModelDefinitions,
|
ModelDefinitions,
|
||||||
OptionalDevices,
|
OptionalDevices,
|
||||||
OptionalDeviceSlots,
|
OptionalDeviceSlots,
|
||||||
ProvisionDefinitions,
|
ProvisionDefinitions,
|
||||||
ProvisionsCommon,
|
ProvisionsCommon,
|
||||||
SkillDefinitions,
|
SkillDefinitions,
|
||||||
|
SquadBattleTypeStylesYaml,
|
||||||
TankDefinitions,
|
TankDefinitions,
|
||||||
|
TankmenAvatar,
|
||||||
} from "@blitzkit/core";
|
} from "@blitzkit/core";
|
||||||
import { SUPPORTED_LOCALE_BLITZ_MAP } from "@blitzkit/i18n";
|
import { SUPPORTED_LOCALE_BLITZ_MAP } from "@blitzkit/i18n";
|
||||||
import locales from "@blitzkit/i18n/locales.json";
|
import locales from "@blitzkit/i18n/locales.json";
|
||||||
@@ -29,8 +35,16 @@ export class ServerBlitzKitAPI extends BlitzKitAPI {
|
|||||||
consumablesCommon: ConsumablesCommon = {};
|
consumablesCommon: ConsumablesCommon = {};
|
||||||
provisionsCommon: ProvisionsCommon = {};
|
provisionsCommon: ProvisionsCommon = {};
|
||||||
|
|
||||||
|
// TODO: suffix with "yaml"s and "xml"s
|
||||||
private optionalDevices?: { root: OptionalDevices };
|
private optionalDevices?: { root: OptionalDevices };
|
||||||
private optionalDeviceSlots?: { root: OptionalDeviceSlots };
|
private optionalDeviceSlots?: { root: OptionalDeviceSlots };
|
||||||
|
private tankmenAvatar?: { root: TankmenAvatar };
|
||||||
|
private mapsYaml?: MapsYaml;
|
||||||
|
private camouflagesXml?: { root: CamouflagesXml };
|
||||||
|
private camouflagesYaml?: CamouflagesYaml;
|
||||||
|
private squadBattleTypeStyles?: SquadBattleTypeStylesYaml;
|
||||||
|
private gameTypeSelectorStyles?: SquadBattleTypeStylesYaml;
|
||||||
|
private combatRoles?: CombatRolesYaml;
|
||||||
|
|
||||||
constructor(vfs: AbstractVFS) {
|
constructor(vfs: AbstractVFS) {
|
||||||
super();
|
super();
|
||||||
@@ -38,6 +52,37 @@ export class ServerBlitzKitAPI extends BlitzKitAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async init() {
|
async init() {
|
||||||
|
this.nationsDir = await this.vfs
|
||||||
|
.dir("Data/XML/item_defs/vehicles")
|
||||||
|
.then((files) => files.filter((nation) => nation !== "common"));
|
||||||
|
|
||||||
|
this.optionalDevices = await this.vfs.xml<{ root: OptionalDevices }>(
|
||||||
|
"Data/XML/item_defs/vehicles/common/optional_devices.xml",
|
||||||
|
);
|
||||||
|
this.optionalDeviceSlots = await this.vfs.xml<{
|
||||||
|
root: OptionalDeviceSlots;
|
||||||
|
}>("Data/XML/item_defs/vehicles/common/optional_device_slots.xml");
|
||||||
|
this.tankmenAvatar = await this.vfs.xml<{ root: TankmenAvatar }>(
|
||||||
|
"Data/XML/item_defs/tankmen/avatar.xml",
|
||||||
|
);
|
||||||
|
this.mapsYaml = await this.vfs.yaml<MapsYaml>("Data/maps.yaml");
|
||||||
|
this.camouflagesXml = await this.vfs.xml<{ root: CamouflagesXml }>(
|
||||||
|
"Data/XML/item_defs/vehicles/common/camouflages.xml",
|
||||||
|
);
|
||||||
|
this.camouflagesYaml = await this.vfs.yaml<CamouflagesYaml>(
|
||||||
|
"Data/camouflages.yaml",
|
||||||
|
);
|
||||||
|
this.squadBattleTypeStyles = await this.vfs.yaml<SquadBattleTypeStylesYaml>(
|
||||||
|
`Data/UI/Screens3/Lobby/Hangar/Squad/SquadBattleType.yaml`,
|
||||||
|
);
|
||||||
|
this.gameTypeSelectorStyles =
|
||||||
|
await this.vfs.yaml<SquadBattleTypeStylesYaml>(
|
||||||
|
`Data/UI/Screens/Lobby/Hangar/GameTypeSelector.yaml`,
|
||||||
|
);
|
||||||
|
this.combatRoles = await this.vfs.yaml<CombatRolesYaml>(
|
||||||
|
`Data/XML/item_defs/vehicles/common/combat_roles.yaml`,
|
||||||
|
);
|
||||||
|
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
locales.supported.map(async ({ locale }) => {
|
locales.supported.map(async ({ locale }) => {
|
||||||
const blitzLocale = SUPPORTED_LOCALE_BLITZ_MAP[locale];
|
const blitzLocale = SUPPORTED_LOCALE_BLITZ_MAP[locale];
|
||||||
@@ -57,16 +102,39 @@ export class ServerBlitzKitAPI extends BlitzKitAPI {
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
this.nationsDir = await this.vfs
|
for (const match of (
|
||||||
.dir("Data/XML/item_defs/vehicles")
|
await this.vfs.text(
|
||||||
.then((files) => files.filter((nation) => nation !== "common"));
|
`Data/XML/item_defs/vehicles/common/consumables/list.xml`,
|
||||||
|
)
|
||||||
|
).matchAll(/<items path="(.+)\.xml"\/>/g)) {
|
||||||
|
if (match[1] === "prototypes") continue;
|
||||||
|
|
||||||
this.optionalDevices = await this.vfs.xml<{ root: OptionalDevices }>(
|
Object.assign(
|
||||||
"Data/XML/item_defs/vehicles/common/optional_devices.xml",
|
this.consumablesCommon,
|
||||||
|
(
|
||||||
|
await this.vfs.xml<{ root: ConsumablesCommon }>(
|
||||||
|
`Data/XML/item_defs/vehicles/common/consumables/${match[1]}.xml`,
|
||||||
|
)
|
||||||
|
).root,
|
||||||
);
|
);
|
||||||
this.optionalDeviceSlots = await this.vfs.xml<{
|
}
|
||||||
root: OptionalDeviceSlots;
|
|
||||||
}>(`Data/XML/item_defs/vehicles/common/optional_device_slots.xml`);
|
for (const match of (
|
||||||
|
await this.vfs.text(
|
||||||
|
`Data/XML/item_defs/vehicles/common/provisions/list.xml`,
|
||||||
|
)
|
||||||
|
).matchAll(/<items path="(.+)\.xml"\/>/g)) {
|
||||||
|
if (match[1] === "prototypes") continue;
|
||||||
|
|
||||||
|
Object.assign(
|
||||||
|
this.provisionsCommon,
|
||||||
|
(
|
||||||
|
await this.vfs.xml<{ root: ConsumablesCommon }>(
|
||||||
|
`Data/XML/item_defs/vehicles/common/provisions/${match[1]}.xml`,
|
||||||
|
)
|
||||||
|
).root,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private getString(name: string) {
|
private getString(name: string) {
|
||||||
@@ -92,33 +160,49 @@ export class ServerBlitzKitAPI extends BlitzKitAPI {
|
|||||||
|
|
||||||
async tankDefinitions() {
|
async tankDefinitions() {
|
||||||
const tankDefinitions = TankDefinitions.create();
|
const tankDefinitions = TankDefinitions.create();
|
||||||
|
|
||||||
|
return tankDefinitions;
|
||||||
}
|
}
|
||||||
|
|
||||||
async camouflageDefinitions() {
|
async camouflageDefinitions() {
|
||||||
const camouflageDefinitions = CamouflageDefinitions.create();
|
const camouflageDefinitions = CamouflageDefinitions.create();
|
||||||
|
|
||||||
|
return camouflageDefinitions;
|
||||||
}
|
}
|
||||||
|
|
||||||
async modelDefinitions() {
|
async modelDefinitions() {
|
||||||
const modelDefinitions = ModelDefinitions.create();
|
const modelDefinitions = ModelDefinitions.create();
|
||||||
|
|
||||||
|
return modelDefinitions;
|
||||||
}
|
}
|
||||||
|
|
||||||
async mapDefinitions() {
|
async mapDefinitions() {
|
||||||
const mapDefinitions = MapDefinitions.create();
|
const mapDefinitions = MapDefinitions.create();
|
||||||
|
|
||||||
|
return mapDefinitions;
|
||||||
}
|
}
|
||||||
|
|
||||||
async equipmentDefinitions() {
|
async equipmentDefinitions() {
|
||||||
const equipmentDefinitions = EquipmentDefinitions.create();
|
const equipmentDefinitions = EquipmentDefinitions.create();
|
||||||
|
|
||||||
|
return equipmentDefinitions;
|
||||||
}
|
}
|
||||||
|
|
||||||
async consumableDefinitions() {
|
async consumableDefinitions() {
|
||||||
const consumableDefinitions = ConsumableDefinitions.create();
|
const consumableDefinitions = ConsumableDefinitions.create();
|
||||||
|
|
||||||
|
return consumableDefinitions;
|
||||||
}
|
}
|
||||||
|
|
||||||
async provisionDefinitions() {
|
async provisionDefinitions() {
|
||||||
const provisionDefinitions = ProvisionDefinitions.create();
|
const provisionDefinitions = ProvisionDefinitions.create();
|
||||||
|
|
||||||
|
return provisionDefinitions;
|
||||||
}
|
}
|
||||||
|
|
||||||
async skillDefinitions() {
|
async skillDefinitions() {
|
||||||
const skillDefinitions = SkillDefinitions.create();
|
const skillDefinitions = SkillDefinitions.create();
|
||||||
|
|
||||||
|
return skillDefinitions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
export interface CamouflagesXml {
|
||||||
|
camouflages: Record<
|
||||||
|
string,
|
||||||
|
{
|
||||||
|
id: number;
|
||||||
|
userString: string;
|
||||||
|
description: string;
|
||||||
|
category: string;
|
||||||
|
group: string;
|
||||||
|
kind: string;
|
||||||
|
notInShop: boolean;
|
||||||
|
unlockCostCategory?: string;
|
||||||
|
vehicleFilter: {
|
||||||
|
include?: CamouflagesInclude | CamouflagesInclude[];
|
||||||
|
};
|
||||||
|
script: string[] | string;
|
||||||
|
icon?: string;
|
||||||
|
unlockPremium?: string;
|
||||||
|
unlockQuest?: string;
|
||||||
|
unlockClanLevel?: number;
|
||||||
|
unlockShopBundle?: string;
|
||||||
|
unlockTankRank?: number;
|
||||||
|
}
|
||||||
|
>;
|
||||||
|
}
|
||||||
|
|
||||||
|
type CamouflagesInclude =
|
||||||
|
| {
|
||||||
|
nations?: string;
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
vehicle?: { name?: string; minLevel?: number; maxLevel?: number };
|
||||||
|
};
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
export type CamouflagesYaml = Record<
|
||||||
|
string,
|
||||||
|
{
|
||||||
|
userString?: string;
|
||||||
|
shortUserString?: string;
|
||||||
|
}
|
||||||
|
>;
|
||||||
@@ -1,11 +1,15 @@
|
|||||||
export * from "./availableNationsYaml";
|
export * from "./availableNationsYaml";
|
||||||
export * from "./blitzStrings";
|
export * from "./blitzStrings";
|
||||||
|
export * from "./camouflagesXml";
|
||||||
|
export * from "./camouflagesYaml";
|
||||||
export * from "./combatRolesYaml";
|
export * from "./combatRolesYaml";
|
||||||
export * from "./consumablesCommon";
|
export * from "./consumablesCommon";
|
||||||
export * from "./consumablesVehicleFilter";
|
export * from "./consumablesVehicleFilter";
|
||||||
export * from "./glossary";
|
export * from "./glossary";
|
||||||
|
export * from "./mapsYaml";
|
||||||
export * from "./optionalDevices";
|
export * from "./optionalDevices";
|
||||||
export * from "./optionalDeviceSlots";
|
export * from "./optionalDeviceSlots";
|
||||||
export * from "./provisionsCommon";
|
export * from "./provisionsCommon";
|
||||||
export * from "./squadBattleTypeStylesYaml";
|
export * from "./squadBattleTypeStylesYaml";
|
||||||
|
export * from "./tankmenAvatar";
|
||||||
export * from "./tanksStats";
|
export * from "./tanksStats";
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
export interface MapsYaml {
|
||||||
|
maps: {
|
||||||
|
[key: string]: {
|
||||||
|
id: number;
|
||||||
|
tags?: string;
|
||||||
|
localName: string;
|
||||||
|
avaliableInTrainingRoom: boolean; // lol wg typo
|
||||||
|
spriteFrame: number;
|
||||||
|
supremacyPointsThreshold?: number;
|
||||||
|
availableModes: number[];
|
||||||
|
shadowMapsAvailable?: boolean;
|
||||||
|
assaultRespawnPoints: {
|
||||||
|
allies: MapAlly[];
|
||||||
|
enemies: MapAlly[];
|
||||||
|
};
|
||||||
|
levels?: number[];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MapAlly {
|
||||||
|
respawnNumber: number;
|
||||||
|
points: Array<number[]>;
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import { TankClass } from "@blitzkit/core";
|
||||||
|
|
||||||
|
export interface TankmenAvatar {
|
||||||
|
roles: unknown;
|
||||||
|
skillsByClasses: Record<TankClass, string>;
|
||||||
|
skills: {
|
||||||
|
[name: string]: {
|
||||||
|
userString: string;
|
||||||
|
effectDescription: string;
|
||||||
|
tipDescription: string;
|
||||||
|
icon: SkillIcon | SkillIcon[];
|
||||||
|
type: "continuous" | "trigger";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
interface SkillIcon {
|
||||||
|
name: string;
|
||||||
|
state: number;
|
||||||
|
}
|
||||||
@@ -21,7 +21,6 @@ import {
|
|||||||
ShellType,
|
ShellType,
|
||||||
SkillDefinitions,
|
SkillDefinitions,
|
||||||
sluggify,
|
sluggify,
|
||||||
SquadBattleTypeStylesYaml,
|
|
||||||
TankClass,
|
TankClass,
|
||||||
TankDefinitions,
|
TankDefinitions,
|
||||||
TankPrice,
|
TankPrice,
|
||||||
@@ -35,7 +34,6 @@ import { readFile } from "fs/promises";
|
|||||||
import { parse as parsePath } from "path";
|
import { parse as parsePath } from "path";
|
||||||
import type { Vector3Tuple } from "three";
|
import type { Vector3Tuple } from "three";
|
||||||
import { vfs } from "./constants";
|
import { vfs } from "./constants";
|
||||||
import type { Avatar } from "./skillIcons";
|
|
||||||
import type { TankParameters } from "./tankIcons";
|
import type { TankParameters } from "./tankIcons";
|
||||||
|
|
||||||
const nationSlugDiscriminators = {
|
const nationSlugDiscriminators = {
|
||||||
@@ -389,78 +387,11 @@ export interface ProvisionsCommon {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
type CamouflagesInclude =
|
|
||||||
| {
|
|
||||||
nations?: string;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
vehicle?: { name?: string; minLevel?: number; maxLevel?: number };
|
|
||||||
};
|
|
||||||
|
|
||||||
interface CamouflagesXML {
|
|
||||||
camouflages: Record<
|
|
||||||
string,
|
|
||||||
{
|
|
||||||
id: number;
|
|
||||||
userString: string;
|
|
||||||
description: string;
|
|
||||||
category: string;
|
|
||||||
group: string;
|
|
||||||
kind: string;
|
|
||||||
notInShop: boolean;
|
|
||||||
unlockCostCategory?: string;
|
|
||||||
vehicleFilter: {
|
|
||||||
include?: CamouflagesInclude | CamouflagesInclude[];
|
|
||||||
};
|
|
||||||
script: string[] | string;
|
|
||||||
icon?: string;
|
|
||||||
unlockPremium?: string;
|
|
||||||
unlockQuest?: string;
|
|
||||||
unlockClanLevel?: number;
|
|
||||||
unlockShopBundle?: string;
|
|
||||||
unlockTankRank?: number;
|
|
||||||
}
|
|
||||||
>;
|
|
||||||
}
|
|
||||||
|
|
||||||
type CamouflagesYaml = Record<
|
|
||||||
string,
|
|
||||||
{
|
|
||||||
userString?: string;
|
|
||||||
shortUserString?: string;
|
|
||||||
}
|
|
||||||
>;
|
|
||||||
|
|
||||||
type ConsumablesVehicleFilter =
|
type ConsumablesVehicleFilter =
|
||||||
| { minLevel: number; maxLevel: number }
|
| { minLevel: number; maxLevel: number }
|
||||||
| { name: string }
|
| { name: string }
|
||||||
| { extendedTags: string };
|
| { extendedTags: string };
|
||||||
|
|
||||||
export interface Maps {
|
|
||||||
maps: {
|
|
||||||
[key: string]: {
|
|
||||||
id: number;
|
|
||||||
tags?: string;
|
|
||||||
localName: string;
|
|
||||||
avaliableInTrainingRoom: boolean; // lol wg typo
|
|
||||||
spriteFrame: number;
|
|
||||||
supremacyPointsThreshold?: number;
|
|
||||||
availableModes: number[];
|
|
||||||
shadowMapsAvailable?: boolean;
|
|
||||||
assaultRespawnPoints: {
|
|
||||||
allies: MapAlly[];
|
|
||||||
enemies: MapAlly[];
|
|
||||||
};
|
|
||||||
levels?: number[];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MapAlly {
|
|
||||||
respawnNumber: number;
|
|
||||||
points: Array<number[]>;
|
|
||||||
}
|
|
||||||
|
|
||||||
type CombatRolesYaml = Record<
|
type CombatRolesYaml = Record<
|
||||||
string,
|
string,
|
||||||
{
|
{
|
||||||
@@ -502,59 +433,12 @@ function assignArmor(
|
|||||||
|
|
||||||
export async function definitions() {
|
export async function definitions() {
|
||||||
const tankStringIdMap: Record<string, number> = {};
|
const tankStringIdMap: Record<string, number> = {};
|
||||||
|
|
||||||
for (const match of (
|
|
||||||
await vfs.text(`Data/XML/item_defs/vehicles/common/consumables/list.xml`)
|
|
||||||
).matchAll(/<items path="(.+)\.xml"\/>/g)) {
|
|
||||||
if (match[1] === "prototypes") continue;
|
|
||||||
|
|
||||||
Object.assign(
|
|
||||||
consumablesCommon,
|
|
||||||
(
|
|
||||||
await vfs.xml<{ root: ConsumablesCommon }>(
|
|
||||||
`Data/XML/item_defs/vehicles/common/consumables/${match[1]}.xml`,
|
|
||||||
)
|
|
||||||
).root,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const match of (
|
|
||||||
await vfs.text(`Data/XML/item_defs/vehicles/common/provisions/list.xml`)
|
|
||||||
).matchAll(/<items path="(.+)\.xml"\/>/g)) {
|
|
||||||
if (match[1] === "prototypes") continue;
|
|
||||||
|
|
||||||
Object.assign(
|
|
||||||
provisionsCommon,
|
|
||||||
(
|
|
||||||
await vfs.xml<{ root: ConsumablesCommon }>(
|
|
||||||
`Data/XML/item_defs/vehicles/common/provisions/${match[1]}.xml`,
|
|
||||||
)
|
|
||||||
).root,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const avatar = await vfs.xml<{ root: Avatar }>(
|
|
||||||
`Data/XML/item_defs/tankmen/avatar.xml`,
|
|
||||||
);
|
|
||||||
const maps = await vfs.yaml<Maps>(`Data/maps.yaml`);
|
|
||||||
const tankXps = new Map<number, ResearchCost>();
|
const tankXps = new Map<number, ResearchCost>();
|
||||||
const camouflagesXml = await vfs.xml<{ root: CamouflagesXML }>(
|
|
||||||
`Data/XML/item_defs/vehicles/common/camouflages.xml`,
|
|
||||||
);
|
|
||||||
const camouflagesYaml = await vfs.yaml<CamouflagesYaml>(
|
|
||||||
`Data/camouflages.yaml`,
|
|
||||||
);
|
|
||||||
const camouflagesXmlEntries = Object.entries(camouflagesXml.root.camouflages);
|
const camouflagesXmlEntries = Object.entries(camouflagesXml.root.camouflages);
|
||||||
const squadBattleTypeStyles = await vfs.yaml<SquadBattleTypeStylesYaml>(
|
|
||||||
`Data/UI/Screens3/Lobby/Hangar/Squad/SquadBattleType.yaml`,
|
|
||||||
);
|
|
||||||
const gameTypeSelectorStyles = await vfs.yaml<SquadBattleTypeStylesYaml>(
|
|
||||||
`Data/UI/Screens/Lobby/Hangar/GameTypeSelector.yaml`,
|
|
||||||
);
|
|
||||||
const gameModeNativeNames: Record<string, number> = {};
|
const gameModeNativeNames: Record<string, number> = {};
|
||||||
const combatRoles = await vfs.yaml<CombatRolesYaml>(
|
|
||||||
`Data/XML/item_defs/vehicles/common/combat_roles.yaml`,
|
|
||||||
);
|
|
||||||
const consumableNativeNames: Record<string, number> = {};
|
const consumableNativeNames: Record<string, number> = {};
|
||||||
const provisionNativeNames: Record<string, number> = {};
|
const provisionNativeNames: Record<string, number> = {};
|
||||||
let equalizerDefinitions: string[][];
|
let equalizerDefinitions: string[][];
|
||||||
@@ -1635,15 +1519,17 @@ export async function definitions() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Object.entries(avatar.root.skillsByClasses).forEach(([tankClass, skills]) => {
|
Object.entries(tankmenAvatar.root.skillsByClasses).forEach(
|
||||||
|
([tankClass, skills]) => {
|
||||||
skillDefinitions.classes[
|
skillDefinitions.classes[
|
||||||
blitzTankClassToBlitzkit[tankClass as BlitzTankClass]
|
blitzTankClassToBlitzkit[tankClass as BlitzTankClass]
|
||||||
] = {
|
] = {
|
||||||
skills: skills.split(" "),
|
skills: skills.split(" "),
|
||||||
};
|
};
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
Object.entries(maps.maps).forEach(([key, map]) => {
|
Object.entries(mapsYaml.maps).forEach(([key, map]) => {
|
||||||
mapDefinitions.maps[map.id] = {
|
mapDefinitions.maps[map.id] = {
|
||||||
id: map.id,
|
id: map.id,
|
||||||
name: getString(`#maps:${key}:${map.localName}`),
|
name: getString(`#maps:${key}:${map.localName}`),
|
||||||
|
|||||||
@@ -1,31 +1,11 @@
|
|||||||
import { TankClass } from "@blitzkit/core";
|
|
||||||
import sharp from "sharp";
|
import sharp from "sharp";
|
||||||
import { AssetUploader } from "../core/github/assetUploader";
|
import { AssetUploader } from "../core/github/assetUploader";
|
||||||
import { vfs } from "./constants";
|
import { vfs } from "./constants";
|
||||||
|
|
||||||
interface SkillIcon {
|
|
||||||
name: string;
|
|
||||||
state: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Avatar {
|
|
||||||
roles: unknown;
|
|
||||||
skillsByClasses: Record<TankClass, string>;
|
|
||||||
skills: {
|
|
||||||
[name: string]: {
|
|
||||||
userString: string;
|
|
||||||
effectDescription: string;
|
|
||||||
tipDescription: string;
|
|
||||||
icon: SkillIcon | SkillIcon[];
|
|
||||||
type: "continuous" | "trigger";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function skillIcons() {
|
export async function skillIcons() {
|
||||||
console.log("Building skill icons...");
|
console.log("Building skill icons...");
|
||||||
|
|
||||||
const avatar = await vfs.xml<{ root: Avatar }>(
|
const avatar = await vfs.xml<{ root: TankmenAvatar }>(
|
||||||
`Data/XML/item_defs/tankmen/avatar.xml`,
|
`Data/XML/item_defs/tankmen/avatar.xml`,
|
||||||
);
|
);
|
||||||
const uploader = new AssetUploader("skill icons");
|
const uploader = new AssetUploader("skill icons");
|
||||||
|
|||||||
Reference in new issue
Block a user