mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
fix: deconstructor
This commit is contained in:
1 parent
c50f40a887
commit
dcc8207fb6
5 files changed
+22
-18
No files matched your search
@@ -5,10 +5,12 @@ import { vfs } from "./constants";
|
||||
export async function boosterIcons() {
|
||||
console.log("Building booster icons...");
|
||||
|
||||
using uploader = new AssetUploader("booster icons");
|
||||
const boosterFiles = (vfs.dir(`Data/Gfx/Shared/boosters`)).filter(
|
||||
(file) => !file.includes("@2x.txt") && !file.startsWith("texture0")
|
||||
);
|
||||
const uploader = new AssetUploader("booster icons");
|
||||
const boosterFiles = vfs
|
||||
.dir("Data/Gfx/Shared/boosters")
|
||||
.filter(
|
||||
(file) => !file.includes("@2x.txt") && !file.startsWith("texture0")
|
||||
);
|
||||
const image = sharp(
|
||||
await vfs.file(`Data/Gfx/Shared/boosters/texture0.packed.webp`)
|
||||
);
|
||||
|
||||
@@ -534,11 +534,11 @@ const blitzModuleTypeToBlitzkit: Record<keyof BlitzModuleType, ModuleType> = {
|
||||
export async function definitions() {
|
||||
console.log("Building definitions...");
|
||||
|
||||
using uploader = new AssetUploader("definitions");
|
||||
const uploader = new AssetUploader("definitions");
|
||||
const gameDefinitions: GameDefinitions = {
|
||||
version: (await vfs.text('Data/version.txt')).split(" ")[0],
|
||||
version: (await vfs.text("Data/version.txt")).split(" ")[0],
|
||||
nations: (
|
||||
await vfs.yaml<AvailableNationsYaml>('Data/available_nations.yaml')
|
||||
await vfs.yaml<AvailableNationsYaml>("Data/available_nations.yaml")
|
||||
).available_nations,
|
||||
gameModes: {},
|
||||
roles: {},
|
||||
@@ -561,10 +561,12 @@ export async function definitions() {
|
||||
[TankClass.TANK_DESTROYER]: { skills: [] },
|
||||
},
|
||||
};
|
||||
const nations = vfs.dir('Data/XML/item_defs/vehicles').filter((nation) => nation !== "common")
|
||||
const nations = vfs
|
||||
.dir("Data/XML/item_defs/vehicles")
|
||||
.filter((nation) => nation !== "common");
|
||||
const tankStringIdMap: Record<string, number> = {};
|
||||
const optionalDevices = await vfs.xml<{ root: OptionalDevices }>(
|
||||
'Data/XML/item_defs/vehicles/common/optional_devices.xml'
|
||||
"Data/XML/item_defs/vehicles/common/optional_devices.xml"
|
||||
);
|
||||
const stringsI18n: Record<string, Record<string, string>> = {};
|
||||
|
||||
@@ -617,9 +619,7 @@ export async function definitions() {
|
||||
const provisions: ProvisionsCommon = {};
|
||||
|
||||
for (const match of (
|
||||
await vfs.text(
|
||||
`Data/XML/item_defs/vehicles/common/consumables/list.xml`
|
||||
)
|
||||
await vfs.text(`Data/XML/item_defs/vehicles/common/consumables/list.xml`)
|
||||
).matchAll(/<items path="(.+)\.xml"\/>/g)) {
|
||||
if (match[1] === "prototypes") continue;
|
||||
|
||||
@@ -634,9 +634,7 @@ export async function definitions() {
|
||||
}
|
||||
|
||||
for (const match of (
|
||||
await vfs.text(
|
||||
`Data/XML/item_defs/vehicles/common/provisions/list.xml`
|
||||
)
|
||||
await vfs.text(`Data/XML/item_defs/vehicles/common/provisions/list.xml`)
|
||||
).matchAll(/<items path="(.+)\.xml"\/>/g)) {
|
||||
if (match[1] === "prototypes") continue;
|
||||
|
||||
@@ -1780,6 +1778,10 @@ export async function definitions() {
|
||||
};
|
||||
});
|
||||
|
||||
console.log(gameDefinitions);
|
||||
|
||||
console.log(GameDefinitions.encode(gameDefinitions).finish().length);
|
||||
|
||||
await uploader.add({
|
||||
content: GameDefinitions.encode(gameDefinitions).finish(),
|
||||
path: "definitions/game.pb",
|
||||
|
||||
@@ -28,7 +28,7 @@ export async function skillIcons() {
|
||||
const avatar = await vfs.xml<{ root: Avatar }>(
|
||||
`Data/XML/item_defs/tankmen/avatar.xml`
|
||||
);
|
||||
using uploader = new AssetUploader("skill icons");
|
||||
const uploader = new AssetUploader("skill icons");
|
||||
|
||||
for (const key in avatar.root.skills) {
|
||||
const skill = avatar.root.skills[key];
|
||||
|
||||
Reference in new issue
Block a user