Skip to content

Commit

Permalink
refactor: Pass launch options via object
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
GeckoEidechse committed Jan 19, 2024
1 parent a6abfbb commit b00fbee
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src-vue/src/plugins/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -172,7 +173,13 @@ export const store = createStore<FlightCoreStore>({
}
}
},
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) => {
Expand Down
3 changes: 3 additions & 0 deletions src-vue/src/utils/LaunchOptions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface LaunchOptions {
no_checks: boolean,
}
4 changes: 3 additions & 1 deletion src-vue/src/views/DeveloperView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
<script lang="ts">
import { defineComponent } from "vue";
import { invoke } from "@tauri-apps/api";
import { LaunchOptions } from "../utils/LaunchOptions";
import { TagWrapper } from "../../../src-tauri/bindings/TagWrapper";
import { NorthstarThunderstoreReleaseWrapper } from "../../../src-tauri/bindings/NorthstarThunderstoreReleaseWrapper";
import PullRequestsSelector from "../components/PullRequestsSelector.vue";
Expand Down Expand Up @@ -206,7 +207,8 @@ export default defineComponent({
});
},
async launchGameWithoutChecks() {
this.$store.commit('launchGame', true);
let launch_options: LaunchOptions = { no_checks: true };
this.$store.commit('launchGame', launch_options);
},
async launchGameViaSteam() {
this.$store.commit('launchGameSteam', true);
Expand Down

0 comments on commit b00fbee

Please sign in to comment.