Starting work on brand new patcher (Wooo)

Oh god my sanity is fading again. Please help. oh god. oh god. oh god. Please help me.
This commit is contained in:
Benj
2022-07-06 17:27:59 +08:00
committed by lilmayofuksu
parent 8ac4d063a4
commit 936c533ff8
9 changed files with 271 additions and 116 deletions

View File

@@ -4,6 +4,7 @@ import BigButton from './common/BigButton'
import TextInput from './common/TextInput'
import HelpButton from './common/HelpButton'
import { getConfig, saveConfig, setConfigOption } from '../../utils/configuration'
import { patchMetadata } from '../../utils/patcher'
import { translate } from '../../utils/language'
import { invoke } from '@tauri-apps/api/tauri'
@@ -85,6 +86,10 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
await saveConfig(config)
}
async patchMetadata() {
await patchMetadata()
}
async playGame() {
const config = await getConfig()
@@ -196,7 +201,7 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
{
this.state.grasscutterEnabled && (
<div>
<div className="ServerConfig" id="serverConfigContainer">
<div className="ServerConfig" id="serverConfigContainer">Compiled with problems:
<TextInput id="ip" key="ip" placeholder={this.state.ipPlaceholder} onChange={this.setIp} initalValue={this.state.ip} />
<TextInput style={{
width: '10%',
@@ -211,7 +216,7 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
<div className="ServerLaunchButtons" id="serverLaunchContainer">
<BigButton onClick={this.playGame} id="officialPlay">{this.state.buttonLabel}</BigButton>
<BigButton onClick={this.patchMetadata} id="officialPlay">Patch Metadata</BigButton>
<BigButton onClick={this.launchServer} id="serverLaunch">
<img className="ServerIcon" id="serverLaunchIcon" src={Server} />
</BigButton>