WaterBlock tiling to match T2/Torque, improve CLAUDE.md

This commit is contained in:
Brian Beck 2025-12-11 22:07:29 -08:00
parent bcf4f4a1a5
commit aeda3ca8d5
940 changed files with 1207 additions and 337 deletions

View file

@ -1,4 +1,4 @@
import fs from "node:fs";
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import puppeteer, { type KeyInput } from "puppeteer";
@ -41,11 +41,6 @@ if (!missionName) {
const cameraKey = String(cameraNumber) as KeyInput;
const outputType = "png";
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "t2-screenshot-"));
const outputPath = path.join(
tempDir,
`${missionName}.${cameraNumber}.${debugMode ? "debug." : ""}${outputType}`,
);
const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
@ -100,6 +95,16 @@ await mapViewer.press(cameraKey);
await page.waitForNetworkIdle({ idleTime: 250 });
await sleep(100);
const date = new Date()
const tempDir = path.join(os.tmpdir(), "t2-mapper");
await fs.mkdir(tempDir, { recursive: true });
const filePrefix = date.toISOString().replace(/([:-]|\..*$)/g, '')
const outputPath = path.join(
tempDir,
`${filePrefix}.${missionName}.${cameraNumber}.${outputType}`
);
// Take screenshot
await mapViewer.screenshot({
path: outputPath,