added cut sprites system

This commit is contained in:
snus xD
2025-07-22 14:34:05 +05:00
parent 45799c0278
commit 31eb10145c
3 changed files with 31 additions and 0 deletions

5
_sprites/cut.txt Normal file
View File

@@ -0,0 +1,5 @@
Для того, чтобы спрайт не шёл в учёт неготовых нужно написать его название в списке ниже!
Просто название спрайта, без каких-либо дополнительных символов.
Вырезня:
spr_ch3_gameshow_round

Binary file not shown.

Before

Width:  |  Height:  |  Size: 857 B

View File

@@ -2,6 +2,17 @@ import fs from "node:fs";
const CHAPTERS = JSON.parse(fs.readFileSync("./data.json", "utf-8"));
const CUTS = fs
.readFileSync("../_sprites/cut.txt", "utf-8")
.split("Вырезня:")
.at(-1)
?.split("\n");
CUTS?.shift();
if (CUTS?.at(-1) == "") CUTS?.pop();
console.log(CUTS);
for (const chapter of Object.keys(CHAPTERS)) {
const OriginalPath = `../_sprites/original/${chapter}`;
const UnreadyPath = `../_sprites/unready`;
@@ -29,3 +40,18 @@ for (const sprite of TRANSLATED) {
});
}
}
if (CUTS != undefined) {
for (const cut of CUTS) {
if (fs.existsSync(`../_sprites/unready/${cut}`))
fs.rmSync(`../_sprites/unready/${cut}`, {
recursive: true,
force: true,
});
else if (fs.existsSync(`../_sprites/unready/${cut}.png`))
fs.rmSync(`../_sprites/unready/${cut}.png`, {
recursive: true,
force: true,
});
}
}