Compare commits

...
5 Commits
Author SHA1 Message Date
TrèsAbhi b05e70faee feat: clear all provisions 2025-12-10 23:03:30 -06:00
TrèsAbhi 5c30169eca fix: canvas smooth resize 2025-12-10 22:57:21 -06:00
TrèsAbhi 1226ce89a7 fix: shallow testing 2025-12-10 17:46:58 -06:00
TrèsAbhi dcc8207fb6 fix: deconstructor 2025-12-10 17:31:03 -06:00
TrèsAbhi c50f40a887 fix: default 2025-12-10 17:15:35 -06:00
9 changed files with 46 additions and 29 deletions

No files matched your search

+1 -1
View File
@@ -79,4 +79,4 @@ jobs:
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
- name: Build assets
run: bun run build:assets --all-targets --source=${{ github.event.inputs.asset_source }}
run: bun run build:assets --all-targets --source=${{ github.event.inputs.asset_source || 'steam:444200/444202' }}
+2 -1
View File
@@ -1267,7 +1267,8 @@
"upgrade": "Upgrade"
},
"provisions": {
"clear": "Clear"
"clear": "Clear",
"clear_all": "Clear all"
},
"consumables": {
"clear": "Clear"
@@ -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;
@@ -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];
@@ -99,7 +99,7 @@ export class AssetUploader {
}
if (diff.status === DiffStatus.Unchanged) {
// console.log(`🔵 ${change.path}`);
console.log(`🔵 ${change.path}`);
} else {
console.log(
`${diff.status === DiffStatus.New ? "🟢" : "🟡"} (${
+7 -9
View File
@@ -49,20 +49,18 @@ export abstract class AbstractVFS {
dir(path: string) {
const parentSegments = path.split("/").length;
const children: string[] = [];
const children = new Set<string>();
for (const child of this.paths()) {
if (!child.startsWith(path) || child === path) continue;
for (const [child] of this.paths()) {
const childSegments = child.split("/");
const nextSegment = childSegments[parentSegments];
if (
child.startsWith(path) &&
parentSegments + 1 === childSegments.length
) {
children.push(childSegments.at(-1)!);
}
children.add(nextSegment);
}
return children;
return Array.from(children);
}
async text(path: string) {
@@ -345,7 +345,24 @@ export function CompareTable({ stats }: CompareTableProps) {
});
}}
/>
<Flex justify="end" mt="4">
<Flex justify="end" mt="4" gap="3">
<Button
variant="ghost"
onClick={() => {
CompareEphemeral.mutate((draft) => {
draft.members.map((member) => {
member.provisions = [];
});
});
}}
>
{
strings.website.tools.compare.table.provisions
.clear_all
}
</Button>
<Button
variant="ghost"
onClick={() => {
@@ -150,6 +150,7 @@ export const TankSandbox = forwardRef<HTMLCanvasElement, TankSandboxProps>(
return (
<SmartCanvas
resize={{ debounce: 0 }}
ref={canvas}
scene={{ fog: new Fog("black", 30, 50) }}
gl={{