mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-12 23:24:35 +01:00
allow custom java set
This commit is contained in:
@@ -14,6 +14,7 @@ interface IProps {
|
||||
interface IState {
|
||||
game_install_path: string
|
||||
grasscutter_path: string
|
||||
java_path: string
|
||||
grasscutter_with_game: boolean
|
||||
}
|
||||
|
||||
@@ -24,6 +25,7 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
this.state = {
|
||||
game_install_path: '',
|
||||
grasscutter_path: '',
|
||||
java_path: '',
|
||||
grasscutter_with_game: false
|
||||
}
|
||||
}
|
||||
@@ -33,6 +35,7 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
this.setState({
|
||||
game_install_path: config.game_install_path || '',
|
||||
grasscutter_path: config.grasscutter_path || '',
|
||||
java_path: config.java_path || '',
|
||||
grasscutter_with_game: config.grasscutter_with_game || false
|
||||
})
|
||||
})
|
||||
@@ -48,6 +51,10 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
setConfigOption('grasscutter_path', value)
|
||||
}
|
||||
|
||||
setJavaPath(value: string) {
|
||||
setConfigOption('java_path', value)
|
||||
}
|
||||
|
||||
async toggleGrasscutterWithGame() {
|
||||
setConfigOption('grasscutter_with_game', !(await getConfigOption('grasscutter_with_game')))
|
||||
}
|
||||
@@ -82,6 +89,17 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
<Checkbox onChange={this.toggleGrasscutterWithGame} checked={this.state?.grasscutter_with_game} id="gcWithGame" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Divider />
|
||||
|
||||
<div className='OptionSection'>
|
||||
<div className='OptionLabel'>
|
||||
<Tr text="options.java_path" />
|
||||
</div>
|
||||
<div className='OptionValue'>
|
||||
<DirInput onChange={this.setJavaPath} value={this.state?.java_path} extensions={['exe']} />
|
||||
</div>
|
||||
</div>
|
||||
</Menu>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user