From 1fce9c1c888ae4cf3d82a1d208e62374fcf34461 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Wed, 5 Mar 2025 10:03:03 -0600 Subject: [PATCH] fix: include all tanks --- .../src/protos/legacy_game_definitions.ts | 479 +++++++++++------- packages/core/src/protos/legacy_i18n.ts | 113 +++-- .../src/pages/[...locale]/tanks/index.astro | 2 +- src/BlitzKit.CLI/Functions/Mangler.cs | 26 +- 4 files changed, 376 insertions(+), 244 deletions(-) diff --git a/packages/core/src/protos/legacy_game_definitions.ts b/packages/core/src/protos/legacy_game_definitions.ts index 17b87dea1..2dfd0287c 100644 --- a/packages/core/src/protos/legacy_game_definitions.ts +++ b/packages/core/src/protos/legacy_game_definitions.ts @@ -5,10 +5,10 @@ // source: packages/core/src/protos/legacy_game_definitions.proto /* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; -import { I18nString } from "./legacy_i18n"; +import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire'; +import { I18nString, createBaseI18nString } from './legacy_i18n'; -export const protobufPackage = "blitzkit"; +export const protobufPackage = 'blitzkit'; export interface GameDefinitions { version: string; @@ -37,28 +37,38 @@ export interface GameModeRole { } function createBaseGameDefinitions(): GameDefinitions { - return { version: "", nations: [], gameModes: {}, roles: {} }; + return { version: '', nations: [], gameModes: {}, roles: {} }; } export const GameDefinitions: MessageFns = { - encode(message: GameDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.version !== "") { + encode( + message: GameDefinitions, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { + if (message.version !== '') { writer.uint32(10).string(message.version); } for (const v of message.nations) { writer.uint32(18).string(v!); } Object.entries(message.gameModes).forEach(([key, value]) => { - GameDefinitions_GameModesEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join(); + GameDefinitions_GameModesEntry.encode( + { key: key as any, value }, + writer.uint32(26).fork(), + ).join(); }); Object.entries(message.roles).forEach(([key, value]) => { - GameDefinitions_RolesEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join(); + GameDefinitions_RolesEntry.encode( + { key: key as any, value }, + writer.uint32(34).fork(), + ).join(); }); return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGameDefinitions(); while (reader.pos < end) { @@ -85,7 +95,10 @@ export const GameDefinitions: MessageFns = { break; } - const entry3 = GameDefinitions_GameModesEntry.decode(reader, reader.uint32()); + const entry3 = GameDefinitions_GameModesEntry.decode( + reader, + reader.uint32(), + ); if (entry3.value !== undefined) { message.gameModes[entry3.key] = entry3.value; } @@ -96,7 +109,10 @@ export const GameDefinitions: MessageFns = { break; } - const entry4 = GameDefinitions_RolesEntry.decode(reader, reader.uint32()); + const entry4 = GameDefinitions_RolesEntry.decode( + reader, + reader.uint32(), + ); if (entry4.value !== undefined) { message.roles[entry4.key] = entry4.value; } @@ -113,26 +129,36 @@ export const GameDefinitions: MessageFns = { fromJSON(object: any): GameDefinitions { return { - version: globalThis.String(assertSet("GameDefinitions.version", object.version)), - nations: globalThis.Array.isArray(object?.nations) ? object.nations.map((e: any) => globalThis.String(e)) : [], + version: globalThis.String( + assertSet('GameDefinitions.version', object.version), + ), + nations: globalThis.Array.isArray(object?.nations) + ? object.nations.map((e: any) => globalThis.String(e)) + : [], gameModes: isObject(object.gameModes) - ? Object.entries(object.gameModes).reduce<{ [key: number]: GameMode }>((acc, [key, value]) => { - acc[globalThis.Number(key)] = GameMode.fromJSON(value); - return acc; - }, {}) + ? Object.entries(object.gameModes).reduce<{ [key: number]: GameMode }>( + (acc, [key, value]) => { + acc[globalThis.Number(key)] = GameMode.fromJSON(value); + return acc; + }, + {}, + ) : {}, roles: isObject(object.roles) - ? Object.entries(object.roles).reduce<{ [key: number]: GameModeRole }>((acc, [key, value]) => { - acc[globalThis.Number(key)] = GameModeRole.fromJSON(value); - return acc; - }, {}) + ? Object.entries(object.roles).reduce<{ [key: number]: GameModeRole }>( + (acc, [key, value]) => { + acc[globalThis.Number(key)] = GameModeRole.fromJSON(value); + return acc; + }, + {}, + ) : {}, }; }, toJSON(message: GameDefinitions): unknown { const obj: any = {}; - if (message.version !== "") { + if (message.version !== '') { obj.version = message.version; } if (message.nations?.length) { @@ -159,23 +185,28 @@ export const GameDefinitions: MessageFns = { return obj; }, - create, I>>(base?: I): GameDefinitions { + create, I>>( + base?: I, + ): GameDefinitions { return GameDefinitions.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>(object: I): GameDefinitions { + fromPartial, I>>( + object: I, + ): GameDefinitions { const message = createBaseGameDefinitions(); - message.version = object.version ?? ""; + message.version = object.version ?? ''; message.nations = object.nations?.map((e) => e) || []; - message.gameModes = Object.entries(object.gameModes ?? {}).reduce<{ [key: number]: GameMode }>( - (acc, [key, value]) => { - if (value !== undefined) { - acc[globalThis.Number(key)] = GameMode.fromPartial(value); - } - return acc; - }, - {}, - ); - message.roles = Object.entries(object.roles ?? {}).reduce<{ [key: number]: GameModeRole }>((acc, [key, value]) => { + message.gameModes = Object.entries(object.gameModes ?? {}).reduce<{ + [key: number]: GameMode; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[globalThis.Number(key)] = GameMode.fromPartial(value); + } + return acc; + }, {}); + message.roles = Object.entries(object.roles ?? {}).reduce<{ + [key: number]: GameModeRole; + }>((acc, [key, value]) => { if (value !== undefined) { acc[globalThis.Number(key)] = GameModeRole.fromPartial(value); } @@ -189,166 +220,201 @@ function createBaseGameDefinitions_GameModesEntry(): GameDefinitions_GameModesEn return { key: 0, value: createBaseGameMode() }; } -export const GameDefinitions_GameModesEntry: MessageFns = { - encode(message: GameDefinitions_GameModesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.key !== undefined) { - writer.uint32(8).uint32(message.key); - } - if (message.value !== undefined) { - GameMode.encode(message.value, writer.uint32(18).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions_GameModesEntry { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGameDefinitions_GameModesEntry(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.key = reader.uint32(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.value = GameMode.decode(reader, reader.uint32()); - continue; - } +export const GameDefinitions_GameModesEntry: MessageFns = + { + encode( + message: GameDefinitions_GameModesEntry, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { + if (message.key !== undefined) { + writer.uint32(8).uint32(message.key); } - if ((tag & 7) === 4 || tag === 0) { - break; + if (message.value !== undefined) { + GameMode.encode(message.value, writer.uint32(18).fork()).join(); } - reader.skip(tag & 7); - } - return message; - }, + return writer; + }, - fromJSON(object: any): GameDefinitions_GameModesEntry { - return { - key: globalThis.Number(assertSet("GameDefinitions_GameModesEntry.key", object.key)), - value: GameMode.fromJSON(assertSet("GameDefinitions_GameModesEntry.value", object.value)), - }; - }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + ): GameDefinitions_GameModesEntry { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGameDefinitions_GameModesEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } - toJSON(message: GameDefinitions_GameModesEntry): unknown { - const obj: any = {}; - if (message.key !== undefined) { - obj.key = Math.round(message.key); - } - if (message.value !== undefined) { - obj.value = GameMode.toJSON(message.value); - } - return obj; - }, + message.key = reader.uint32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } - create, I>>(base?: I): GameDefinitions_GameModesEntry { - return GameDefinitions_GameModesEntry.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>( - object: I, - ): GameDefinitions_GameModesEntry { - const message = createBaseGameDefinitions_GameModesEntry(); - message.key = object.key ?? 0; - message.value = (object.value !== undefined && object.value !== null) - ? GameMode.fromPartial(object.value) - : undefined; - return message; - }, -}; + message.value = GameMode.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GameDefinitions_GameModesEntry { + return { + key: globalThis.Number( + assertSet('GameDefinitions_GameModesEntry.key', object.key), + ), + value: GameMode.fromJSON( + assertSet('GameDefinitions_GameModesEntry.value', object.value), + ), + }; + }, + + toJSON(message: GameDefinitions_GameModesEntry): unknown { + const obj: any = {}; + if (message.key !== undefined) { + obj.key = Math.round(message.key); + } + if (message.value !== undefined) { + obj.value = GameMode.toJSON(message.value); + } + return obj; + }, + + create, I>>( + base?: I, + ): GameDefinitions_GameModesEntry { + return GameDefinitions_GameModesEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial< + I extends Exact, I>, + >(object: I): GameDefinitions_GameModesEntry { + const message = createBaseGameDefinitions_GameModesEntry(); + message.key = object.key ?? 0; + message.value = + object.value !== undefined && object.value !== null + ? GameMode.fromPartial(object.value) + : undefined; + return message; + }, + }; function createBaseGameDefinitions_RolesEntry(): GameDefinitions_RolesEntry { return { key: 0, value: createBaseGameModeRole() }; } -export const GameDefinitions_RolesEntry: MessageFns = { - encode(message: GameDefinitions_RolesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.key !== undefined) { - writer.uint32(8).uint32(message.key); - } - if (message.value !== undefined) { - GameModeRole.encode(message.value, writer.uint32(18).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): GameDefinitions_RolesEntry { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGameDefinitions_RolesEntry(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.key = reader.uint32(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.value = GameModeRole.decode(reader, reader.uint32()); - continue; - } +export const GameDefinitions_RolesEntry: MessageFns = + { + encode( + message: GameDefinitions_RolesEntry, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { + if (message.key !== undefined) { + writer.uint32(8).uint32(message.key); } - if ((tag & 7) === 4 || tag === 0) { - break; + if (message.value !== undefined) { + GameModeRole.encode(message.value, writer.uint32(18).fork()).join(); } - reader.skip(tag & 7); - } - return message; - }, + return writer; + }, - fromJSON(object: any): GameDefinitions_RolesEntry { - return { - key: globalThis.Number(assertSet("GameDefinitions_RolesEntry.key", object.key)), - value: GameModeRole.fromJSON(assertSet("GameDefinitions_RolesEntry.value", object.value)), - }; - }, + decode( + input: BinaryReader | Uint8Array, + length?: number, + ): GameDefinitions_RolesEntry { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGameDefinitions_RolesEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } - toJSON(message: GameDefinitions_RolesEntry): unknown { - const obj: any = {}; - if (message.key !== undefined) { - obj.key = Math.round(message.key); - } - if (message.value !== undefined) { - obj.value = GameModeRole.toJSON(message.value); - } - return obj; - }, + message.key = reader.uint32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } - create, I>>(base?: I): GameDefinitions_RolesEntry { - return GameDefinitions_RolesEntry.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): GameDefinitions_RolesEntry { - const message = createBaseGameDefinitions_RolesEntry(); - message.key = object.key ?? 0; - message.value = (object.value !== undefined && object.value !== null) - ? GameModeRole.fromPartial(object.value) - : undefined; - return message; - }, -}; + message.value = GameModeRole.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GameDefinitions_RolesEntry { + return { + key: globalThis.Number( + assertSet('GameDefinitions_RolesEntry.key', object.key), + ), + value: GameModeRole.fromJSON( + assertSet('GameDefinitions_RolesEntry.value', object.value), + ), + }; + }, + + toJSON(message: GameDefinitions_RolesEntry): unknown { + const obj: any = {}; + if (message.key !== undefined) { + obj.key = Math.round(message.key); + } + if (message.value !== undefined) { + obj.value = GameModeRole.toJSON(message.value); + } + return obj; + }, + + create, I>>( + base?: I, + ): GameDefinitions_RolesEntry { + return GameDefinitions_RolesEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): GameDefinitions_RolesEntry { + const message = createBaseGameDefinitions_RolesEntry(); + message.key = object.key ?? 0; + message.value = + object.value !== undefined && object.value !== null + ? GameModeRole.fromPartial(object.value) + : undefined; + return message; + }, + }; function createBaseGameMode(): GameMode { return { name: createBaseI18nString() }; } export const GameMode: MessageFns = { - encode(message: GameMode, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + encode( + message: GameMode, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { if (message.name !== undefined) { I18nString.encode(message.name, writer.uint32(10).fork()).join(); } @@ -356,7 +422,8 @@ export const GameMode: MessageFns = { }, decode(input: BinaryReader | Uint8Array, length?: number): GameMode { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGameMode(); while (reader.pos < end) { @@ -380,7 +447,9 @@ export const GameMode: MessageFns = { }, fromJSON(object: any): GameMode { - return { name: I18nString.fromJSON(assertSet("GameMode.name", object.name)) }; + return { + name: I18nString.fromJSON(assertSet('GameMode.name', object.name)), + }; }, toJSON(message: GameMode): unknown { @@ -396,9 +465,10 @@ export const GameMode: MessageFns = { }, fromPartial, I>>(object: I): GameMode { const message = createBaseGameMode(); - message.name = (object.name !== undefined && object.name !== null) - ? I18nString.fromPartial(object.name) - : createBaseI18nString(); + message.name = + object.name !== undefined && object.name !== null + ? I18nString.fromPartial(object.name) + : createBaseI18nString(); return message; }, }; @@ -408,7 +478,10 @@ function createBaseGameModeRole(): GameModeRole { } export const GameModeRole: MessageFns = { - encode(message: GameModeRole, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + encode( + message: GameModeRole, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { writer.uint32(10).fork(); for (const v of message.provisions) { writer.uint32(v); @@ -423,7 +496,8 @@ export const GameModeRole: MessageFns = { }, decode(input: BinaryReader | Uint8Array, length?: number): GameModeRole { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGameModeRole(); while (reader.pos < end) { @@ -496,10 +570,14 @@ export const GameModeRole: MessageFns = { return obj; }, - create, I>>(base?: I): GameModeRole { + create, I>>( + base?: I, + ): GameModeRole { return GameModeRole.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>(object: I): GameModeRole { + fromPartial, I>>( + object: I, + ): GameModeRole { const message = createBaseGameModeRole(); message.provisions = object.provisions?.map((e) => e) || []; message.consumables = object.consumables?.map((e) => e) || []; @@ -507,21 +585,36 @@ export const GameModeRole: MessageFns = { }, }; -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial } - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends { $case: string; value: unknown } + ? { $case: T['$case']; value?: DeepPartial } + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; function isObject(value: any): boolean { - return typeof value === "object" && value !== null; + return typeof value === 'object' && value !== null; } function isSet(value: any): boolean { diff --git a/packages/core/src/protos/legacy_i18n.ts b/packages/core/src/protos/legacy_i18n.ts index 1faf016f7..6b2a93b36 100644 --- a/packages/core/src/protos/legacy_i18n.ts +++ b/packages/core/src/protos/legacy_i18n.ts @@ -5,9 +5,9 @@ // source: packages/core/src/protos/legacy_i18n.proto /* eslint-disable */ -import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire'; -export const protobufPackage = "blitzkit"; +export const protobufPackage = 'blitzkit'; export interface I18nString { locales: { [key: string]: string }; @@ -18,20 +18,27 @@ export interface I18nString_LocalesEntry { value: string; } -function createBaseI18nString(): I18nString { +export function createBaseI18nString(): I18nString { return { locales: {} }; } export const I18nString: MessageFns = { - encode(message: I18nString, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + encode( + message: I18nString, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { Object.entries(message.locales).forEach(([key, value]) => { - I18nString_LocalesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join(); + I18nString_LocalesEntry.encode( + { key: key as any, value }, + writer.uint32(10).fork(), + ).join(); }); return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): I18nString { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseI18nString(); while (reader.pos < end) { @@ -42,7 +49,10 @@ export const I18nString: MessageFns = { break; } - const entry1 = I18nString_LocalesEntry.decode(reader, reader.uint32()); + const entry1 = I18nString_LocalesEntry.decode( + reader, + reader.uint32(), + ); if (entry1.value !== undefined) { message.locales[entry1.key] = entry1.value; } @@ -60,10 +70,13 @@ export const I18nString: MessageFns = { fromJSON(object: any): I18nString { return { locales: isObject(object.locales) - ? Object.entries(object.locales).reduce<{ [key: string]: string }>((acc, [key, value]) => { - acc[key] = String(value); - return acc; - }, {}) + ? Object.entries(object.locales).reduce<{ [key: string]: string }>( + (acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, + {}, + ) : {}, }; }, @@ -85,9 +98,13 @@ export const I18nString: MessageFns = { create, I>>(base?: I): I18nString { return I18nString.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>(object: I): I18nString { + fromPartial, I>>( + object: I, + ): I18nString { const message = createBaseI18nString(); - message.locales = Object.entries(object.locales ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => { + message.locales = Object.entries(object.locales ?? {}).reduce<{ + [key: string]: string; + }>((acc, [key, value]) => { if (value !== undefined) { acc[key] = globalThis.String(value); } @@ -98,11 +115,14 @@ export const I18nString: MessageFns = { }; function createBaseI18nString_LocalesEntry(): I18nString_LocalesEntry { - return { key: "", value: "" }; + return { key: '', value: '' }; } export const I18nString_LocalesEntry: MessageFns = { - encode(message: I18nString_LocalesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + encode( + message: I18nString_LocalesEntry, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { if (message.key !== undefined) { writer.uint32(10).string(message.key); } @@ -112,8 +132,12 @@ export const I18nString_LocalesEntry: MessageFns = { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): I18nString_LocalesEntry { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + decode( + input: BinaryReader | Uint8Array, + length?: number, + ): I18nString_LocalesEntry { + const reader = + input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseI18nString_LocalesEntry(); while (reader.pos < end) { @@ -146,8 +170,12 @@ export const I18nString_LocalesEntry: MessageFns = { fromJSON(object: any): I18nString_LocalesEntry { return { - key: globalThis.String(assertSet("I18nString_LocalesEntry.key", object.key)), - value: globalThis.String(assertSet("I18nString_LocalesEntry.value", object.value)), + key: globalThis.String( + assertSet('I18nString_LocalesEntry.key', object.key), + ), + value: globalThis.String( + assertSet('I18nString_LocalesEntry.value', object.value), + ), }; }, @@ -162,32 +190,51 @@ export const I18nString_LocalesEntry: MessageFns = { return obj; }, - create, I>>(base?: I): I18nString_LocalesEntry { + create, I>>( + base?: I, + ): I18nString_LocalesEntry { return I18nString_LocalesEntry.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>(object: I): I18nString_LocalesEntry { + fromPartial, I>>( + object: I, + ): I18nString_LocalesEntry { const message = createBaseI18nString_LocalesEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? ""; + message.key = object.key ?? ''; + message.value = object.value ?? ''; return message; }, }; -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; -export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends { $case: string; value: unknown } ? { $case: T["$case"]; value?: DeepPartial } - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; +export type DeepPartial = T extends Builtin + ? T + : T extends globalThis.Array + ? globalThis.Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends { $case: string; value: unknown } + ? { $case: T['$case']; value?: DeepPartial } + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; function isObject(value: any): boolean { - return typeof value === "object" && value !== null; + return typeof value === 'object' && value !== null; } function isSet(value: any): boolean { diff --git a/packages/website/src/pages/[...locale]/tanks/index.astro b/packages/website/src/pages/[...locale]/tanks/index.astro index 03b3e95f7..f65cd3b39 100644 --- a/packages/website/src/pages/[...locale]/tanks/index.astro +++ b/packages/website/src/pages/[...locale]/tanks/index.astro @@ -14,7 +14,7 @@ const tanks = await awaitableTanks; { tanks.tanks.map((tank) => ( - {tank.seo_id} + {tank.slug} )) } diff --git a/src/BlitzKit.CLI/Functions/Mangler.cs b/src/BlitzKit.CLI/Functions/Mangler.cs index d0fc52559..5cac506e0 100644 --- a/src/BlitzKit.CLI/Functions/Mangler.cs +++ b/src/BlitzKit.CLI/Functions/Mangler.cs @@ -89,30 +89,22 @@ namespace BlitzKit.CLI.Functions void MangleNations() { var dirs = provider.RootDirectory.GetDirectory("Blitz/Content/Tanks").Directories; + Tanks tanks = new(); foreach (var dir in dirs) { if (dir.Key == "TankStub") continue; - MangleNation(dir.Value); - } - } + foreach (var tankDir in dir.Value.Directories) + { + // if (tankDir.Value.Name != "R90_IS_4") + // continue; - void MangleNation(VFS nation) - { - Tanks tanks = new(); - - foreach (var tankDir in nation.Directories) - { - // if (tankDir.Value.Name != "R90_IS_4") - // continue; - - var tank = MangleTank(tankDir.Value); - - TankMeta tankMeta = new() { Id = tank.Id, Slug = tank.Slug }; - - tanks.Tanks_.Add(tankMeta); + var tank = MangleTank(tankDir.Value); + TankMeta tankMeta = new() { Id = tank.Id, Slug = tank.Slug }; + tanks.Tanks_.Add(tankMeta); + } } changes.Add(new("definitions/tanks.pb", tanks.ToByteArray()));