mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2026-02-05 17:56:53 +01:00
Merge pull request #204 from NotThorny/Fix-SettingsArgs
Fix args in settings
This commit is contained in:
@@ -28,6 +28,8 @@ pub struct Configuration {
|
|||||||
pub auto_mongodb: Option<bool>,
|
pub auto_mongodb: Option<bool>,
|
||||||
pub un_elevated: Option<bool>,
|
pub un_elevated: Option<bool>,
|
||||||
pub redirect_more: Option<bool>,
|
pub redirect_more: Option<bool>,
|
||||||
|
pub launch_args: Option<String>,
|
||||||
|
pub offline_mode: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn config_path() -> PathBuf {
|
pub fn config_path() -> PathBuf {
|
||||||
|
|||||||
@@ -217,10 +217,16 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
|||||||
args: config.launch_args,
|
args: config.launch_args,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
await invoke('run_program_relative', {
|
if (config.launch_args.length < 1) {
|
||||||
path: exe || config.game_install_path,
|
// Run relative when there are no args
|
||||||
args: config.launch_args,
|
await invoke('run_program_relative', { path: exe || config.game_install_path })
|
||||||
})
|
} 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))
|
else alert('Game not found! At: ' + (exe || config.game_install_path))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user