diff --git a/src-tauri/src/config.rs b/src-tauri/src/config.rs index b793bef..3c806c4 100644 --- a/src-tauri/src/config.rs +++ b/src-tauri/src/config.rs @@ -28,6 +28,8 @@ pub struct Configuration { pub auto_mongodb: Option, pub un_elevated: Option, pub redirect_more: Option, + pub launch_args: Option, + pub offline_mode: Option, } pub fn config_path() -> PathBuf { diff --git a/src/ui/components/ServerLaunchSection.tsx b/src/ui/components/ServerLaunchSection.tsx index d315bfa..d1da316 100644 --- a/src/ui/components/ServerLaunchSection.tsx +++ b/src/ui/components/ServerLaunchSection.tsx @@ -217,10 +217,19 @@ export default class ServerLaunchSection extends React.Component 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)) }