Skip to content

Commit

Permalink
[CORE] Allow for multiple paths to trigger Outer Worlds dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Bwc9876 committed Jan 26, 2024
1 parent 11e8a7a commit 756b671
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions owmods_core/src/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ use tokio::process::Command;

use crate::{config::Config, constants::OWML_EXE_NAME, owml::OWMLConfig};

const OUTER_WORLDS_FOLDER_NAME: &str = "TOWSpacersChoice";
const OUTER_WORLDS_FOLDER_NAMES: [&str; 1] = ["TOWSpacersChoice"];

const OUTER_WORLDS_TEXT: &str = "You appear to be trying to mod The Outer Worlds. This mod manager is for Outer *Wilds*.
You probably want to uninstall this manager now,
but while you're here Outer Wilds is a great game and you should get it ::)
Then you can play all of our cool mods!
To stop this dialog from displaying please edit your game path in settings to not contain \"TOWSpacersChoice\".
To stop this dialog from displaying please edit your game path in settings to not point to an Outer Worlds install.
You can leave it blank to have OWML auto-detect it";

/// Launch the game using the given port for logs.
Expand Down Expand Up @@ -66,7 +66,10 @@ pub async fn launch_game(
.stderr(Stdio::piped());
// Sometimes OWML.Launcher.exe doesn't like setting the socket port, just do it ourselves.
let mut owml_config = OWMLConfig::get(config)?;
if owml_config.game_path.contains(OUTER_WORLDS_FOLDER_NAME) {
if OUTER_WORLDS_FOLDER_NAMES
.iter()
.any(|name| owml_config.game_path.contains(name))
{
return Err(anyhow!(OUTER_WORLDS_TEXT));
}
owml_config.socket_port = *port;
Expand Down

0 comments on commit 756b671

Please sign in to comment.