diff --git a/src/config.rs b/src/config.rs index 2c3fed2..7664c2e 100644 --- a/src/config.rs +++ b/src/config.rs @@ -23,6 +23,7 @@ pub fn save_value(config_path: PathBuf, key: &str, value: bool) { "skip_self_update" => config.skip_self_update = value, "download_bonus_content" => config.download_bonus_content = value, "ask_bonus_content" => config.ask_bonus_content = value, + "force_update" => config.force_update = value, _ => (), } save(config_path, config); diff --git a/src/main.rs b/src/main.rs index 965b646..b6dec7a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -344,12 +344,13 @@ fn main() { arg_remove(&mut args, "-f"); } - let client_args: String; if let Some(pass) = arg_value(&args, "--pass") { - client_args = pass; + cfg.args = pass; arg_remove_value(&mut args, "--pass"); } else { - client_args = String::new(); + if cfg.args.is_empty() { + cfg.args = String::from(""); + } } let games_json = http::get_body_string(format!("{}/games.json", MASTER).as_str()); @@ -413,7 +414,7 @@ fn main() { cfg.force_update, ); if !cfg.update_only { - launch(&install_path.join(format!("{}.exe", c)), &client_args); + launch(&install_path.join(format!("{}.exe", c)), &cfg.args); } return; } diff --git a/src/structs.rs b/src/structs.rs index 5c37262..f2f0b97 100644 --- a/src/structs.rs +++ b/src/structs.rs @@ -21,6 +21,7 @@ pub struct Config { pub download_bonus_content: bool, pub ask_bonus_content: bool, pub force_update: bool, + pub args: String, } impl Default for Config { @@ -31,6 +32,7 @@ impl Default for Config { download_bonus_content: false, ask_bonus_content: true, force_update: false, + args: String::from(""), } } }