fix typecheck script, animations

This commit is contained in:
Brian Beck 2026-03-16 18:16:34 -07:00
parent 642fce9c06
commit ceb9fea9f4
120 changed files with 1308 additions and 911 deletions

View file

@ -191,8 +191,8 @@ for (const rel of playerModels) {
`${name}: rhand node="${rhNode.name}" translation=(${translation.map((v: number) => v.toFixed(3)).join(", ")}) (no mesh centroid)`,
);
}
} catch (e: any) {
console.log(`${name}: error - ${e.message}`);
} catch (e) {
console.log(`${path.basename(rel, ".glb")}: error - ${(e as Error).message}`);
}
}

View file

@ -17,7 +17,7 @@ async function run({ onlyNew }: { onlyNew: boolean }) {
if (onlyNew) {
try {
await fs.stat(glbFile);
} catch (err) {
} catch (err: any) {
if (err.code === "ENOENT") {
inputFiles.push(inFile);
}

View file

@ -17,7 +17,7 @@ async function run({ onlyNew }: { onlyNew: boolean }) {
if (onlyNew) {
try {
await fs.stat(glbFile);
} catch (err) {
} catch (err: any) {
if (err.code === "ENOENT") {
inputFiles.push(inFile);
}

View file

@ -5,7 +5,7 @@ async function run() {
const glbFile = inFile.replace(/\.dif$/, ".glb");
try {
await fs.stat(glbFile);
} catch (err) {
} catch (err: any) {
if (err.code === "ENOENT") {
console.log(inFile);
} else {

View file

@ -5,7 +5,7 @@ async function run() {
const glbFile = inFile.replace(/\.dts$/, ".glb");
try {
await fs.stat(glbFile);
} catch (err) {
} catch (err: any) {
if (err.code === "ENOENT") {
console.log(inFile);
} else {

View file

@ -23,13 +23,14 @@ async function run() {
console.error("Cannot specify --list (-l) with other options.");
return 1;
}
// @ts-expect-error JSON import resolved at runtime by tsx
const manifest = (await import("../public/manifest.json")).default;
const fileNames = Object.keys(manifest);
console.log(
fileNames
.map((f) => f.match(/^textures\/skins\/(.+)\.ifl$/))
.filter(Boolean)
.map((match) => match[1])
.map((match) => match![1])
.join("\n"),
);
return;

View file

@ -1,17 +0,0 @@
import fs from "node:fs";
import { inspect } from "node:util";
import { parseInteriorBuffer } from "@/src/interior";
const interiorFile = process.argv[2];
const interiorBuffer = fs.readFileSync(interiorFile);
const interiorArrayBuffer = interiorBuffer.buffer.slice(
interiorBuffer.byteOffset,
interiorBuffer.byteOffset + interiorBuffer.byteLength,
);
console.log(
inspect(parseInteriorBuffer(interiorArrayBuffer), {
colors: true,
depth: Infinity,
}),
);

View file

@ -28,7 +28,7 @@ async function run() {
getResourceList()
.map((f) => f.match(/^terrains\/(.+)\.ter$/))
.filter(Boolean)
.map((match) => path.basename(getLocalFilePath(match[0]), ".ter"))
.map((match) => path.basename(getLocalFilePath(match![0]), ".ter"))
.join("\n"),
);
return;

View file

@ -190,4 +190,4 @@ async function run({
}
}
run({ typeList, propertyList, valuesOnly: values.values });
run({ typeList, propertyList, valuesOnly: values.values ?? false });

View file

@ -78,8 +78,8 @@ page.on("console", async (msg) => {
console.log(`[browser ${prefix}] ${parts.join(" ")}`);
});
page.on("pageerror", (err: Error) => {
console.error(`[browser EXCEPTION] ${err.message}`);
page.on("pageerror", (err: unknown) => {
console.error(`[browser EXCEPTION] ${(err as Error).message}`);
});
// Set up settings before navigating.
@ -106,8 +106,8 @@ await page.keyboard.press("Escape");
await sleep(100);
// Hide controls from screenshots.
await page.$eval("#controls", (el: HTMLElement) => {
el.style.visibility = "hidden";
await page.$eval("#controls", (el) => {
(el as HTMLElement).style.visibility = "hidden";
});
// Upload the demo file via the hidden file input.

View file

@ -81,8 +81,8 @@ await page.keyboard.press("Escape");
await sleep(50);
// Hide controls from screenshots while keeping them selectable
await page.$eval("#controls", (el: HTMLElement) => {
el.style.visibility = "hidden";
await page.$eval("#controls", (el) => {
(el as HTMLElement).style.visibility = "hidden";
});
// Wait for mission to load

View file

@ -295,7 +295,7 @@ async function main() {
// Step 2: Download credentials (retry on network errors)
console.log("Downloading account credentials...");
let credentials: { certificate: string; encryptedKey: string };
let credentials!: { certificate: string; encryptedKey: string };
for (let attempt = 1; attempt <= maxRetries; attempt++) {
try {
credentials = await downloadAccount(authAddress, username, pw);