diff --git a/Cargo.lock b/Cargo.lock index b85efc5..9fb55e7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -110,7 +110,7 @@ dependencies = [ "anyhow", "binrw", "bitflags 2.6.0", - "destiny-pkg", + "destiny-pkg 0.11.0", "glam", "rayon", "rustc-hash 2.0.0", @@ -123,7 +123,7 @@ version = "0.1.0" source = "git+https://github.com/cohaereo/alkahest.git#cb44e9102339f374eb739dd9fea5054cd0910e65" dependencies = [ "anyhow", - "destiny-pkg", + "destiny-pkg 0.11.0", "lazy_static", "parking_lot", ] @@ -1004,6 +1004,32 @@ name = "destiny-pkg" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e38129da4d312e83c0c22bc48d2c83358687ea5d8d8e19634d5bbfe2e6a2e09" +dependencies = [ + "aes", + "aes-gcm", + "anyhow", + "binrw", + "clap", + "clap-num", + "ddsfile", + "hex", + "itertools 0.13.0", + "json", + "lazy_static", + "libloading 0.8.4", + "parking_lot", + "rayon", + "rustc-hash 1.1.0", + "serde", + "serde_json", + "tracing", +] + +[[package]] +name = "destiny-pkg" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6431bc288b2d38f51ba097bd3f07f9976399be52f7928da5163ba8b1409cd902" dependencies = [ "aes", "aes-gcm", @@ -2704,7 +2730,7 @@ dependencies = [ "chrono", "clap", "clipboard-win", - "destiny-pkg", + "destiny-pkg 0.12.0", "eframe", "egui-notify", "egui_extras", @@ -3203,7 +3229,7 @@ version = "0.1.12" source = "git+https://github.com/v4nguard/tiger-parse#742a1fed5c4210686a64711a63c119dbef9841b6" dependencies = [ "anyhow", - "destiny-pkg", + "destiny-pkg 0.11.0", "glam", "tiger-parse-derive", "tracing", diff --git a/Cargo.toml b/Cargo.toml index a5ebd95..4f3b32c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,7 +39,7 @@ rayon = "1.8.0" base64 = "0.22.0" bincode = "2.0.0-rc.3" binrw = "0.13.3" -destiny-pkg = { version = "0.11", features = ["bincode"] } +destiny-pkg = { version = "0.12", features = ["bincode"] } serde = { version = "1.0.188", features = ["derive"] } serde_json = "1.0.108" vgmstream = { git = "https://github.com/cohaereo/vgmstream-rs/", version = "0.1.3" } diff --git a/src/gui/mod.rs b/src/gui/mod.rs index f9db3f3..e73b5f6 100644 --- a/src/gui/mod.rs +++ b/src/gui/mod.rs @@ -93,7 +93,7 @@ pub struct QuickTagApp { impl QuickTagApp { /// Called once before the first frame. - pub fn new(cc: &eframe::CreationContext<'_>, version: GameVersion) -> Self { + pub fn new(cc: &eframe::CreationContext<'_>) -> Self { let mut fonts = egui::FontDefinitions::default(); fonts.font_data.insert( "Destiny_Keys".into(), @@ -115,7 +115,7 @@ impl QuickTagApp { scanner_context: scanner::create_scanner_context(&package_manager()) .expect("Failed to create scanner context"), cache_load: Some(Promise::spawn_thread("load_cache", move || { - load_tag_cache(version) + load_tag_cache() })), tag_history: Rc::new(RefCell::new(TagHistory::default())), cache: Default::default(), diff --git a/src/gui/tag.rs b/src/gui/tag.rs index 1996350..1edd8c1 100644 --- a/src/gui/tag.rs +++ b/src/gui/tag.rs @@ -652,7 +652,7 @@ impl TagView { .package_paths .get(&tag.pkg_id()) .map(|p| { - p.name + p.filename .to_lowercase() .contains(&self.search_package_name_filter.to_lowercase()) }) diff --git a/src/gui/texture.rs b/src/gui/texture.rs index 9c8dfb2..46338ec 100644 --- a/src/gui/texture.rs +++ b/src/gui/texture.rs @@ -294,7 +294,7 @@ impl Texture { if package_manager().version.is_d1() && !matches!( package_manager().platform, - PackagePlatform::PS4 | PackagePlatform::XOne + PackagePlatform::PS4 | PackagePlatform::XboxOne ) { anyhow::bail!("Textures are not supported for D1"); @@ -313,7 +313,7 @@ impl Texture { premultiply_alpha: false, }) } - PackagePlatform::XOne => { + PackagePlatform::XboxOne => { let texture: TextureHeaderRoiXbox = package_manager().read_tag_binrw(hash)?; Ok(TextureDesc { format: texture.format.to_wgpu()?, @@ -364,7 +364,7 @@ impl Texture { if package_manager().version.is_d1() && !matches!( package_manager().platform, - PackagePlatform::PS4 | PackagePlatform::XOne + PackagePlatform::PS4 | PackagePlatform::XboxOne ) { anyhow::bail!("Textures are not supported for D1"); @@ -389,7 +389,7 @@ impl Texture { Some(comment), ) } - PackagePlatform::XOne => { + PackagePlatform::XboxOne => { anyhow::bail!("Xbox One textures are not supported yet"); let (texture, texture_data, comment) = Self::load_data_roi_xone(hash, true)?; Self::create_texture( diff --git a/src/main.rs b/src/main.rs index d006082..c34f1e8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -66,6 +66,7 @@ fn main() -> eframe::Result<()> { let pm = PackageManager::new( packages_path, args.version.unwrap_or(GameVersion::Destiny2TheFinalShape), + None ) .unwrap(); @@ -98,7 +99,7 @@ fn main() -> eframe::Result<()> { eframe::run_native( "Quicktag", native_options, - Box::new(|cc| Ok(Box::new(QuickTagApp::new(cc, package_manager().version)))), + Box::new(|cc| Ok(Box::new(QuickTagApp::new(cc)))), ) } diff --git a/src/scanner.rs b/src/scanner.rs index 87ac2d3..35e3896 100644 --- a/src/scanner.rs +++ b/src/scanner.rs @@ -292,8 +292,8 @@ pub fn scanner_progress() -> ScanStatus { *SCANNER_PROGRESS.read() } -pub fn load_tag_cache(version: GameVersion) -> TagCache { - let cache_name = format!("tags_{}.cache", version.id()); +pub fn load_tag_cache() -> TagCache { + let cache_name = format!("tags_{}.cache", package_manager().cache_key()); let cache_file_path = exe_relative_path(&cache_name); if let Ok(cache_file) = File::open(&cache_file_path) { @@ -388,6 +388,7 @@ pub fn load_tag_cache(version: GameVersion) -> TagCache { .cloned() .collect_vec(); + let version = package_manager().version; let package_count = all_pkgs.len(); let cache: FxHashMap = all_pkgs .par_iter()