diff --git a/src-tauri/lang/en.json b/src-tauri/lang/en.json index 052f13d..854a73c 100644 --- a/src-tauri/lang/en.json +++ b/src-tauri/lang/en.json @@ -57,5 +57,8 @@ "gc_stable_data": "Download the current stable Grasscutter data files, which does not come with a jar file. This is useful for updating.", "gc_dev_data": "Download the latest development Grasscutter data files, which does not come with a jar file. This is useful for updating.", "resources": "These are also required to run a Grasscutter server. This button will be grey if you have an existing resources folder with contents inside" + }, + "swag": { + "akebi": "Set Akebi Executable" } } \ No newline at end of file diff --git a/src/resources/icons/akebi_trans.svg b/src/resources/icons/akebi_trans.svg new file mode 100644 index 0000000..f4dc592 --- /dev/null +++ b/src/resources/icons/akebi_trans.svg @@ -0,0 +1,67 @@ + + + + + + + + diff --git a/src/ui/components/ServerLaunchSection.tsx b/src/ui/components/ServerLaunchSection.tsx index 3644310..559a523 100644 --- a/src/ui/components/ServerLaunchSection.tsx +++ b/src/ui/components/ServerLaunchSection.tsx @@ -205,7 +205,6 @@ export default class ServerLaunchSection extends React.Component - ) } diff --git a/src/ui/components/menu/Options.tsx b/src/ui/components/menu/Options.tsx index 433c126..2ee3f92 100644 --- a/src/ui/components/menu/Options.tsx +++ b/src/ui/components/menu/Options.tsx @@ -28,6 +28,10 @@ interface IState { themes: string[] theme: string encryption: boolean + swag: boolean + + // Swag stuff + akebi_path: string } export default class Options extends React.Component { @@ -44,12 +48,17 @@ export default class Options extends React.Component { bg_url_or_path: '', themes: ['default'], theme: '', - encryption: false + encryption: false, + swag: false, + + // Swag stuff + akebi_path: '', } this.setGameExec = this.setGameExec.bind(this) this.setGrasscutterJar = this.setGrasscutterJar.bind(this) this.setJavaPath = this.setJavaPath.bind(this) + this.setAkebi = this.setAkebi.bind(this) this.toggleGrasscutterWithGame = this.toggleGrasscutterWithGame.bind(this) this.setCustomBackground = this.setCustomBackground.bind(this) this.toggleEncryption = this.toggleEncryption.bind(this) @@ -74,7 +83,11 @@ export default class Options extends React.Component { bg_url_or_path: config.customBackground || '', themes: (await getThemeList()).map(t => t.name), theme: config.theme || 'default', - encryption: await translate(encEnabled ? 'options.enabled' : 'options.disabled') + encryption: await translate(encEnabled ? 'options.enabled' : 'options.disabled'), + swag: config.swag_mode || false, + + // Swag stuff + akebi_path: config.akebi_path || '', }) this.forceUpdate() @@ -104,6 +117,14 @@ export default class Options extends React.Component { }) } + setAkebi(value: string) { + setConfigOption('akebi_path', value) + + this.setState({ + akebi_path: value + }) + } + async setLanguage(value: string) { await setConfigOption('language', value) window.location.reload() @@ -178,6 +199,18 @@ export default class Options extends React.Component { + { + this.state.swag && ( + + ) + }