diff --git a/src-tauri/src/launcher.rs b/src-tauri/src/launcher.rs index 6dcab82..78c0a90 100644 --- a/src-tauri/src/launcher.rs +++ b/src-tauri/src/launcher.rs @@ -887,7 +887,10 @@ impl Launcher { // launch: `dev_engine` would quietly hand back the installed version, and the window // would go on saying the run came from the checkout. Being told the folder is wrong // while looking at it beats wondering later why an edit changed nothing. - if next.dev_mode { + // Only a folder that was NAMED is checked. Dev mode is switched on from the hub now, + // and the checkout is chosen next to the Launch button afterwards, so refusing the + // switch for an empty folder would refuse the first half of a two-step job. + if next.dev_mode && !next.dev_root.is_empty() { let build = PathBuf::from(&next.dev_root).join("ODIAN_Engine").join("tools").join("build").join("build.bat"); if !build.is_file() { return Err(format!("{} is not there: the dev folder is the one HOLDING ODIAN_Engine.", build.display())); diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index fa1a704..fbed0f1 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", "productName": "ODIAN Launcher", - "version": "0.1.36", + "version": "0.1.38", "identifier": "fr.odian.launcher", "build": { "frontendDist": "../dist", diff --git a/src/assets/keyart-dev.webp b/src/assets/keyart-dev.webp new file mode 100644 index 0000000..f22403b Binary files /dev/null and b/src/assets/keyart-dev.webp differ diff --git a/src/components/ActionPanel.svelte b/src/components/ActionPanel.svelte index 6f8f82b..0ce8afd 100644 --- a/src/components/ActionPanel.svelte +++ b/src/components/ActionPanel.svelte @@ -97,7 +97,24 @@ // Said out loud whenever this run is not the installed ODIAN. A dev client looks exactly // like the real one on screen, and mistaking the two is how a bug gets chased in the // wrong tree - or a demo gets given from an unbuilt branch. - const devRun = $derived((s?.dev ?? null) !== null && (launcher.settings?.dev_mode ?? false)); + const devOn = $derived(launcher.devOn); + const devRun = $derived(launcher.devReady); + const devRoot = $derived(launcher.settings?.dev_root ?? ""); + const devTarget = $derived(launcher.settings?.dev_target ?? "client"); + const devBuild = $derived(launcher.settings?.dev_build ?? false); + const savingDev = $derived(busy === "settings"); + // One stack either way: both clients talk to the same API and the same database, which is + // the only way a .exe/web divergence is visible at all. + const TARGETS = [ + { key: "client", name: "ODIAN", note: "Odian.exe" }, + { key: "web", name: "Web", note: ":5173" }, + { key: "both", name: "Both", note: "one stack" }, + ] as const; + + async function browseCheckout() { + const path = await launcher.pickFolder(); + if (path) await launcher.setDev({ dev_root: path }); + } // Named only when it is someone ELSE: running as yourself is not worth a warning. const devUser = $derived.by(() => { const asked = launcher.settings?.dev_user?.trim() ?? ""; @@ -221,16 +238,79 @@

{/if} - {#if devRun} -

- - - Dev mode: ODIAN runs from your checkout, not from the installed - {s?.installed ?? "version"}.{#if devUser} - Running as {devUser} — sync is off.{/if} - -

+ {#if devOn} + +
+
+ + DEV + + {devRun ? TARGETS.find((o) => o.key === devTarget)?.name ?? "" : "no checkout"} +
+ +
+ {#each TARGETS as option (option.key)} + + {/each} +
+ +
+ launcher.setDev({ dev_root: e.currentTarget.value.trim() })} + /> + +
+ +
+ + {#if s?.online} + + + + {:else} + offline — tiles and data stay as they are + {/if} +
+ + {#if !devRun} +

Name the folder that holds ODIAN_Engine and Launch runs from it.

+ {:else if devUser} +

+ Running as {devUser} — this PC will not sync with the DHP. +

+ {/if} +
{/if} + {#if unfinished}

@@ -376,6 +456,114 @@