Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Pass launch options via object #760

Merged
merged 8 commits into from
Feb 21, 2024
12 changes: 2 additions & 10 deletions src-vue/src/plugins/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,7 @@ export const store = createStore<FlightCoreStore>({
}
}
},
async launchGame(state: any, no_checks = false) {
const launch_options: NorthstarLaunchOptions = {
launch_via_steam: false,
bypass_checks: 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 })
Expand Down Expand Up @@ -246,11 +242,7 @@ export const store = createStore<FlightCoreStore>({
break;
}
},
async launchGameSteam(state: any, no_checks = false) {
const launch_options: NorthstarLaunchOptions = {
launch_via_steam: true,
bypass_checks: false,
};
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');
Expand Down
7 changes: 5 additions & 2 deletions src-vue/src/views/DeveloperView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
<script lang="ts">
import { defineComponent } from "vue";
import { invoke } from "@tauri-apps/api";
import { NorthstarLaunchOptions } from "../../../src-tauri/bindings/NorthstarLaunchOptions";
import { TagWrapper } from "../../../src-tauri/bindings/TagWrapper";
import { NorthstarThunderstoreReleaseWrapper } from "../../../src-tauri/bindings/NorthstarThunderstoreReleaseWrapper";
import PullRequestsSelector from "../components/PullRequestsSelector.vue";
Expand Down Expand Up @@ -220,10 +221,12 @@ export default defineComponent({
});
},
async launchGameWithoutChecks() {
this.$store.commit('launchGame', true);
let launch_options: NorthstarLaunchOptions = { bypass_checks: true, launch_via_steam: false };
this.$store.commit('launchGame', launch_options);
},
async launchGameViaSteam() {
this.$store.commit('launchGameSteam', true);
let launch_options: NorthstarLaunchOptions = { bypass_checks: false, launch_via_steam: true };
this.$store.commit('launchGameSteam', launch_options);
},
async getInstalledMods() {
await invoke("get_installed_mods_and_properties", { gameInstall: this.$store.state.game_install }).then((message) => {
Expand Down
Loading