mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-15 08:34:43 +01:00
reload launcher on bg set
This commit is contained in:
@@ -38,6 +38,7 @@ export default class Options extends React.Component<IProps, IState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.toggleGrasscutterWithGame = this.toggleGrasscutterWithGame.bind(this)
|
this.toggleGrasscutterWithGame = this.toggleGrasscutterWithGame.bind(this)
|
||||||
|
this.setCustomBackground = this.setCustomBackground.bind(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
async componentDidMount() {
|
async componentDidMount() {
|
||||||
@@ -86,13 +87,15 @@ export default class Options extends React.Component<IProps, IState> {
|
|||||||
const filename = value.replace(/\\/g, '/').split('/').pop()
|
const filename = value.replace(/\\/g, '/').split('/').pop()
|
||||||
const localBgPath = (await dataDir() as string).replace(/\\/g, '/')
|
const localBgPath = (await dataDir() as string).replace(/\\/g, '/')
|
||||||
|
|
||||||
setConfigOption('customBackground', `${localBgPath}/cultivation/bg/${filename}`)
|
await setConfigOption('customBackground', `${localBgPath}/cultivation/bg/${filename}`)
|
||||||
|
|
||||||
// Copy the file over to the local directory
|
// Copy the file over to the local directory
|
||||||
invoke('copy_file', {
|
await invoke('copy_file', {
|
||||||
path: value.replace(/\\/g, '/'),
|
path: value.replace(/\\/g, '/'),
|
||||||
newPath: `${localBgPath}cultivation/bg/`
|
newPath: `${localBgPath}cultivation/bg/`
|
||||||
})
|
})
|
||||||
|
|
||||||
|
window.location.reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
Reference in New Issue
Block a user