Merge branch 'rust'
# Conflicts: # README.md
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/output
|
||||
/target
|
||||
**/*.rs.bk
|
||||
4
Cargo.lock
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
[[package]]
|
||||
name = "ui-compiler"
|
||||
version = "0.1.0"
|
||||
|
||||
6
Cargo.toml
Normal file
@@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "ui-compiler"
|
||||
version = "0.1.0"
|
||||
authors = ["Jáchym Toušek <enumag@gmail.com>"]
|
||||
|
||||
[dependencies]
|
||||
19
README.md
@@ -1,5 +1,20 @@
|
||||
# UI editing scripts
|
||||
UI Compiler
|
||||
----
|
||||
|
||||
Scripts for easier editing of Unity assets for Higurashi.
|
||||
|
||||
Documentation can be found [here](https://github.com/07th-mod/higurashi-dev-guides/wiki/UI-editing-scripts).
|
||||
To use this tool you will need to install both Python and Rust. Then simply run this:
|
||||
|
||||
```
|
||||
cargo run <chapter> <platform>
|
||||
```
|
||||
|
||||
`<chapter>` is simply `onikakushi`, `watanagashi` and so on.
|
||||
|
||||
`<platform>` is `win` or `mac`. For tatarigoroshi platform can also be `win-mg` and `mac-mg`.
|
||||
|
||||
Documentation for the underlying python scripts can be found [here](https://github.com/07th-mod/higurashi-dev-guides/wiki/UI-editing-scripts).
|
||||
|
||||
The rust script will generate a new emip file in the output directory which you can apply to assets file using UABE as described in the docs for the python scripts.
|
||||
|
||||
If you want to use this tool to compile assets for a different language, you can change the files in the assets directory to your needs.
|
||||
|
||||
BIN
assets/fonts/msgothic_0 SDF Atlas_Texture2D.dat
Normal file
BIN
assets/fonts/msgothic_0 SDF_TextMeshProFont.dat
Normal file
BIN
assets/images/answer_arcs/ChapterPreview.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
assets/images/answer_arcs/TitleHigurashi.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
assets/images/question_arcs/ChapterPreview.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
assets/images/question_arcs/TitleHigurashi.png
Normal file
|
After Width: | Height: | Size: 118 KiB |
BIN
assets/images/shared/Backlog.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
assets/images/shared/ConfigHigurashi.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
assets/images/shared/HigurashiMenu.png
Normal file
|
After Width: | Height: | Size: 358 KiB |
BIN
assets/images/shared/MainUI.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
assets/images/shared/PromptHigurashi.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
assets/images/shared/SGMenu990000.png
Normal file
|
After Width: | Height: | Size: 358 KiB |
BIN
assets/images/shared/SGMenu990000_jp.png
Normal file
|
After Width: | Height: | Size: 359 KiB |
BIN
assets/images/shared/black.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
assets/images/shared/configbg.png
Normal file
|
After Width: | Height: | Size: 212 KiB |
BIN
assets/images/shared/configbg_jp.png
Normal file
|
After Width: | Height: | Size: 184 KiB |
BIN
assets/images/shared/dialog_areyousure.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
assets/images/shared/dialog_areyousure_jp.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
assets/images/shared/dialog_delete.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
assets/images/shared/dialog_delete_jp.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
assets/images/shared/dialog_edit.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
assets/images/shared/dialog_edit_jp.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
assets/images/shared/dialog_exit.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
assets/images/shared/dialog_exit_jp.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
assets/images/shared/dialog_language.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
assets/images/shared/dialog_load.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
assets/images/shared/dialog_load_jp.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
assets/images/shared/dialog_save.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
assets/images/shared/dialog_save_jp.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
assets/images/shared/log_bg_base_b.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
assets/images/shared/s_jump_back.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
assets/images/shared/saveloadbg.png
Normal file
|
After Width: | Height: | Size: 183 KiB |
BIN
assets/images/shared/saveloadhigurashi.png
Normal file
|
After Width: | Height: | Size: 177 KiB |
BIN
assets/images/shared/tipsback.png
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
BIN
assets/images/specific/himatsubushi/TipsPrefab.png
Normal file
|
After Width: | Height: | Size: 9.6 MiB |
BIN
assets/images/specific/meakashi/TipsPrefab.png
Normal file
|
After Width: | Height: | Size: 3.0 MiB |
BIN
assets/images/specific/onikakushi/TipsPrefab.png
Normal file
|
After Width: | Height: | Size: 3.7 MiB |
BIN
assets/images/specific/tatarigoroshi/TipsPrefab.png
Normal file
|
After Width: | Height: | Size: 6.4 MiB |
BIN
assets/images/specific/tsumihoroboshi/TipsPrefab.png
Normal file
|
After Width: | Height: | Size: 3.3 MiB |
BIN
assets/images/specific/watanagashi/TipsPrefab.png
Normal file
|
After Width: | Height: | Size: 3.8 MiB |
50
assets/text-edits.json
Normal file
@@ -0,0 +1,50 @@
|
||||
[
|
||||
{
|
||||
"CurrentEnglish": "Updated",
|
||||
"CurrentJapanese": "新規",
|
||||
"NewEnglish": "Remake",
|
||||
"NewJapanese": "リメーク"
|
||||
},
|
||||
{
|
||||
"CurrentEnglish": "Original",
|
||||
"CurrentJapanese": "オリジナル",
|
||||
"NewEnglish": "Console",
|
||||
"NewJapanese": "ゲーム機"
|
||||
},
|
||||
{
|
||||
"CurrentEnglish": "Standard 640x480",
|
||||
"CurrentJapanese": "標準 640x480",
|
||||
"NewEnglish": "Standard 854x480",
|
||||
"NewJapanese": "標準 854x480"
|
||||
},
|
||||
{
|
||||
"CurrentEnglish": "800x600",
|
||||
"CurrentJapanese": "800x600",
|
||||
"NewEnglish": "1067x600",
|
||||
"NewJapanese": "1067x600"
|
||||
},
|
||||
{
|
||||
"CurrentEnglish": "1024x768",
|
||||
"CurrentJapanese": "1024x768",
|
||||
"NewEnglish": "1366x768",
|
||||
"NewJapanese": "1366x768"
|
||||
},
|
||||
{
|
||||
"CurrentEnglish": "Watanagashi 12-3",
|
||||
"CurrentJapanese": "綿流し編 12日目3",
|
||||
"NewEnglish": "Watanagashi Day 12-3",
|
||||
"NewJapanese": "綿流し編 12日目3"
|
||||
},
|
||||
{
|
||||
"CurrentEnglish": "Himatsubushi 2-2",
|
||||
"CurrentJapanese": "暇潰し編 2日目2",
|
||||
"NewEnglish": "Himatsubushi Day 2-2",
|
||||
"NewJapanese": "暇潰し編 2日目2"
|
||||
},
|
||||
{
|
||||
"CurrentEnglish": "Himatsubushi 2-3",
|
||||
"CurrentJapanese": "暇潰し編 2日目3",
|
||||
"NewEnglish": "Himatsubushi Day 2-3",
|
||||
"NewJapanese": "暇潰し編 2日目3"
|
||||
}
|
||||
]
|
||||
89
src/main.rs
Normal file
@@ -0,0 +1,89 @@
|
||||
use std::env;
|
||||
use std::process::Command;
|
||||
use std::fs;
|
||||
use std::path::Path;
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = env::args().collect();
|
||||
let chapter = &args[1];
|
||||
let platform = &args[2];
|
||||
|
||||
let arc_type = if chapter == "onikakushi" || chapter == "watanagashi" || chapter == "tatarigoroshi" || chapter == "himatsubushi" { "question_arcs" } else { "answer_arcs" };
|
||||
let assets = format!("assets/vanilla/{}/{}/sharedassets0.assets", chapter, platform);
|
||||
let directory = "output/assets";
|
||||
let emip = format!("output/{}-{}.emip", &chapter, &platform);
|
||||
|
||||
if Path::new(&emip).exists() {
|
||||
fs::remove_file(&emip).expect("Failed to remove file");
|
||||
}
|
||||
if Path::new(&directory).exists() {
|
||||
fs::remove_dir_all("output/assets").expect("Failed to remove directory");
|
||||
}
|
||||
fs::create_dir_all("output/assets").expect("Failed to recreate directory");
|
||||
|
||||
// 1. texts
|
||||
let output = Command::new("python")
|
||||
.env("PYTHONIOENCODING", "utf-8")
|
||||
.arg("../ui-editing-scripts/UnityTextModifier.py")
|
||||
.arg(&assets)
|
||||
.arg("assets/text-edits.json")
|
||||
.arg(&directory)
|
||||
.output()
|
||||
.expect("failed to execute UnityTextModifier.py");
|
||||
|
||||
if output.status.success() {
|
||||
println!("{}", String::from_utf8_lossy(&output.stdout));
|
||||
} else {
|
||||
println!("{}", String::from_utf8_lossy(&output.stderr));
|
||||
}
|
||||
|
||||
// 2. images
|
||||
copy_files("assets/images/shared", &directory);
|
||||
copy_files(format!("assets/images/{}", &arc_type).as_ref(), &directory);
|
||||
copy_files(format!("assets/images/specific/{}", &chapter).as_ref(), &directory);
|
||||
fs::rename("output/assets/configbg_Texture2D.png", "output/assets/47configbg_Texture2D.png").expect("Unable to rename");
|
||||
println!();
|
||||
|
||||
// 3. fonts
|
||||
let output = Command::new("python")
|
||||
.env("PYTHONIOENCODING", "utf-8")
|
||||
.arg("../ui-editing-scripts/TMPAssetConverter.py")
|
||||
.arg("assets/fonts/msgothic_0 SDF Atlas_Texture2D.dat")
|
||||
.arg("assets/fonts/msgothic_0 SDF_TextMeshProFont.dat")
|
||||
.arg(format!("assets/vanilla/{}/msgothic_0.dat", &chapter))
|
||||
.arg(&directory)
|
||||
.output()
|
||||
.expect("failed to execute TMPAssetConverter.py");
|
||||
|
||||
if output.status.success() {
|
||||
println!("{}", String::from_utf8_lossy(&output.stdout));
|
||||
} else {
|
||||
println!("{}", String::from_utf8_lossy(&output.stderr));
|
||||
}
|
||||
|
||||
println!();
|
||||
|
||||
// 4. emip
|
||||
let output = Command::new("python")
|
||||
.env("PYTHONIOENCODING", "utf-8")
|
||||
.arg("../ui-editing-scripts/EMIPGenerator.py")
|
||||
.arg(&assets)
|
||||
.arg(&directory)
|
||||
.arg(&emip)
|
||||
.output()
|
||||
.expect("failed to execute EMIPGenerator.py");
|
||||
|
||||
if output.status.success() {
|
||||
println!("{}", String::from_utf8_lossy(&output.stdout));
|
||||
} else {
|
||||
println!("{}", String::from_utf8_lossy(&output.stderr));
|
||||
}
|
||||
}
|
||||
|
||||
fn copy_files(from: &str, to: &str) {
|
||||
println!("Copying files from {}", from);
|
||||
for entry in fs::read_dir(from).expect("Can't read directory") {
|
||||
let path = entry.unwrap().path();
|
||||
fs::copy(&path, format!("{}/{}_Texture2D.png", to, path.file_stem().unwrap().to_str().unwrap())).expect("Unable to copy");
|
||||
}
|
||||
}
|
||||