diff --git a/src/ui/components/ServerLaunchSection.tsx b/src/ui/components/ServerLaunchSection.tsx index c2ee88a..7f0234b 100644 --- a/src/ui/components/ServerLaunchSection.tsx +++ b/src/ui/components/ServerLaunchSection.tsx @@ -31,6 +31,8 @@ interface IState { httpsEnabled: boolean swag: boolean + akebiSet: boolean + migotoSet: boolean } export default class ServerLaunchSection extends React.Component<{}, IState> { @@ -49,6 +51,8 @@ export default class ServerLaunchSection extends React.Component<{}, IState> { httpsLabel: '', httpsEnabled: false, swag: false, + akebiSet: false, + migotoSet: false, } this.toggleGrasscutter = this.toggleGrasscutter.bind(this) @@ -74,6 +78,8 @@ export default class ServerLaunchSection extends React.Component<{}, IState> { httpsLabel: await translate('main.https_enable'), httpsEnabled: config.https_enabled || false, swag: config.swag_mode || false, + akebiSet: config.akebi_path !== '', + migotoSet: config.migoto_path !== '', }) } @@ -192,6 +198,16 @@ export default class ServerLaunchSection extends React.Component<{}, IState> { await this.playGame(config.akebi_path, gameExec) } + async launchMigoto() { + const config = await getConfig() + + // Get game exe from game path, so we can watch it + const pathArr = config.game_install_path.replace(/\\/g, '/').split('/') + const gameExec = pathArr[pathArr.length - 1] + + await this.playGame(config.migoto_path, gameExec) + } + setIp(text: string) { this.setState({ ip: text, @@ -266,9 +282,17 @@ export default class ServerLaunchSection extends React.Component<{}, IState> { {this.state.swag && ( <> - - - + {this.state.akebiSet && ( + + + + )} + + {this.state.migotoSet && ( + + 3DM + + )} )} diff --git a/src/ui/components/menu/Options.tsx b/src/ui/components/menu/Options.tsx index 11947f2..a847863 100644 --- a/src/ui/components/menu/Options.tsx +++ b/src/ui/components/menu/Options.tsx @@ -37,6 +37,7 @@ interface IState { // Swag stuff akebi_path: string + migoto_path: string } export default class Options extends React.Component { @@ -60,6 +61,7 @@ export default class Options extends React.Component { // Swag stuff akebi_path: '', + migoto_path: '', } this.setGameExecutable = this.setGameExecutable.bind(this) @@ -100,6 +102,7 @@ export default class Options extends React.Component { // Swag stuff akebi_path: config.akebi_path || '', + migoto_path: config.migoto_path || '', }) this.forceUpdate() @@ -137,6 +140,14 @@ export default class Options extends React.Component { }) } + setMigoto(value: string) { + setConfigOption('migoto_path', value) + + this.setState({ + migoto_path: value, + }) + } + async setLanguage(value: string) { await setConfigOption('language', value) window.location.reload() @@ -308,10 +319,18 @@ export default class Options extends React.Component { - + )} diff --git a/src/utils/configuration.ts b/src/utils/configuration.ts index f3c3c06..c2f2e00 100644 --- a/src/utils/configuration.ts +++ b/src/utils/configuration.ts @@ -50,6 +50,7 @@ export interface Configuration { // Swag stuff akebi_path?: string + migoto_path?: string } export async function setConfigOption(key: K, value: Configuration[K]): Promise {