mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-13 15:44:35 +01:00
fix theme list and add launching server with game
This commit is contained in:
@@ -104,6 +104,23 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
|||||||
|
|
||||||
// Connect to proxy
|
// Connect to proxy
|
||||||
await invoke('connect', { port: 8365, certificatePath: await dataDir() + '\\cultivation\\ca' })
|
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
|
// Launch the program
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ const defaultTheme = {
|
|||||||
export async function getThemeList() {
|
export async function getThemeList() {
|
||||||
// Do some invoke to backend to get the theme list
|
// Do some invoke to backend to get the theme list
|
||||||
const themes = await invoke('get_theme_list', {
|
const themes = await invoke('get_theme_list', {
|
||||||
data_dir: `${await dataDir()}/cultivation`
|
dataDir: `${await dataDir()}/cultivation`
|
||||||
}) as BackendThemeList[]
|
}) as BackendThemeList[]
|
||||||
const list: ThemeList[] = [
|
const list: ThemeList[] = [
|
||||||
// ALWAYS include default theme
|
// ALWAYS include default theme
|
||||||
|
|||||||
Reference in New Issue
Block a user