fix: update to new api

This commit is contained in:
TrèsAbhi committed 2026-04-01 21:40:15 -05:00
1 parent 34ee954502
commit 3a9af7505f
17 files changed
+104 -99

No files matched your search

@@ -6,15 +6,20 @@ export async function moduleIcons() {
console.log("Building module icons...");
using uploader = new AssetUploader("module icons");
const files = vfs.dir(`Data/Gfx/UI/ModulesTechTree`).filter(
(file) => !file.endsWith("@2x.packed.webp") && file.startsWith("vehicle")
)
const files = await vfs
.dir(`Data/Gfx/UI/ModulesTechTree`)
.then((files) =>
files.filter(
(file) =>
!file.endsWith("@2x.packed.webp") && file.startsWith("vehicle"),
),
);
for (const file of files) {
const nameRaw = file.match(/vehicle(.+)\.packed\.webp/)![1];
const name = nameRaw[0].toLowerCase() + nameRaw.slice(1);
const content = await sharp(
await vfs.file(`Data/Gfx/UI/ModulesTechTree/${file}`)
await vfs.file(`Data/Gfx/UI/ModulesTechTree/${file}`),
)
.trim()
.toBuffer();