aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src-tauri/src/lib.rs35
-rw-r--r--src-tauri/src/main.rs7
-rw-r--r--src-vue/src/plugins/store.ts26
-rw-r--r--src-vue/src/views/DeveloperView.vue6
4 files changed, 54 insertions, 20 deletions
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index fbef3bac..bfac47c7 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -232,12 +232,31 @@ pub fn get_host_os() -> String {
env::consts::OS.to_string()
}
-pub fn launch_northstar(game_install: GameInstall) -> Result<String, String> {
+pub fn launch_northstar(
+ game_install: GameInstall,
+ bypass_checks: Option<bool>,
+) -> Result<String, String> {
dbg!(game_install.clone());
- // Some safety checks before, should have more in the future
- if get_northstar_version_number(game_install.game_path.clone()).is_err() {
- return Err(anyhow!("Not all checks were met").to_string());
+ let bypass_checks = match bypass_checks {
+ Some(bypass_checks) => bypass_checks,
+ None => false,
+ };
+
+ // Only check guards if bypassing checks is not enabled
+ if !bypass_checks {
+ // Some safety checks before, should have more in the future
+ if get_northstar_version_number(game_install.game_path.clone()).is_err() {
+ return Err(anyhow!("Not all checks were met").to_string());
+ }
+
+ // Require Origin to be running to launch Northstar
+ let origin_is_running = check_origin_running();
+ if !origin_is_running {
+ return Err(
+ anyhow!("Origin not running, start Origin before launching Northstar").to_string(),
+ );
+ }
}
let host_os = get_host_os();
@@ -262,14 +281,6 @@ pub fn launch_northstar(game_install: GameInstall) -> Result<String, String> {
return Err(anyhow!("Couldn't access Titanfall2 directory").to_string());
}
- // Require Origin to be running to launch Northstar
- let origin_is_running = check_origin_running();
- if !origin_is_running {
- return Err(
- anyhow!("Origin not running, start Origin before launching Northstar").to_string(),
- );
- }
-
// Only Windows with Steam or Origin are supported at the moment
if host_os == "windows"
&& (matches!(game_install.install_type, InstallType::STEAM)
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index d775d978..8947d743 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -266,8 +266,11 @@ async fn update_northstar_caller(
#[tauri::command]
/// Launches Northstar
-async fn launch_northstar_caller(game_install: GameInstall) -> Result<String, String> {
- launch_northstar(game_install)
+async fn launch_northstar_caller(
+ game_install: GameInstall,
+ bypass_checks: Option<bool>,
+) -> Result<String, String> {
+ launch_northstar(game_install, bypass_checks)
}
#[tauri::command]
diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts
index 11240ea6..2d7df80c 100644
--- a/src-vue/src/plugins/store.ts
+++ b/src-vue/src/plugins/store.ts
@@ -135,7 +135,26 @@ export const store = createStore<FlightCoreStore>({
}
}
},
- async launchGame(state: any) {
+ async launchGame(state: any, no_checks = false) {
+ let game_install = {
+ game_path: state.game_path,
+ install_type: state.install_type
+ } as GameInstall;
+
+ if (no_checks) {
+ await invoke("launch_northstar_caller", { gameInstall: game_install, bypassChecks: no_checks })
+ .then((message) => {
+ console.log("Launched with bypassed checks");
+ console.log(message);
+ })
+ .catch((error) => {
+ console.error(error);
+ alert(error);
+ });
+
+ return;
+ }
+
// TODO update installation if release track was switched
switch (state.northstar_state) {
// Install northstar if it wasn't detected.
@@ -185,11 +204,6 @@ export const store = createStore<FlightCoreStore>({
// If Origin isn't running, end here
return;
}
-
- let game_install = {
- game_path: state.game_path,
- install_type: state.install_type
- } as GameInstall;
await invoke("launch_northstar_caller", { gameInstall: game_install })
.then((message) => {
console.log(message);
diff --git a/src-vue/src/views/DeveloperView.vue b/src-vue/src/views/DeveloperView.vue
index 780dc2ea..3622a596 100644
--- a/src-vue/src/views/DeveloperView.vue
+++ b/src-vue/src/views/DeveloperView.vue
@@ -22,6 +22,9 @@
Toggle Release Candidate
</el-button>
+ <el-button type="primary" @click="launchGameWithoutChecks">
+ Launch Northstar (bypass all checks)
+ </el-button>
<h3>Mod install:</h3>
@@ -122,6 +125,9 @@ export default defineComponent({
position: 'bottom-right'
});
},
+ async launchGameWithoutChecks() {
+ this.$store.commit('launchGame', true);
+ },
async disableAllModsButCore() {
let game_install = {
game_path: this.$store.state.game_path,