added unique sprites support
This commit is contained in:
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
6
_sprites/unique.txt
Normal file
6
_sprites/unique.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
Для того, чтобы спрайт добавился в папку sorted нужно написать его название и главу в списке ниже!
|
||||||
|
Примеры:
|
||||||
|
chapter3/sprite1 - Добавит в папку ТРЕТЬЕЙ главы спрайт sprite1 (будь то папка с анимацией или просто спрайт)
|
||||||
|
chapter2/sprite3 - Добавит в папку ВТОРОЙ главы спрайт sprite3 (будь то папка с анимацией или просто спрайт)
|
||||||
|
|
||||||
|
УНИКАЛЬНЫЕ ДЛЯ РУСИФИКАТОРА:
|
||||||
4374
scripts/data.json
4374
scripts/data.json
File diff suppressed because one or more lines are too long
@@ -1,10 +1,18 @@
|
|||||||
import AdmZip from "adm-zip";
|
import AdmZip from "adm-zip";
|
||||||
import fs from "node:fs";
|
import fs from "node:fs";
|
||||||
|
|
||||||
|
const SPECIALS = ["sp", "spm"];
|
||||||
const DATA = JSON.parse(fs.readFileSync("./data.json", "utf-8"));
|
const DATA = JSON.parse(fs.readFileSync("./data.json", "utf-8"));
|
||||||
const chapters = fs.readdirSync("../_sprites/original");
|
const chapters = fs.readdirSync("../_sprites/original");
|
||||||
|
|
||||||
const SPECIALS = ["sp", "spm"];
|
const UNIQUES = fs
|
||||||
|
.readFileSync("../_sprites/unique.txt", "utf-8")
|
||||||
|
.split("УНИКАЛЬНЫЕ ДЛЯ РУСИФИКАТОРА:")
|
||||||
|
.at(-1)
|
||||||
|
?.split("\n");
|
||||||
|
|
||||||
|
UNIQUES?.shift();
|
||||||
|
if (UNIQUES?.at(-1) == "") UNIQUES?.pop();
|
||||||
|
|
||||||
function add_singles(chapter, sprite_name) {
|
function add_singles(chapter, sprite_name) {
|
||||||
const img_name = `${sprite_name}.png`;
|
const img_name = `${sprite_name}.png`;
|
||||||
@@ -97,4 +105,25 @@ for (const chapter of chapters) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (UNIQUES != undefined) {
|
||||||
|
for (const unique of UNIQUES) {
|
||||||
|
const uniqueChapter = unique.split("/")[0];
|
||||||
|
const uniqueName = unique.split("/")[1];
|
||||||
|
console.log(uniqueChapter, uniqueName);
|
||||||
|
|
||||||
|
if (fs.existsSync(`../_sprites/translation/${uniqueName}.png`))
|
||||||
|
fs.copyFileSync(
|
||||||
|
`../_sprites/translation/${uniqueName}.png`,
|
||||||
|
`../_sprites/sorted/${uniqueChapter}/${uniqueName}.png`
|
||||||
|
);
|
||||||
|
|
||||||
|
if (fs.existsSync(`../_sprites/translation/${uniqueName}`))
|
||||||
|
fs.cpSync(
|
||||||
|
`../_sprites/translation/${uniqueName}`,
|
||||||
|
`../_sprites/sorted/${uniqueChapter}/${uniqueName}`,
|
||||||
|
{ recursive: true, force: true }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// :D
|
// :D
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ const CUTS = fs
|
|||||||
CUTS?.shift();
|
CUTS?.shift();
|
||||||
if (CUTS?.at(-1) == "") CUTS?.pop();
|
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`;
|
||||||
|
|||||||
Reference in New Issue
Block a user