aboutsummaryrefslogtreecommitdiff
path: root/src-vue/src/plugins/store.ts
diff options
context:
space:
mode:
authorGeckoEidechse <gecko.eidechse+git@pm.me>2024-08-02 02:43:39 +0200
committerGeckoEidechse <gecko.eidechse+git@pm.me>2024-08-02 02:43:39 +0200
commit3362cd9b55021c1325fc573a90ee0be22497bdeb (patch)
tree0aa139cd452fcb8d9f6bc9c6baac21e852b09f52 /src-vue/src/plugins/store.ts
parente5a74818e79e78d0e065d9375f38fd17a3a591a9 (diff)
parentedbce33c4a8f142967df868fb99476400f4ddfb3 (diff)
downloadFlightCore-3362cd9b55021c1325fc573a90ee0be22497bdeb.tar.gz
FlightCore-3362cd9b55021c1325fc573a90ee0be22497bdeb.zip
Merge branch 'main' into chore/bump-upload-artifact-action
Diffstat (limited to 'src-vue/src/plugins/store.ts')
-rw-r--r--src-vue/src/plugins/store.ts22
1 files changed, 15 insertions, 7 deletions
diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts
index a1a67e2b..b61ac573 100644
--- a/src-vue/src/plugins/store.ts
+++ b/src-vue/src/plugins/store.ts
@@ -15,6 +15,7 @@ import { router } from "../main";
import { ReleaseInfo } from "../../../src-tauri/bindings/ReleaseInfo";
import { ThunderstoreMod } from "../../../src-tauri/bindings/ThunderstoreMod";
import { NorthstarMod } from "../../../src-tauri/bindings/NorthstarMod";
+import { NorthstarLaunchOptions } from "../../../src-tauri/bindings/NorthstarLaunchOptions"
import { searchModule } from './modules/search';
import { i18n } from '../main';
import { pullRequestModule } from './modules/pull_requests';
@@ -172,9 +173,10 @@ export const store = createStore<FlightCoreStore>({
}
}
},
- async launchGame(state: any, no_checks = false) {
- if (no_checks) {
- await invoke("launch_northstar", { gameInstall: state.game_install, bypassChecks: no_checks })
+ async launchGame(state: any, launch_options: NorthstarLaunchOptions = { launch_via_steam: false, bypass_checks: false}) {
+
+ if (launch_options.bypass_checks) {
+ await invoke("launch_northstar", { gameInstall: state.game_install, launchOptions: launch_options })
.then((message) => {
console.log("Launched with bypassed checks");
console.log(message);
@@ -224,7 +226,7 @@ export const store = createStore<FlightCoreStore>({
// Game is ready to play.
case NorthstarState.READY_TO_PLAY:
- await invoke("launch_northstar", { gameInstall: state.game_install })
+ await invoke("launch_northstar", { gameInstall: state.game_install, launchOptions: launch_options })
.then((message) => {
console.log(message);
// NorthstarState.RUNNING
@@ -240,8 +242,8 @@ export const store = createStore<FlightCoreStore>({
break;
}
},
- async launchGameSteam(state: any, no_checks = false) {
- await invoke("launch_northstar", { gameInstall: state.game_install, launchViaSteam: true, bypassChecks: no_checks })
+ async launchGameSteam(state: any, launch_options: NorthstarLaunchOptions = { launch_via_steam: true, bypass_checks: false}) {
+ await invoke("launch_northstar", { gameInstall: state.game_install, launchOptions: launch_options })
.then((message) => {
showNotification('Success');
})
@@ -254,7 +256,13 @@ export const store = createStore<FlightCoreStore>({
},
async fetchReleaseNotes(state: FlightCoreStore) {
if (state.releaseNotes.length !== 0) return;
- state.releaseNotes = await invoke("get_northstar_release_notes");
+ await invoke<ReleaseInfo[]>("get_northstar_release_notes")
+ .then((message) => {
+ state.releaseNotes = message;
+ })
+ .catch((error) => {
+ showErrorNotification(error);
+ });
},
async fetchThunderstoreMods(state: FlightCoreStore) {
// To check if some Thunderstore mods are already installed/outdated, we need to load locally-installed mods.