Skip to content

Commit c499094

Browse files
committed
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.
1 parent 98cb784 commit c499094

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

src-vue/src/plugins/store.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { invoke } from "@tauri-apps/api";
66
import { GameInstall } from "../utils/GameInstall";
77
import { ReleaseCanal } from "../utils/ReleaseCanal";
88
import { FlightCoreVersion } from "../../../src-tauri/bindings/FlightCoreVersion";
9+
import { LaunchOptions } from "../utils/LaunchOptions";
910
import { NotificationHandle } from 'element-plus';
1011
import { NorthstarState } from '../utils/NorthstarState';
1112
import { appDir } from '@tauri-apps/api/path';
@@ -172,7 +173,13 @@ export const store = createStore<FlightCoreStore>({
172173
}
173174
}
174175
},
175-
async launchGame(state: any, no_checks = false) {
176+
async launchGame(state: any, launch_options: LaunchOptions | null = null) {
177+
let no_checks = false;
178+
179+
if (launch_options != null) {
180+
no_checks = launch_options.no_checks;
181+
}
182+
176183
if (no_checks) {
177184
await invoke("launch_northstar", { gameInstall: state.game_install, bypassChecks: no_checks })
178185
.then((message) => {

src-vue/src/utils/LaunchOptions.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export interface LaunchOptions {
2+
no_checks: boolean,
3+
}

src-vue/src/views/DeveloperView.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@
136136
<script lang="ts">
137137
import { defineComponent } from "vue";
138138
import { invoke } from "@tauri-apps/api";
139+
import { LaunchOptions } from "../utils/LaunchOptions";
139140
import { TagWrapper } from "../../../src-tauri/bindings/TagWrapper";
140141
import { NorthstarThunderstoreReleaseWrapper } from "../../../src-tauri/bindings/NorthstarThunderstoreReleaseWrapper";
141142
import PullRequestsSelector from "../components/PullRequestsSelector.vue";
@@ -206,7 +207,8 @@ export default defineComponent({
206207
});
207208
},
208209
async launchGameWithoutChecks() {
209-
this.$store.commit('launchGame', true);
210+
let launch_options: LaunchOptions = { no_checks: true };
211+
this.$store.commit('launchGame', launch_options);
210212
},
211213
async launchGameViaSteam() {
212214
this.$store.commit('launchGameSteam', true);

0 commit comments

Comments
 (0)