allow loading client args from config
This commit is contained in:
parent
73df20ebb6
commit
959c3a8a61
@ -23,6 +23,7 @@ pub fn save_value(config_path: PathBuf, key: &str, value: bool) {
|
|||||||
"skip_self_update" => config.skip_self_update = value,
|
"skip_self_update" => config.skip_self_update = value,
|
||||||
"download_bonus_content" => config.download_bonus_content = value,
|
"download_bonus_content" => config.download_bonus_content = value,
|
||||||
"ask_bonus_content" => config.ask_bonus_content = value,
|
"ask_bonus_content" => config.ask_bonus_content = value,
|
||||||
|
"force_update" => config.force_update = value,
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
save(config_path, config);
|
save(config_path, config);
|
||||||
|
@ -344,12 +344,13 @@ fn main() {
|
|||||||
arg_remove(&mut args, "-f");
|
arg_remove(&mut args, "-f");
|
||||||
}
|
}
|
||||||
|
|
||||||
let client_args: String;
|
|
||||||
if let Some(pass) = arg_value(&args, "--pass") {
|
if let Some(pass) = arg_value(&args, "--pass") {
|
||||||
client_args = pass;
|
cfg.args = pass;
|
||||||
arg_remove_value(&mut args, "--pass");
|
arg_remove_value(&mut args, "--pass");
|
||||||
} else {
|
} 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());
|
let games_json = http::get_body_string(format!("{}/games.json", MASTER).as_str());
|
||||||
@ -413,7 +414,7 @@ fn main() {
|
|||||||
cfg.force_update,
|
cfg.force_update,
|
||||||
);
|
);
|
||||||
if !cfg.update_only {
|
if !cfg.update_only {
|
||||||
launch(&install_path.join(format!("{}.exe", c)), &client_args);
|
launch(&install_path.join(format!("{}.exe", c)), &cfg.args);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ pub struct Config {
|
|||||||
pub download_bonus_content: bool,
|
pub download_bonus_content: bool,
|
||||||
pub ask_bonus_content: bool,
|
pub ask_bonus_content: bool,
|
||||||
pub force_update: bool,
|
pub force_update: bool,
|
||||||
|
pub args: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Config {
|
impl Default for Config {
|
||||||
@ -31,6 +32,7 @@ impl Default for Config {
|
|||||||
download_bonus_content: false,
|
download_bonus_content: false,
|
||||||
ask_bonus_content: true,
|
ask_bonus_content: true,
|
||||||
force_update: false,
|
force_update: false,
|
||||||
|
args: String::from(""),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user