diff --git a/applyemip.sh b/applyemip.sh deleted file mode 100644 index 119963b..0000000 --- a/applyemip.sh +++ /dev/null @@ -1,2 +0,0 @@ -AssetBundleExtractor.exe applyemip output/onikakushi-win.emip output -exit $? diff --git a/compileall.sh b/compileall.sh index 544eab6..72bbffb 100644 --- a/compileall.sh +++ b/compileall.sh @@ -1,14 +1,15 @@ -cargo run onikakushi win -cargo run onikakushi mac -cargo run watanagashi win -cargo run watanagashi mac -cargo run tatarigoroshi win -cargo run tatarigoroshi mac -cargo run tatarigoroshi win-mg -cargo run tatarigoroshi mac-mg -cargo run himatsubushi win -cargo run himatsubushi mac -cargo run meakashi win -cargo run meakashi mac -cargo run tsumihoroboshi win -cargo run tsumihoroboshi mac +cargo run onikakushi steam win +cargo run onikakushi steam mac +cargo run watanagashi steam win +cargo run watanagashi steam mac +cargo run tatarigoroshi steam win +cargo run tatarigoroshi steam mac +cargo run tatarigoroshi mg win +cargo run tatarigoroshi mg mac +cargo run himatsubushi steam win +cargo run himatsubushi steam mac +cargo run meakashi steam win +cargo run meakashi steam mac +cargo run meakashi gog win +cargo run tsumihoroboshi steam win +cargo run tsumihoroboshi steam mac diff --git a/scripts/AssetVersion.py b/scripts/AssetVersion.py new file mode 100644 index 0000000..76c678b --- /dev/null +++ b/scripts/AssetVersion.py @@ -0,0 +1,12 @@ +import os +from sys import argv + +path = 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") + print(unityVersion) +else: + print("Nothing found") diff --git a/src/main.rs b/src/main.rs index 0da02b8..cfa9088 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,6 +12,7 @@ fn main() { let args: Vec = env::args().collect(); let chapter = &args[1]; let platform = &args[2]; + let system = &args[3]; let mut chapters = HashMap::new(); chapters.insert("onikakushi".to_string(), 1); @@ -26,28 +27,13 @@ fn main() { process::exit(1); } - let mut suffixes = HashMap::new(); - suffixes.insert("win".to_string(), "UI"); - suffixes.insert("mac".to_string(), "UI_UNIX"); - - if chapter == "tatarigoroshi" { - suffixes.insert("win-mg".to_string(), "UI_MG"); - suffixes.insert("mac-mg".to_string(), "UI_UNIX-MG"); - } - - if !suffixes.contains_key(platform) { - println!("Unknown platform"); - process::exit(2); - } - - let distributor = if platform == "win-mg" || platform == "mac-mg" { "mg" } else { "steam" }; 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, distributor, platform); + let assets = format!("assets/vanilla/{}/{}/{}/sharedassets0.assets", chapter, platform, system); let directory_assets = "output/assets"; let directory_data = format!("output/HigurashiEp{:02}_Data", arc_number); - let emip = format!("{}/{}-{}.emip", &directory_data, &chapter, &platform); - let archive = format!("{}-{}.7z", &chapter.to_title_case(), suffixes.get(platform).unwrap()); + let emip = format!("{}/{}_{}_{}.emip", &directory_data, &chapter, &platform, &system); + let archive = format!("{}_{}_{}.7z", &chapter.to_title_case(), &platform, &system); if Path::new(&emip).exists() { fs::remove_file(&emip).expect("Failed to remove file"); @@ -89,7 +75,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, distributor)) + .arg(format!("assets/vanilla/{}/{}/msgothic_0.dat", &chapter, platform)) .arg(&directory_assets) .status() .expect("failed to execute TMPAssetConverter.py"); @@ -101,7 +87,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, distributor)) + .arg(format!("assets/vanilla/{}/{}/msgothic_2.dat", &chapter, platform)) .arg(&directory_assets) .status() .expect("failed to execute TMPAssetConverter.py"); @@ -111,7 +97,7 @@ fn main() { println!(); // 4. copy assets - copy_files(format!("assets/vanilla/{}/{}/{}", chapter, distributor, platform).as_ref(), &directory_data); + copy_files(format!("assets/vanilla/{}/{}/{}", chapter, platform, system).as_ref(), &directory_data); println!(); diff --git a/versions.sh b/versions.sh new file mode 100644 index 0000000..2d0eb94 --- /dev/null +++ b/versions.sh @@ -0,0 +1,30 @@ +echo -n "Onikakushi win: " +py ./scripts/AssetVersion.py ./assets/vanilla/onikakushi/steam/win +echo -n "Onikakushi mac: " +py ./scripts/AssetVersion.py ./assets/vanilla/onikakushi/steam/mac +echo -n "Watanagashi win: " +py ./scripts/AssetVersion.py ./assets/vanilla/watanagashi/steam/win +echo -n "Watanagashi mac: " +py ./scripts/AssetVersion.py ./assets/vanilla/watanagashi/steam/mac +echo -n "Tatarigoroshi win: " +py ./scripts/AssetVersion.py ./assets/vanilla/tatarigoroshi/steam/win +echo -n "Tatarigoroshi mac: " +py ./scripts/AssetVersion.py ./assets/vanilla/tatarigoroshi/steam/mac +echo -n "Tatarigoroshi win MG: " +py ./scripts/AssetVersion.py ./assets/vanilla/tatarigoroshi/mg/win +echo -n "Tatarigoroshi mac MG: " +py ./scripts/AssetVersion.py ./assets/vanilla/tatarigoroshi/mg/mac +echo -n "Himatsubushi win: " +py ./scripts/AssetVersion.py ./assets/vanilla/himatsubushi/steam/win +echo -n "Himatsubushi mac: " +py ./scripts/AssetVersion.py ./assets/vanilla/himatsubushi/steam/mac +echo -n "Meakashi win: " +py ./scripts/AssetVersion.py ./assets/vanilla/meakashi/steam/win +echo -n "Meakashi mac: " +py ./scripts/AssetVersion.py ./assets/vanilla/meakashi/steam/mac +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 mac: " +py ./scripts/AssetVersion.py ./assets/vanilla/tsumihoroboshi/steam/mac