diff --git a/src/command/pack.rs b/src/command/pack.rs index 47538e9..6f4cc2d 100644 --- a/src/command/pack.rs +++ b/src/command/pack.rs @@ -63,8 +63,10 @@ fn find_input(input: &Option) -> anyhow::Result { } fn pack_dat(art_key: &String, input: &PathBuf, output: &PathBuf) -> anyhow::Result<()> { + println!("Packing assets..."); let mut assets: Vec = Vec::new(); let mut asset_bytes: Vec = Vec::new(); + let mut count = 0; for file in WalkDir::new(input) { let file = file.unwrap(); @@ -81,10 +83,10 @@ fn pack_dat(art_key: &String, input: &PathBuf, output: &PathBuf) -> anyhow::Resu name = format!("assets/{}", name); } - println!("Packing asset: {} ({} bytes)", name, size); assets.push(AssetMetadata { name, size }); asset_bytes.extend_from_slice(&std::fs::read(path)?); + count += 1; } let header = haxeformat::to_string(&assets)?; @@ -100,8 +102,8 @@ fn pack_dat(art_key: &String, input: &PathBuf, output: &PathBuf) -> anyhow::Resu let enc_key = enc_key.as_slice(); crypto::encrypt(enc_key, out.as_mut_slice()); - println!("Packing assets to: {}...", output.display()); std::fs::write(output, out)?; + println!("Packed {} assets", count); Ok(()) } diff --git a/src/command/patch/assets_patcher.rs b/src/command/patch/assets_patcher.rs index dc52a3a..50cf75d 100644 --- a/src/command/patch/assets_patcher.rs +++ b/src/command/patch/assets_patcher.rs @@ -224,6 +224,6 @@ fn pack_to_assets(temp_dir: &PathBuf, game_dir: &PathBuf, repack: RepackInfo) -> } } - println!("Packed objects to: {}", output.display()); + println!("Packed {} objects", new_assets.content.objects.len()); Ok(()) } \ No newline at end of file diff --git a/src/command/patch/mod.rs b/src/command/patch/mod.rs index 9d3d3cb..6c1cb33 100644 --- a/src/command/patch/mod.rs +++ b/src/command/patch/mod.rs @@ -24,13 +24,11 @@ pub fn patch(args: &NewArgs, patch: &PathBuf, locale_mode: &I18nCompatMode) -> a let game_files = prepare_game_files(&args.game_dir)?; let temp_dir = create_temp_dir(); - println!("Using temp directory: {}", temp_dir.display()); let temp_unpacked = temp_dir.join("unpacked"); fs::create_dir_all(&temp_unpacked) .context("Failed to create temp directory")?; let repack_info = unpack::unpack_assets(args, &game_files.assets, &temp_unpacked)?; - patch_assets(patch, &temp_dir, &game_files.game_dir, repack_info)?; let patched_dir = patch_assets(patch, &temp_dir, &game_files.game_dir, repack_info)?; if locale_mode == &I18nCompatMode::Normal { diff --git a/src/command/revert.rs b/src/command/revert.rs index 03b7ede..c8d38a8 100644 --- a/src/command/revert.rs +++ b/src/command/revert.rs @@ -24,7 +24,7 @@ pub fn revert(game_dir: &PathBuf) -> anyhow::Result<()> { let locale_bak = game_dir.join("StreamingAssets/loc/en.zip-bak"); copy_backup(&locale, &locale_bak)?; - println!("Reverted game files in: {:?} to vanilla state", game_dir); + println!("Reverted game files to vanilla state"); Ok(()) } diff --git a/src/command/unpack.rs b/src/command/unpack.rs index 240ab06..44952d3 100644 --- a/src/command/unpack.rs +++ b/src/command/unpack.rs @@ -57,8 +57,7 @@ pub fn unpack_dat(args: &NewArgs, input: &PathBuf, output: &PathBuf) -> anyhow:: // Loop through assets in the data and write them to the output directory let mut index = len + 2; - for asset in assets { - println!("Unpacking asset: {} ({} bytes)", asset.name, asset.size); + for asset in &assets { let asset_bytes = &data[index..index + asset.size]; index += asset.size; @@ -75,6 +74,8 @@ pub fn unpack_dat(args: &NewArgs, input: &PathBuf, output: &PathBuf) -> anyhow:: .context(format!("Failed to write asset {} to file", asset.name))?; } + println!("Unpacked {} assets", assets.len()); + Ok(()) } diff --git a/src/crypto.rs b/src/crypto.rs index 6121324..6e36d6e 100644 --- a/src/crypto.rs +++ b/src/crypto.rs @@ -89,7 +89,7 @@ pub fn extract_key(args: &NewArgs) -> anyhow::Result { let mut key = [0; 16]; file.read_exact(&mut key)?; let key = String::from_utf8(key.to_vec())?; - println!("Extracted Art.dat decryption key from global metadata: {}", key); + println!("Extracted Art.dat decryption key from global metadata"); Ok(key) } \ No newline at end of file