From 43fd622322a3e1bbfdbb3e047ffb89bfb160b01c Mon Sep 17 00:00:00 2001 From: akanyan Date: Tue, 25 Feb 2025 02:01:24 +0100 Subject: [PATCH] feat: slightly better config --- rust/src/cmd.rs | 2 +- rust/src/profile.rs | 2 +- rust/src/start.rs | 2 +- src/components/App.vue | 48 +++++++++++---- src/components/Options.vue | 116 +++++++++++++++++++++++++++++++++---- src/stores.ts | 8 +-- src/types.ts | 2 +- 7 files changed, 150 insertions(+), 30 deletions(-) diff --git a/rust/src/cmd.rs b/rust/src/cmd.rs index 377ef2f..fc2dac1 100644 --- a/rust/src/cmd.rs +++ b/rust/src/cmd.rs @@ -139,7 +139,7 @@ pub async fn init_profile( pub async fn set_cfg( state: State<'_, Mutex>, key: String, - value: String + value: serde_json::Value ) -> Result<(), ()> { log::debug!("invoke: sync_cfg({}, {})", key, value); diff --git a/rust/src/profile.rs b/rust/src/profile.rs index e93408d..75187fe 100644 --- a/rust/src/profile.rs +++ b/rust/src/profile.rs @@ -14,7 +14,7 @@ pub struct Profile { pub mods: HashSet, pub wine_runtime: Option, pub wine_prefix: Option, - pub cfg: HashMap + pub cfg: HashMap } impl Profile { diff --git a/rust/src/start.rs b/rust/src/start.rs index 9e29496..e9c4b4b 100644 --- a/rust/src/start.rs +++ b/rust/src/start.rs @@ -57,7 +57,7 @@ pub fn start(p: &Profile, app: AppHandle) -> Result<()> { .stderr(Stdio::null()); if let Some(v) = p.cfg.get("intel") { - if v == "true" { + if v == true { amd_builder.env("OPENSSL_ia32cap", ":~0x20000000"); } } diff --git a/src/components/App.vue b/src/components/App.vue index 6a41253..13486b7 100644 --- a/src/components/App.vue +++ b/src/components/App.vue @@ -22,10 +22,10 @@ store.setupListeners(); const currentTab = ref('3'); const startEnabled = ref(false); -const loadProfile = async () => { +const loadProfile = async (openWindow: boolean) => { await store.reloadProfile(); - if (store.profile === null) { + if (store.profile === null && openWindow) { const exePath = await open({ multiple: false, directory: false, @@ -61,7 +61,7 @@ onOpenUrl((urls) => { }); onMounted(async () => { - await loadProfile(); + await loadProfile(false); }); listen('launch-end', () => { @@ -109,18 +109,44 @@ listen('launch-end', () => { - UNDER CONSTRUCTION

-