mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 06:43:51 +02:00
Auto clear VRCX cache
This commit is contained in:
@@ -4039,6 +4039,8 @@ speechSynthesis.getVoices();
|
|||||||
nextCurrentUserRefresh: 0,
|
nextCurrentUserRefresh: 0,
|
||||||
nextFriendsRefresh: 0,
|
nextFriendsRefresh: 0,
|
||||||
nextAppUpdateCheck: 0,
|
nextAppUpdateCheck: 0,
|
||||||
|
ipcTimeout: 0,
|
||||||
|
nextClearVRCXCacheCheck: 0,
|
||||||
isGameRunning: false,
|
isGameRunning: false,
|
||||||
isGameNoVR: false,
|
isGameNoVR: false,
|
||||||
isSteamVRRunning: false,
|
isSteamVRRunning: false,
|
||||||
@@ -4143,6 +4145,13 @@ speechSynthesis.getVoices();
|
|||||||
if (--this.ipcTimeout <= 0) {
|
if (--this.ipcTimeout <= 0) {
|
||||||
this.ipcEnabled = false;
|
this.ipcEnabled = false;
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
--this.nextClearVRCXCacheCheck <= 0 &&
|
||||||
|
this.clearVRCXCacheFrequency > 0
|
||||||
|
) {
|
||||||
|
this.nextClearVRCXCacheCheck = this.clearVRCXCacheFrequency;
|
||||||
|
this.clearVRCXCache();
|
||||||
|
}
|
||||||
AppApi.CheckGameRunning().then(
|
AppApi.CheckGameRunning().then(
|
||||||
([isGameRunning, isGameNoVR, isSteamVRRunning]) => {
|
([isGameRunning, isGameNoVR, isSteamVRRunning]) => {
|
||||||
this.updateOpenVR(
|
this.updateOpenVR(
|
||||||
@@ -10955,6 +10964,12 @@ speechSynthesis.getVoices();
|
|||||||
$app.data.photonLobbyTimeoutThreshold = configRepository.getString(
|
$app.data.photonLobbyTimeoutThreshold = configRepository.getString(
|
||||||
'VRCX_photonLobbyTimeoutThreshold'
|
'VRCX_photonLobbyTimeoutThreshold'
|
||||||
);
|
);
|
||||||
|
$app.data.clearVRCXCacheFrequency = configRepository.getString(
|
||||||
|
'VRCX_clearVRCXCacheFrequency'
|
||||||
|
);
|
||||||
|
$app.data.nextClearVRCXCacheCheck = configRepository.getString(
|
||||||
|
'VRCX_clearVRCXCacheFrequency'
|
||||||
|
);
|
||||||
$app.methods.saveOpenVROption = function () {
|
$app.methods.saveOpenVROption = function () {
|
||||||
configRepository.setBool('openVR', this.openVR);
|
configRepository.setBool('openVR', this.openVR);
|
||||||
configRepository.setBool('openVRAlways', this.openVRAlways);
|
configRepository.setBool('openVRAlways', this.openVRAlways);
|
||||||
@@ -11243,6 +11258,13 @@ speechSynthesis.getVoices();
|
|||||||
$app.data.photonLobbyTimeoutThreshold
|
$app.data.photonLobbyTimeoutThreshold
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (!configRepository.getString('VRCX_clearVRCXCacheFrequency')) {
|
||||||
|
$app.data.clearVRCXCacheFrequency = 172800; // 24 hours
|
||||||
|
configRepository.setString(
|
||||||
|
'VRCX_clearVRCXCacheFrequency',
|
||||||
|
$app.data.clearVRCXCacheFrequency
|
||||||
|
);
|
||||||
|
}
|
||||||
if (!configRepository.getString('VRCX_TimeoutHudOverlayFilter')) {
|
if (!configRepository.getString('VRCX_TimeoutHudOverlayFilter')) {
|
||||||
$app.data.timeoutHudOverlayFilter = 'Everyone';
|
$app.data.timeoutHudOverlayFilter = 'Everyone';
|
||||||
configRepository.setString(
|
configRepository.setString(
|
||||||
@@ -12116,6 +12138,36 @@ speechSynthesis.getVoices();
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$app.methods.promptAutoClearVRCXCacheFrequency = function () {
|
||||||
|
this.$prompt(
|
||||||
|
'Enter amount of hours (default: 24, disabled: 0)',
|
||||||
|
'Clear VRCX Cache Timer',
|
||||||
|
{
|
||||||
|
distinguishCancelAndClose: true,
|
||||||
|
confirmButtonText: 'OK',
|
||||||
|
cancelButtonText: 'Cancel',
|
||||||
|
inputValue: this.clearVRCXCacheFrequency / 3600 / 2,
|
||||||
|
inputPattern: /\d+$/,
|
||||||
|
inputErrorMessage: 'Valid number is required',
|
||||||
|
callback: (action, instance) => {
|
||||||
|
if (
|
||||||
|
action === 'confirm' &&
|
||||||
|
instance.inputValue &&
|
||||||
|
!isNaN(instance.inputValue)
|
||||||
|
) {
|
||||||
|
this.clearVRCXCacheFrequency = Math.trunc(
|
||||||
|
Number(instance.inputValue) * 3600 * 2
|
||||||
|
);
|
||||||
|
configRepository.setString(
|
||||||
|
'VRCX_clearVRCXCacheFrequency',
|
||||||
|
this.clearVRCXCacheFrequency
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
// App: Dialog
|
// App: Dialog
|
||||||
|
|
||||||
var adjustDialogZ = (el) => {
|
var adjustDialogZ = (el) => {
|
||||||
|
|||||||
@@ -1190,6 +1190,7 @@ html
|
|||||||
span.name Avatar Name cache: #[span(v-text="API.cachedAvatarNames.size")]
|
span.name Avatar Name cache: #[span(v-text="API.cachedAvatarNames.size")]
|
||||||
div.options-container-item
|
div.options-container-item
|
||||||
el-button(size="small" icon="el-icon-delete-solid" @click="clearVRCXCache") Clear Cache
|
el-button(size="small" icon="el-icon-delete-solid" @click="clearVRCXCache") Clear Cache
|
||||||
|
el-button(size="small" icon="el-icon-time" @click="promptAutoClearVRCXCacheFrequency") Auto Clear Cache
|
||||||
div.options-container-item
|
div.options-container-item
|
||||||
el-button(size="small" icon="el-icon-tickets" @click="showConsole") Show Console
|
el-button(size="small" icon="el-icon-tickets" @click="showConsole") Show Console
|
||||||
div.options-container
|
div.options-container
|
||||||
|
|||||||
Reference in New Issue
Block a user