Fix launch args setting

This commit is contained in:
Thoronium 2023-09-24 02:19:14 -06:00
parent 6d53f344ac
commit 5db28756d2
2 changed files with 15 additions and 4 deletions

View File

@ -28,6 +28,8 @@ pub struct Configuration {
pub auto_mongodb: Option<bool>,
pub un_elevated: Option<bool>,
pub redirect_more: Option<bool>,
pub launch_args: Option<String>,
pub offline_mode: Option<bool>,
}
pub fn config_path() -> PathBuf {

View File

@ -217,10 +217,19 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
args: config.launch_args,
})
} else {
await invoke('run_program_relative', {
path: exe || config.game_install_path,
args: config.launch_args,
})
if (config.launch_args.length < 1) {
// Run relative when there are no args
await invoke('run_program_relative', {
path: exe || config.game_install_path,
args: config.launch_args,
})
} else {
// Run directly when there are args
await invoke('run_program', {
path: exe || config.game_install_path,
args: config.launch_args,
})
}
}
else alert('Game not found! At: ' + (exe || config.game_install_path))
}