mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-12 15:14:35 +01:00
Add webcache clearing
This commit is contained in:
@@ -35,7 +35,8 @@
|
||||
"un_elevated": "Run the game non-elevated (no admin)",
|
||||
"redirect_more": "Also redirect other MHY games",
|
||||
"check_aagl": "For more options, check the other launcher",
|
||||
"grasscutter_elevation": "Method of running GC on restricted ports"
|
||||
"grasscutter_elevation": "Method of running GC on restricted ports",
|
||||
"web_cache": "Delete webCaches folder"
|
||||
},
|
||||
"downloads": {
|
||||
"grasscutter_fullbuild": "Download Grasscutter All-in-One",
|
||||
|
||||
@@ -103,6 +103,7 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
this.setCustomBackground = this.setCustomBackground.bind(this)
|
||||
this.toggleEncryption = this.toggleEncryption.bind(this)
|
||||
this.removeRSA = this.removeRSA.bind(this)
|
||||
this.deleteWebCache = this.deleteWebCache.bind(this)
|
||||
this.addMigotoDelay = this.addMigotoDelay.bind(this)
|
||||
this.toggleUnElevatedGame = this.toggleUnElevatedGame.bind(this)
|
||||
}
|
||||
@@ -336,6 +337,18 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
})
|
||||
}
|
||||
|
||||
async deleteWebCache() {
|
||||
alert('Cultivation may freeze for a moment while this occurs!')
|
||||
|
||||
// Get webCaches folder path
|
||||
const pathArr = this.state.game_install_path.replace(/\\/g, '/').split('/')
|
||||
pathArr.pop()
|
||||
const path = pathArr.join('/') + '/GenshinImpact_Data/webCaches'
|
||||
|
||||
// Delete the folder
|
||||
await invoke('dir_delete', { path: path })
|
||||
}
|
||||
|
||||
async toggleOption(opt: keyof Configuration) {
|
||||
const changedVal = !(await getConfigOption(opt))
|
||||
|
||||
@@ -646,6 +659,19 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Divider />
|
||||
|
||||
<div className="OptionSection" id="menuOptionsContainerAdvanced">
|
||||
<div className="OptionLabel" id="menuOptionsLabelWebCache">
|
||||
<Tr text="options.web_cache" />
|
||||
</div>
|
||||
<div className="OptionValue" id="menuOptionsButtondeleteWebcache">
|
||||
<BigButton onClick={this.deleteWebCache} id="deleteWebcache">
|
||||
<Tr text="components.delete" />
|
||||
</BigButton>
|
||||
</div>
|
||||
</div>
|
||||
</Menu>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user