From b00fbee7bd147f825e35a3de4c0b9aeedadac493 Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Fri, 19 Jan 2024 15:11:02 +0100 Subject: [PATCH 1/3] refactor: Pass launch options via object Currently object only has a single member for bypassing all checks. In the future this would be split up into multiple members for different checks to bypass as well as other options. --- src-vue/src/plugins/store.ts | 9 ++++++++- src-vue/src/utils/LaunchOptions.ts | 3 +++ src-vue/src/views/DeveloperView.vue | 4 +++- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 src-vue/src/utils/LaunchOptions.ts diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts index a1a67e2b8..f2f772df3 100644 --- a/src-vue/src/plugins/store.ts +++ b/src-vue/src/plugins/store.ts @@ -6,6 +6,7 @@ import { invoke } from "@tauri-apps/api"; import { GameInstall } from "../utils/GameInstall"; import { ReleaseCanal } from "../utils/ReleaseCanal"; import { FlightCoreVersion } from "../../../src-tauri/bindings/FlightCoreVersion"; +import { LaunchOptions } from "../utils/LaunchOptions"; import { NotificationHandle } from 'element-plus'; import { NorthstarState } from '../utils/NorthstarState'; import { appDir } from '@tauri-apps/api/path'; @@ -172,7 +173,13 @@ export const store = createStore({ } } }, - async launchGame(state: any, no_checks = false) { + async launchGame(state: any, launch_options: LaunchOptions | null = null) { + let no_checks = false; + + if (launch_options != null) { + no_checks = launch_options.no_checks; + } + if (no_checks) { await invoke("launch_northstar", { gameInstall: state.game_install, bypassChecks: no_checks }) .then((message) => { diff --git a/src-vue/src/utils/LaunchOptions.ts b/src-vue/src/utils/LaunchOptions.ts new file mode 100644 index 000000000..801dfaf97 --- /dev/null +++ b/src-vue/src/utils/LaunchOptions.ts @@ -0,0 +1,3 @@ +export interface LaunchOptions { + no_checks: boolean, +} diff --git a/src-vue/src/views/DeveloperView.vue b/src-vue/src/views/DeveloperView.vue index aa586e6ee..5e835b3e5 100644 --- a/src-vue/src/views/DeveloperView.vue +++ b/src-vue/src/views/DeveloperView.vue @@ -136,6 +136,7 @@