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

feat: Launch options dev UI #805

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
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
25 changes: 18 additions & 7 deletions src-vue/src/views/DeveloperView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@

<h3>Testing:</h3>

<el-button type="primary" @click="launchGameWithoutChecks">
Launch Northstar (bypass all checks)
</el-button>
<el-checkbox v-model="launchNorthstarBypassChecks" label="Bypass all checks" />
<el-checkbox v-model="launchNorthstarViaSteam" label="Launch via Steam" />

<el-button type="primary" @click="launchGameViaSteam">
Launch Northstar via Steam
<el-button type="primary" @click="launchNorthstarWithOptions">
Launch Northstar with options
</el-button>

<br />

<el-button type="primary" @click="installLauncherGitMain">
Install launcher from main branch
</el-button>
Expand Down Expand Up @@ -149,6 +150,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 All @@ -167,6 +169,8 @@ export default defineComponent({
discord_release_announcement_text: "",
first_tag: { label: '', value: { name: '' } },
second_tag: { label: '', value: { name: '' } },
launchNorthstarBypassChecks: true,
launchNorthstarViaSteam: false,
ns_release_tags: [] as TagWrapper[],
ns_versions: [] as NorthstarThunderstoreReleaseWrapper[],
selected_ns_version: { label: '', value: { package: '', version: '' } } as NorthstarThunderstoreReleaseWrapper,
Expand Down Expand Up @@ -219,11 +223,18 @@ export default defineComponent({
console.error(error);
});
},
async launchNorthstarWithOptions() {
let launch_options: NorthstarLaunchOptions = { bypass_checks: this.launchNorthstarBypassChecks, launch_via_steam: this.launchNorthstarViaSteam };
this.$store.commit('launchGame', launch_options);
},
// todo, remove the two below
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