Skip to content

Commit

Permalink
Merge pull request #237 from kcalbxof/cmd_arg_exe_path
Browse files Browse the repository at this point in the history
Add cmd arg for noita exe path
  • Loading branch information
IntQuant authored Nov 30, 2024
2 parents f40b13a + a5c1b0c commit 50b9c1a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
11 changes: 10 additions & 1 deletion noita-proxy/src/bookkeeping/mod_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ use crate::{
steam_helper::SteamState,
};

use crate::util::args::Args;

#[derive(Default)]
enum State {
#[default]
Expand Down Expand Up @@ -150,9 +152,16 @@ impl Modmanager {
ui: &mut Ui,
settings: &mut ModmanagerSettings,
steam_state: Option<&mut SteamState>,
args: &Args,
) {
if let State::JustStarted = self.state {
if check_path_valid(&settings.game_exe_path) {
if let Some(path) = &args.exe_path {
if check_path_valid(path) {
settings.game_exe_path = path.to_path_buf();
info!("Path from command line is valid, checking mod now");
self.state = State::PreCheckMod;
}
} else if check_path_valid(&settings.game_exe_path) {
info!("Path is valid, checking mod now");
self.state = State::PreCheckMod;
} else {
Expand Down
1 change: 1 addition & 0 deletions noita-proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,7 @@ impl eframe::App for App {
ui,
&mut self.modmanager_settings,
self.steam_state.as_mut().ok(),
&self.args,
)
});
if self.modmanager.is_done() {
Expand Down
3 changes: 3 additions & 0 deletions noita-proxy/src/util/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ pub struct Args {
/// host either steam or ip.
#[argh(option)]
pub host: Option<String>,
/// noita.exe path
#[argh(option)]
pub exe_path: Option<PathBuf>,
}

0 comments on commit 50b9c1a

Please sign in to comment.