mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-18 22:53:16 +00:00
Merge pull request #237 from kcalbxof/cmd_arg_exe_path
Add cmd arg for noita exe path
This commit is contained in:
commit
50b9c1ad46
3 changed files with 14 additions and 1 deletions
|
@ -21,6 +21,8 @@ use crate::{
|
|||
steam_helper::SteamState,
|
||||
};
|
||||
|
||||
use crate::util::args::Args;
|
||||
|
||||
#[derive(Default)]
|
||||
enum State {
|
||||
#[default]
|
||||
|
@ -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 {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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>,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue