Skip to content

Commit 50b9c1a

Browse files
authored
Merge pull request #237 from kcalbxof/cmd_arg_exe_path
Add cmd arg for noita exe path
2 parents f40b13a + a5c1b0c commit 50b9c1a

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

noita-proxy/src/bookkeeping/mod_manager.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ use crate::{
2121
steam_helper::SteamState,
2222
};
2323

24+
use crate::util::args::Args;
25+
2426
#[derive(Default)]
2527
enum State {
2628
#[default]
@@ -150,9 +152,16 @@ impl Modmanager {
150152
ui: &mut Ui,
151153
settings: &mut ModmanagerSettings,
152154
steam_state: Option<&mut SteamState>,
155+
args: &Args,
153156
) {
154157
if let State::JustStarted = self.state {
155-
if check_path_valid(&settings.game_exe_path) {
158+
if let Some(path) = &args.exe_path {
159+
if check_path_valid(path) {
160+
settings.game_exe_path = path.to_path_buf();
161+
info!("Path from command line is valid, checking mod now");
162+
self.state = State::PreCheckMod;
163+
}
164+
} else if check_path_valid(&settings.game_exe_path) {
156165
info!("Path is valid, checking mod now");
157166
self.state = State::PreCheckMod;
158167
} else {

noita-proxy/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,6 +1501,7 @@ impl eframe::App for App {
15011501
ui,
15021502
&mut self.modmanager_settings,
15031503
self.steam_state.as_mut().ok(),
1504+
&self.args,
15041505
)
15051506
});
15061507
if self.modmanager.is_done() {

noita-proxy/src/util/args.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,7 @@ pub struct Args {
2020
/// host either steam or ip.
2121
#[argh(option)]
2222
pub host: Option<String>,
23+
/// noita.exe path
24+
#[argh(option)]
25+
pub exe_path: Option<PathBuf>,
2326
}

0 commit comments

Comments
 (0)