fix theme list and add launching server with game

This commit is contained in:
SpikeHD
2022-06-05 21:40:16 -07:00
parent 8db8dd12e9
commit f5bb2b9bc5
2 changed files with 18 additions and 1 deletions

View File

@@ -104,6 +104,23 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
// Connect to proxy
await invoke('connect', { port: 8365, certificatePath: await dataDir() + '\\cultivation\\ca' })
// Open server as well if the options are set
if (config.grasscutter_with_game) {
let jarFolder = config.grasscutter_path
if (jarFolder.includes('/')) {
jarFolder = jarFolder.substring(0, config.grasscutter_path.lastIndexOf('/'))
} else {
jarFolder = jarFolder.substring(0, config.grasscutter_path.lastIndexOf('\\'))
}
await invoke('run_jar', {
path: config.grasscutter_path,
executeIn: jarFolder,
javaPath: config.java_path || ''
})
}
}
// Launch the program