aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/src/stores/game.svelte.ts
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2026-01-16 20:56:27 +0800
committerGitHub <noreply@github.com>2026-01-16 20:56:27 +0800
commitfd4d01a629105d9405a6cecb2a1efd3ffa6a9334 (patch)
tree831d979118234ae8b1a2eebdfe7187c2ff966391 /ui/src/stores/game.svelte.ts
parent1119f6c3cf421da2f2db92873efae8135c76b678 (diff)
parentbb6cf77844343bbf55be3dad201340572564d132 (diff)
downloadDropOut-fd4d01a629105d9405a6cecb2a1efd3ffa6a9334.tar.gz
DropOut-fd4d01a629105d9405a6cecb2a1efd3ffa6a9334.zip
Merge pull request #55 from HsiangNianian/feat/Instance/Profile-System
Diffstat (limited to 'ui/src/stores/game.svelte.ts')
-rw-r--r--ui/src/stores/game.svelte.ts14
1 files changed, 12 insertions, 2 deletions
diff --git a/ui/src/stores/game.svelte.ts b/ui/src/stores/game.svelte.ts
index ca5dc2b..3efcf71 100644
--- a/ui/src/stores/game.svelte.ts
+++ b/ui/src/stores/game.svelte.ts
@@ -2,6 +2,7 @@ import { invoke } from "@tauri-apps/api/core";
import type { Version } from "../types";
import { uiState } from "./ui.svelte";
import { authState } from "./auth.svelte";
+import { instancesState } from "./instances.svelte";
export class GameState {
versions = $state<Version[]>([]);
@@ -34,10 +35,19 @@ export class GameState {
return;
}
+ if (!instancesState.activeInstanceId) {
+ alert("Please select an instance first!");
+ uiState.setView("instances");
+ return;
+ }
+
uiState.setStatus("Preparing to launch " + this.selectedVersion + "...");
- console.log("Invoking start_game for version:", this.selectedVersion);
+ console.log("Invoking start_game for version:", this.selectedVersion, "instance:", instancesState.activeInstanceId);
try {
- const msg = await invoke<string>("start_game", { versionId: this.selectedVersion });
+ const msg = await invoke<string>("start_game", {
+ instanceId: instancesState.activeInstanceId,
+ versionId: this.selectedVersion,
+ });
console.log("Response:", msg);
uiState.setStatus(msg);
} catch (e) {