added cut sprites system
This commit is contained in:
5
_sprites/cut.txt
Normal file
5
_sprites/cut.txt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Для того, чтобы спрайт не шёл в учёт неготовых нужно написать его название в списке ниже!
|
||||||
|
Просто название спрайта, без каких-либо дополнительных символов.
|
||||||
|
|
||||||
|
Вырезня:
|
||||||
|
spr_ch3_gameshow_round
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 857 B |
@@ -2,6 +2,17 @@ import fs from "node:fs";
|
|||||||
|
|
||||||
const CHAPTERS = JSON.parse(fs.readFileSync("./data.json", "utf-8"));
|
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)) {
|
for (const chapter of Object.keys(CHAPTERS)) {
|
||||||
const OriginalPath = `../_sprites/original/${chapter}`;
|
const OriginalPath = `../_sprites/original/${chapter}`;
|
||||||
const UnreadyPath = `../_sprites/unready`;
|
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,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user