mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-12 23:24:35 +01:00
fix textboxes
This commit is contained in:
@@ -80,8 +80,8 @@ class App extends React.Component<IProps, IState> {
|
||||
const cert_generated = await getConfigOption('cert_generated')
|
||||
const game_exe = await getConfigOption('game_install_path')
|
||||
const custom_bg = await getConfigOption('customBackground')
|
||||
const game_path = game_exe.substring(0, game_exe.replace(/\\/g, '/').lastIndexOf('/'))
|
||||
const root_path = game_path.substring(0, game_path.replace(/\\/g, '/').lastIndexOf('/'))
|
||||
const game_path = game_exe?.substring(0, game_exe.replace(/\\/g, '/').lastIndexOf('/')) || ''
|
||||
const root_path = game_path?.substring(0, game_path.replace(/\\/g, '/').lastIndexOf('/')) || ''
|
||||
|
||||
// Load a theme if it exists
|
||||
const theme = await getConfigOption('theme')
|
||||
|
||||
@@ -53,7 +53,6 @@ export default class TextInput extends React.Component<IProps, IState> {
|
||||
this.props.clearable ?
|
||||
<div className="TextClear" onClick={() => {
|
||||
// Run custom behaviour first
|
||||
console.log('cleared')
|
||||
if (this.props.customClearBehaviour) return this.props.customClearBehaviour()
|
||||
|
||||
this.setState({ value: '' })
|
||||
|
||||
@@ -43,6 +43,9 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
theme: ''
|
||||
}
|
||||
|
||||
this.setGameExec = this.setGameExec.bind(this)
|
||||
this.setGrasscutterJar = this.setGrasscutterJar.bind(this)
|
||||
this.setJavaPath = this.setJavaPath.bind(this)
|
||||
this.toggleGrasscutterWithGame = this.toggleGrasscutterWithGame.bind(this)
|
||||
this.setCustomBackground = this.setCustomBackground.bind(this)
|
||||
}
|
||||
@@ -68,14 +71,26 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
|
||||
setGameExec(value: string) {
|
||||
setConfigOption('game_install_path', value)
|
||||
|
||||
this.setState({
|
||||
game_install_path: value
|
||||
})
|
||||
}
|
||||
|
||||
setGrasscutterJar(value: string) {
|
||||
setConfigOption('grasscutter_path', value)
|
||||
|
||||
this.setState({
|
||||
grasscutter_path: value
|
||||
})
|
||||
}
|
||||
|
||||
setJavaPath(value: string) {
|
||||
setConfigOption('java_path', value)
|
||||
|
||||
this.setState({
|
||||
java_path: value
|
||||
})
|
||||
}
|
||||
|
||||
async setLanguage(value: string) {
|
||||
|
||||
Reference in New Issue
Block a user