Move files to subfolders
Also output the modified files into an `output` directory.
This commit is contained in:
parent
25cde2a22e
commit
05a3dfb44f
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,7 +1,6 @@
|
||||
# Custom
|
||||
config.js
|
||||
character_character_data.bin
|
||||
character_model_model_data.bin
|
||||
output/
|
||||
|
||||
# ---> Node
|
||||
# Logs
|
||||
|
12
index.js
12
index.js
@ -8,6 +8,10 @@ if (!fs.existsSync("config.js")) {
|
||||
fs.writeFileSync("config.js", fs.readFileSync("config.default.js"));
|
||||
}
|
||||
|
||||
if (!fs.existsSync("output")) {
|
||||
fs.mkdirSync("output");
|
||||
}
|
||||
|
||||
const {
|
||||
mode,
|
||||
sameType,
|
||||
@ -52,7 +56,7 @@ function isModelBlacklisted(fb, sb) {
|
||||
}
|
||||
|
||||
function replaceModels(doReplace = true) {
|
||||
const data = fs.readFileSync("character_character_data.bin.orig");
|
||||
const data = fs.readFileSync("original/character_character_data.bin.orig");
|
||||
|
||||
if (doReplace) {
|
||||
// Magic
|
||||
@ -97,13 +101,13 @@ function replaceModels(doReplace = true) {
|
||||
// -----
|
||||
}
|
||||
|
||||
fs.writeFileSync("character_character_data.bin", data);
|
||||
fs.writeFileSync("output/character_character_data.bin", data);
|
||||
}
|
||||
|
||||
// TODO: Create a reverse-lookup map of some sort to fit the proper model height with other models?
|
||||
// Only does scaling, so not that needed apparently...
|
||||
function replaceHeights(doReplace = true) {
|
||||
const data = fs.readFileSync("character_model_model_data.bin.orig");
|
||||
const data = fs.readFileSync("original/character_model_model_data.bin.orig");
|
||||
|
||||
if (doReplace) {
|
||||
// Magic
|
||||
@ -114,7 +118,7 @@ function replaceHeights(doReplace = true) {
|
||||
// -----
|
||||
}
|
||||
|
||||
fs.writeFileSync("character_model_model_data.bin", data);
|
||||
fs.writeFileSync("output/character_model_model_data.bin", data);
|
||||
}
|
||||
|
||||
replaceModels();
|
||||
|
Loading…
Reference in New Issue
Block a user