From 7ea31c7a87c51d8c7391f5a1402b5c1003728cf5 Mon Sep 17 00:00:00 2001 From: akanyan Date: Sun, 13 Apr 2025 21:02:04 +0000 Subject: [PATCH] fix: misc fixes for 0.6.0 --- rust/src/pkg.rs | 5 +++++ rust/src/pkg_store.rs | 4 ++++ src/components/App.vue | 40 +++++++++++++++++++--------------------- src/stores.ts | 7 +++++++ 4 files changed, 35 insertions(+), 21 deletions(-) diff --git a/rust/src/pkg.rs b/rust/src/pkg.rs index cfb6131..2c4d9ea 100644 --- a/rust/src/pkg.rs +++ b/rust/src/pkg.rs @@ -255,6 +255,11 @@ impl Package { flags |= Feature::Mod; game_dll = Some(path.to_owned()); } + if let Some(serde_json::Value::String(path)) = installer.get("dll_game") { + flags |= Feature::GameDLL; + flags |= Feature::Mod; + game_dll = Some(path.to_owned()); + } if let Some(serde_json::Value::String(path)) = installer.get("dll-amdaemon") { flags |= Feature::AmdDLL; flags |= Feature::Mod; diff --git a/rust/src/pkg_store.rs b/rust/src/pkg_store.rs index 213e8a1..f420258 100644 --- a/rust/src/pkg_store.rs +++ b/rust/src/pkg_store.rs @@ -299,6 +299,10 @@ impl PackageStore { Self::clean_up_file(&path, "manifest.json", true).await?; Self::clean_up_file(&path, "README.md", true).await?; Self::clean_up_file(&path, "post_load.ps1", false).await?; + // todo search for the proper dll + Self::clean_up_file(&path, "saekawa.dll", false).await?; + Self::clean_up_file(&path, "mempatcher32.dll", false).await?; + Self::clean_up_file(&path, "mempatcher64.dll", false).await?; tokio::fs::remove_dir(path.as_ref()) .await diff --git a/src/components/App.vue b/src/components/App.vue index 51a20e0..a458e51 100644 --- a/src/components/App.vue +++ b/src/components/App.vue @@ -67,26 +67,14 @@ onMounted(async () => { } fetch_promise.then(async () => { - const promises = []; - promises.push( - invoke('install_package', { - key: 'segatools-mu3hook', - force: false, - }) - ); - promises.push( - invoke('install_package', { - key: 'segatools-chusanhook', - force: false, - }) - ); - promises.push( - invoke('install_package', { - key: 'mempatcher-mempatcher', - force: false, - }) - ); - await Promise.all(promises); + await invoke('install_package', { + key: 'segatools-mu3hook', + force: false, + }); + await invoke('install_package', { + key: 'segatools-chusanhook', + force: false, + }); }); }); @@ -268,7 +256,17 @@ listen<{ message: string; header: string }>('invoke-error', (event) => { - + +
+ Patches require mempatcher to be installed + and enabled. +
diff --git a/src/stores.ts b/src/stores.ts index a3df409..8af739d 100644 --- a/src/stores.ts +++ b/src/stores.ts @@ -222,6 +222,12 @@ export const usePrfStore = defineStore('prf', () => { current.value?.data.mods.includes(pkgKey(pkg)) ); + const isPkgKeyEnabled = (pkg: string) => + computed( + () => + current.value !== null && current.value?.data.mods.includes(pkg) + ); + const reload = async () => { const p = (await invoke('get_current_profile')) as Profile; current.value = p; @@ -322,6 +328,7 @@ export const usePrfStore = defineStore('prf', () => { current, list, isPkgEnabled, + isPkgKeyEnabled, reload, create, rename,