Skip to content

Commit

Permalink
Allow ProtonGE to be used as a compatibility tool (#533)
Browse files Browse the repository at this point in the history
* Allow ProtonGE to be used as a compatibility tool

* Use constant list to track valid Proton builds

* Fixed formatting

* Update to doc comments
  • Loading branch information
Ombrezz authored Sep 18, 2023
1 parent f3c749f commit a0e6fcc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 4 additions & 0 deletions src-tauri/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@ pub const NORTHSTAR_DLL: &str = "Northstar.dll";

/// Profile that Northstar defaults to and ships with
pub const NORTHSTAR_DEFAULT_PROFILE: &str = "R2Northstar";

/// List of valid compatibility tools that Northstar can be launched with
pub const VALID_NORTHSTAR_PROTON_BUILDS: [&str; 3] =
["NorthstarProton-8.1-1", "GE-Proton8-13", "GE-Proton8-11"];
12 changes: 4 additions & 8 deletions src-tauri/src/northstar/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub mod profile;

use crate::util::check_ea_app_or_origin_running;
use crate::{
constants::{CORE_MODS, TITANFALL2_STEAM_ID},
constants::{CORE_MODS, TITANFALL2_STEAM_ID, VALID_NORTHSTAR_PROTON_BUILDS},
get_host_os, GameInstall, InstallType,
};
use anyhow::anyhow;
Expand Down Expand Up @@ -145,15 +145,11 @@ pub fn launch_northstar_steam(
let titanfall2_steamid: u32 = TITANFALL2_STEAM_ID.parse().unwrap();
match steamdir.compat_tool(&titanfall2_steamid) {
Some(compat) => {
if !compat
.name
.clone()
.unwrap()
.to_ascii_lowercase()
.contains("northstarproton")
if !VALID_NORTHSTAR_PROTON_BUILDS
.contains(&compat.clone().name.unwrap().as_str())
{
return Err(
"Titanfall2 was not configured to use NorthstarProton".to_string()
"Titanfall2 was not configured to use a valid version of NorthstarProton or GE-Proton".to_string(),
);
}
}
Expand Down

0 comments on commit a0e6fcc

Please sign in to comment.