diff --git a/assets/images/version-specific/meakashi-unix-5.5.3p1/TitleHigurashi.png b/assets/images/version-specific/meakashi-unix-5.5.3p1/TitleHigurashi.png new file mode 100644 index 0000000..c83eef9 Binary files /dev/null and b/assets/images/version-specific/meakashi-unix-5.5.3p1/TitleHigurashi.png differ diff --git a/compileall.sh b/compileall.sh index 63e0f5d..b621262 100644 --- a/compileall.sh +++ b/compileall.sh @@ -1,15 +1,16 @@ -cargo run onikakushi steam win -cargo run onikakushi steam unix -cargo run watanagashi steam win -cargo run watanagashi steam unix -cargo run tatarigoroshi steam win -cargo run tatarigoroshi steam unix -cargo run tatarigoroshi mg win -cargo run tatarigoroshi mg unix -cargo run himatsubushi steam win -cargo run himatsubushi steam unix -cargo run meakashi steam win -cargo run meakashi steam unix -cargo run meakashi gog win -cargo run tsumihoroboshi steam win -cargo run tsumihoroboshi steam unix +cargo run onikakushi 5.2.2f1 win +cargo run onikakushi 5.2.2f1 unix +cargo run watanagashi 5.2.2f1 win +cargo run watanagashi 5.2.2f1 unix +cargo run tatarigoroshi 5.4.0f1 win +cargo run tatarigoroshi 5.4.0f1 unix +cargo run tatarigoroshi 5.3.5f1 win +cargo run tatarigoroshi 5.3.4p1 unix +cargo run himatsubushi 5.4.1f1 win +cargo run himatsubushi 5.4.1f1 unix +cargo run meakashi 5.5.3p3 win +cargo run meakashi 5.5.3p3 unix +cargo run meakashi 5.5.3p1 win +cargo run meakashi 5.5.3p1 unix +cargo run tsumihoroboshi 5.5.3p3 win +cargo run tsumihoroboshi 5.5.3p3 unix diff --git a/scripts/AssetVersion.py b/scripts/AssetVersion.py index 76c678b..ed31605 100644 --- a/scripts/AssetVersion.py +++ b/scripts/AssetVersion.py @@ -1,9 +1,8 @@ import os from sys import argv -path = argv[1] +assetsbundlePath = argv[1] -assetsbundlePath = os.path.join(path, "sharedassets0.assets") if os.path.exists(assetsbundlePath): with open(assetsbundlePath, "rb") as assetsBundle: unityVersion = assetsBundle.read(28)[20:].decode("utf-8").rstrip("\0") diff --git a/src/main.rs b/src/main.rs index d8a5d59..7d2ae06 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,7 +11,7 @@ use inflector::Inflector; fn main() { let args: Vec = env::args().collect(); let chapter = &args[1]; - let platform = &args[2]; + let unity = &args[2]; let system = &args[3]; let mut chapters = HashMap::new(); @@ -29,11 +29,11 @@ fn main() { let arc_number = chapters.get(chapter).unwrap(); let arc_type = if arc_number <= &4 { "question_arcs" } else { "answer_arcs" }; - let assets = format!("assets/vanilla/{}/{}/{}/sharedassets0.assets", chapter, platform, system); + let assets = format!("assets/vanilla/{}/{}-{}/sharedassets0.assets", &chapter, &system, &unity); let directory_assets = "output/assets"; - let directory_data = format!("output/HigurashiEp{:02}_Data", arc_number); - let emip = format!("{}/{}_{}_{}.emip", &directory_data, &chapter, &platform, &system); - let archive = format!("{}-UI_{}_{}.7z", &chapter.to_title_case(), &platform, &system); + let directory_data = format!("output/HigurashiEp{:02}_Data", &arc_number); + let emip = format!("{}/{}_{}_{}.emip", &directory_data, &chapter, &unity, &system); + let archive = format!("{}-UI_{}_{}.7z", &chapter.to_title_case(), &unity, &system); if Path::new(&emip).exists() { fs::remove_file(&emip).expect("Failed to remove file"); @@ -50,6 +50,18 @@ fn main() { } fs::create_dir_all(&directory_data).expect("Failed to recreate directory"); + // 0. check version + let output = Command::new("python") + .env("PYTHONIOENCODING", "utf-8") + .arg("scripts/AssetVersion.py") + .arg(&assets) + .output() + .expect("failed to execute UnityTextModifier.py"); + + let version = String::from_utf8_lossy(&output.stdout).into_owned(); + + assert_eq!(unity, &version.trim()); + // 1. texts let status = Command::new("python") .env("PYTHONIOENCODING", "utf-8") @@ -66,6 +78,10 @@ fn main() { copy_images("assets/images/shared", &directory_assets); copy_images(format!("assets/images/{}", &arc_type).as_ref(), &directory_assets); copy_images(format!("assets/images/specific/{}", &chapter).as_ref(), &directory_assets); + let version_specific_path = format!("assets/images/version-specific/{}-{}", &chapter, &unity); + if Path::new(&version_specific_path).exists() { + copy_images(version_specific_path.as_ref(), &directory_assets); + } fs::rename("output/assets/configbg_Texture2D.png", "output/assets/47configbg_Texture2D.png").expect("Unable to rename"); println!(); @@ -75,7 +91,7 @@ fn main() { .arg("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, platform)) + .arg(format!("assets/vanilla/{}/msgothic_0.dat", &chapter)) .arg(&directory_assets) .status() .expect("failed to execute TMPAssetConverter.py"); @@ -87,7 +103,7 @@ fn main() { .arg("scripts/TMPAssetConverter.py") .arg("assets/fonts/msgothic_2 SDF Atlas_Texture2D.dat") .arg("assets/fonts/msgothic_2 SDF_TextMeshProFont.dat") - .arg(format!("assets/vanilla/{}/{}/msgothic_2.dat", &chapter, platform)) + .arg(format!("assets/vanilla/{}/msgothic_2.dat", &chapter)) .arg(&directory_assets) .status() .expect("failed to execute TMPAssetConverter.py"); @@ -97,7 +113,7 @@ fn main() { println!(); // 4. copy assets - copy_files(format!("assets/vanilla/{}/{}/{}", chapter, platform, system).as_ref(), &directory_data); + copy_files(format!("assets/vanilla/{}/{}-{}", &chapter, &system, &unity).as_ref(), &directory_data); println!(); diff --git a/versions.sh b/versions.sh deleted file mode 100644 index b7ee2e3..0000000 --- a/versions.sh +++ /dev/null @@ -1,30 +0,0 @@ -echo -n "Onikakushi win: " -py ./scripts/AssetVersion.py ./assets/vanilla/onikakushi/steam/win -echo -n "Onikakushi unix: " -py ./scripts/AssetVersion.py ./assets/vanilla/onikakushi/steam/unix -echo -n "Watanagashi win: " -py ./scripts/AssetVersion.py ./assets/vanilla/watanagashi/steam/win -echo -n "Watanagashi unix: " -py ./scripts/AssetVersion.py ./assets/vanilla/watanagashi/steam/unix -echo -n "Tatarigoroshi win: " -py ./scripts/AssetVersion.py ./assets/vanilla/tatarigoroshi/steam/win -echo -n "Tatarigoroshi unix: " -py ./scripts/AssetVersion.py ./assets/vanilla/tatarigoroshi/steam/unix -echo -n "Tatarigoroshi win MG: " -py ./scripts/AssetVersion.py ./assets/vanilla/tatarigoroshi/mg/win -echo -n "Tatarigoroshi unix MG: " -py ./scripts/AssetVersion.py ./assets/vanilla/tatarigoroshi/mg/unix -echo -n "Himatsubushi win: " -py ./scripts/AssetVersion.py ./assets/vanilla/himatsubushi/steam/win -echo -n "Himatsubushi unix: " -py ./scripts/AssetVersion.py ./assets/vanilla/himatsubushi/steam/unix -echo -n "Meakashi win: " -py ./scripts/AssetVersion.py ./assets/vanilla/meakashi/steam/win -echo -n "Meakashi unix: " -py ./scripts/AssetVersion.py ./assets/vanilla/meakashi/steam/unix -echo -n "Meakashi win GOG: " -py ./scripts/AssetVersion.py ./assets/vanilla/meakashi/gog/win -echo -n "Tsumihoroboshi win: " -py ./scripts/AssetVersion.py ./assets/vanilla/tsumihoroboshi/steam/win -echo -n "Tsumihoroboshi unix: " -py ./scripts/AssetVersion.py ./assets/vanilla/tsumihoroboshi/steam/unix