mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-14 16:14:48 +01:00
wipe registry option
This commit is contained in:
@@ -161,6 +161,12 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
|
||||
}
|
||||
}
|
||||
|
||||
// First wipe registry if we have to
|
||||
await invoke('wipe_registry', {
|
||||
// The exe is always PascalCase so we can get the dir using regex
|
||||
execName: (await getGameExecutable())?.split('.exe')[0].replace(/([a-z\d])([A-Z])/g, '$1 $2'),
|
||||
})
|
||||
|
||||
// Launch the program
|
||||
const gameExists = await invoke('dir_exists', {
|
||||
path: exe || config.game_install_path,
|
||||
|
||||
@@ -34,6 +34,7 @@ interface IState {
|
||||
encryption: boolean
|
||||
patch_metadata: boolean
|
||||
use_internal_proxy: boolean
|
||||
wipe_login: boolean
|
||||
swag: boolean
|
||||
|
||||
// Swag stuff
|
||||
@@ -59,6 +60,7 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
encryption: false,
|
||||
patch_metadata: false,
|
||||
use_internal_proxy: false,
|
||||
wipe_login: false,
|
||||
swag: false,
|
||||
|
||||
// Swag stuff
|
||||
@@ -78,6 +80,7 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
this.restoreMetadata = this.restoreMetadata.bind(this)
|
||||
this.toggleMetadata = this.toggleMetadata.bind(this)
|
||||
this.toggleProxy = this.toggleProxy.bind(this)
|
||||
this.toggleLoginWipe = this.toggleLoginWipe.bind(this)
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
@@ -102,6 +105,7 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
encryption: await translate(encEnabled ? 'options.enabled' : 'options.disabled'),
|
||||
patch_metadata: config.patch_metadata || false,
|
||||
use_internal_proxy: config.use_internal_proxy || false,
|
||||
wipe_login: config.wipe_login || false,
|
||||
swag: config.swag_mode || false,
|
||||
|
||||
// Swag stuff
|
||||
@@ -262,6 +266,16 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
})
|
||||
}
|
||||
|
||||
async toggleLoginWipe() {
|
||||
const changedVal = !(await getConfigOption('wipe_login'))
|
||||
|
||||
await setConfigOption('wipe_login', changedVal)
|
||||
|
||||
this.setState({
|
||||
wipe_login: changedVal,
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Menu closeFn={this.props.closeFn} className="Options" heading="Options">
|
||||
@@ -302,6 +316,14 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
<Checkbox onChange={this.toggleProxy} checked={this.state?.use_internal_proxy} id="useProxy" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="OptionSection" id="menuOptionsContainerWipeLogin">
|
||||
<div className="OptionLabel" id="menuOptionsLabelWipeLogin">
|
||||
<Tr text="options.wipe_login" />
|
||||
</div>
|
||||
<div className="OptionValue" id="menuOptionsCheckboxWipeLogin">
|
||||
<Checkbox onChange={this.toggleLoginWipe} checked={this.state?.wipe_login} id="wipeLogin" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Divider />
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ let defaultConfig: Configuration
|
||||
debug_enabled: false,
|
||||
patch_metadata: true,
|
||||
use_internal_proxy: true,
|
||||
wipe_login: false,
|
||||
}
|
||||
})()
|
||||
|
||||
@@ -46,6 +47,7 @@ export interface Configuration {
|
||||
debug_enabled: boolean
|
||||
patch_metadata: boolean
|
||||
use_internal_proxy: boolean
|
||||
wipe_login: boolean
|
||||
swag_mode?: boolean
|
||||
|
||||
// Swag stuff
|
||||
|
||||
Reference in New Issue
Block a user