change dinput arg type
This commit is contained in:
parent
ebd22415cd
commit
9b0b3e67a4
@ -40,7 +40,7 @@ struct Args {
|
||||
)]
|
||||
configure_input_profile: Option<String>,
|
||||
#[arg(long, help = "Use DirectInput when configuring a new input profile")]
|
||||
use_dinput: Option<bool>,
|
||||
use_dinput: bool,
|
||||
#[arg(
|
||||
long,
|
||||
value_name = "DEADZONE_PERCENTAGE",
|
||||
@ -199,7 +199,7 @@ async fn main() -> std::io::Result<()> {
|
||||
ui::input::configure_input_profile(
|
||||
&mut ui,
|
||||
profile,
|
||||
args.use_dinput.unwrap_or(false),
|
||||
args.use_dinput,
|
||||
args.deadzone.unwrap_or(ui::input::DEADZONE_DEFAULT),
|
||||
);
|
||||
return Ok(());
|
||||
|
||||
@ -216,19 +216,18 @@ fn controller_window(
|
||||
let deadzone = handle.get_deadzone();
|
||||
|
||||
tokio::spawn(async move {
|
||||
std::process::Command::new(std::env::current_exe().unwrap())
|
||||
.args([
|
||||
"--configure-input-profile",
|
||||
&profile_name,
|
||||
"--use-dinput",
|
||||
&dinput.to_string(),
|
||||
"--deadzone",
|
||||
&deadzone.to_string(),
|
||||
])
|
||||
.spawn()
|
||||
.unwrap()
|
||||
.wait()
|
||||
.unwrap();
|
||||
let mut command =
|
||||
std::process::Command::new(std::env::current_exe().unwrap());
|
||||
command.args([
|
||||
"--configure-input-profile",
|
||||
&profile_name,
|
||||
"--deadzone",
|
||||
&deadzone.to_string(),
|
||||
]);
|
||||
if dinput {
|
||||
command.arg("--use-dinput");
|
||||
}
|
||||
command.spawn().unwrap().wait().unwrap();
|
||||
let game_ui = ui::Ui::new();
|
||||
update_input_profiles(&weak_app, &game_ui.config);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user