mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 12:09:51 +02:00
fix: deconstructor
This commit is contained in:
1 parent
c50f40a887
commit
dcc8207fb6
5 files changed
+20
-16
No files matched your search
@@ -5,8 +5,10 @@ import { vfs } from "./constants";
|
|||||||
export async function boosterIcons() {
|
export async function boosterIcons() {
|
||||||
console.log("Building booster icons...");
|
console.log("Building booster icons...");
|
||||||
|
|
||||||
using uploader = new AssetUploader("booster icons");
|
const uploader = new AssetUploader("booster icons");
|
||||||
const boosterFiles = (vfs.dir(`Data/Gfx/Shared/boosters`)).filter(
|
const boosterFiles = vfs
|
||||||
|
.dir("Data/Gfx/Shared/boosters")
|
||||||
|
.filter(
|
||||||
(file) => !file.includes("@2x.txt") && !file.startsWith("texture0")
|
(file) => !file.includes("@2x.txt") && !file.startsWith("texture0")
|
||||||
);
|
);
|
||||||
const image = sharp(
|
const image = sharp(
|
||||||
|
|||||||
@@ -534,11 +534,11 @@ const blitzModuleTypeToBlitzkit: Record<keyof BlitzModuleType, ModuleType> = {
|
|||||||
export async function definitions() {
|
export async function definitions() {
|
||||||
console.log("Building definitions...");
|
console.log("Building definitions...");
|
||||||
|
|
||||||
using uploader = new AssetUploader("definitions");
|
const uploader = new AssetUploader("definitions");
|
||||||
const gameDefinitions: GameDefinitions = {
|
const gameDefinitions: GameDefinitions = {
|
||||||
version: (await vfs.text('Data/version.txt')).split(" ")[0],
|
version: (await vfs.text("Data/version.txt")).split(" ")[0],
|
||||||
nations: (
|
nations: (
|
||||||
await vfs.yaml<AvailableNationsYaml>('Data/available_nations.yaml')
|
await vfs.yaml<AvailableNationsYaml>("Data/available_nations.yaml")
|
||||||
).available_nations,
|
).available_nations,
|
||||||
gameModes: {},
|
gameModes: {},
|
||||||
roles: {},
|
roles: {},
|
||||||
@@ -561,10 +561,12 @@ export async function definitions() {
|
|||||||
[TankClass.TANK_DESTROYER]: { skills: [] },
|
[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 tankStringIdMap: Record<string, number> = {};
|
||||||
const optionalDevices = await vfs.xml<{ root: OptionalDevices }>(
|
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>> = {};
|
const stringsI18n: Record<string, Record<string, string>> = {};
|
||||||
|
|
||||||
@@ -617,9 +619,7 @@ export async function definitions() {
|
|||||||
const provisions: ProvisionsCommon = {};
|
const provisions: ProvisionsCommon = {};
|
||||||
|
|
||||||
for (const match of (
|
for (const match of (
|
||||||
await vfs.text(
|
await vfs.text(`Data/XML/item_defs/vehicles/common/consumables/list.xml`)
|
||||||
`Data/XML/item_defs/vehicles/common/consumables/list.xml`
|
|
||||||
)
|
|
||||||
).matchAll(/<items path="(.+)\.xml"\/>/g)) {
|
).matchAll(/<items path="(.+)\.xml"\/>/g)) {
|
||||||
if (match[1] === "prototypes") continue;
|
if (match[1] === "prototypes") continue;
|
||||||
|
|
||||||
@@ -634,9 +634,7 @@ export async function definitions() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const match of (
|
for (const match of (
|
||||||
await vfs.text(
|
await vfs.text(`Data/XML/item_defs/vehicles/common/provisions/list.xml`)
|
||||||
`Data/XML/item_defs/vehicles/common/provisions/list.xml`
|
|
||||||
)
|
|
||||||
).matchAll(/<items path="(.+)\.xml"\/>/g)) {
|
).matchAll(/<items path="(.+)\.xml"\/>/g)) {
|
||||||
if (match[1] === "prototypes") continue;
|
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({
|
await uploader.add({
|
||||||
content: GameDefinitions.encode(gameDefinitions).finish(),
|
content: GameDefinitions.encode(gameDefinitions).finish(),
|
||||||
path: "definitions/game.pb",
|
path: "definitions/game.pb",
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export async function skillIcons() {
|
|||||||
const avatar = await vfs.xml<{ root: Avatar }>(
|
const avatar = await vfs.xml<{ root: Avatar }>(
|
||||||
`Data/XML/item_defs/tankmen/avatar.xml`
|
`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) {
|
for (const key in avatar.root.skills) {
|
||||||
const skill = avatar.root.skills[key];
|
const skill = avatar.root.skills[key];
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export class AssetUploader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (diff.status === DiffStatus.Unchanged) {
|
if (diff.status === DiffStatus.Unchanged) {
|
||||||
// console.log(`🔵 ${change.path}`);
|
console.log(`🔵 ${change.path}`);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
`${diff.status === DiffStatus.New ? "🟢" : "🟡"} (${
|
`${diff.status === DiffStatus.New ? "🟢" : "🟡"} (${
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export abstract class AbstractVFS {
|
|||||||
const parentSegments = path.split("/").length;
|
const parentSegments = path.split("/").length;
|
||||||
const children: string[] = [];
|
const children: string[] = [];
|
||||||
|
|
||||||
for (const [child] of this.paths()) {
|
for (const child of this.paths()) {
|
||||||
const childSegments = child.split("/");
|
const childSegments = child.split("/");
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|||||||
Reference in new issue
Block a user