mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2026-02-04 09:25:16 +01:00
Add webcache clearing
This commit is contained in:
@@ -35,7 +35,8 @@
|
|||||||
"un_elevated": "Run the game non-elevated (no admin)",
|
"un_elevated": "Run the game non-elevated (no admin)",
|
||||||
"redirect_more": "Also redirect other MHY games",
|
"redirect_more": "Also redirect other MHY games",
|
||||||
"check_aagl": "For more options, check the other launcher",
|
"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": {
|
"downloads": {
|
||||||
"grasscutter_fullbuild": "Download Grasscutter All-in-One",
|
"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.setCustomBackground = this.setCustomBackground.bind(this)
|
||||||
this.toggleEncryption = this.toggleEncryption.bind(this)
|
this.toggleEncryption = this.toggleEncryption.bind(this)
|
||||||
this.removeRSA = this.removeRSA.bind(this)
|
this.removeRSA = this.removeRSA.bind(this)
|
||||||
|
this.deleteWebCache = this.deleteWebCache.bind(this)
|
||||||
this.addMigotoDelay = this.addMigotoDelay.bind(this)
|
this.addMigotoDelay = this.addMigotoDelay.bind(this)
|
||||||
this.toggleUnElevatedGame = this.toggleUnElevatedGame.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) {
|
async toggleOption(opt: keyof Configuration) {
|
||||||
const changedVal = !(await getConfigOption(opt))
|
const changedVal = !(await getConfigOption(opt))
|
||||||
|
|
||||||
@@ -646,6 +659,19 @@ export default class Options extends React.Component<IProps, IState> {
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
</Menu>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user