Disable GameLog toggle

This commit is contained in:
Natsumi
2022-04-21 00:51:44 +12:00
parent d1dfcb06e6
commit 98389b6171
2 changed files with 46 additions and 1 deletions

View File

@@ -1005,6 +1005,10 @@ speechSynthesis.getVoices();
API.$on('USER:CURRENT', function (args) {
var {json} = args;
args.ref = this.applyCurrentUser(json);
var location = $app.lastLocation.location;
if ($app.gameLogDisabled) {
location = json.location;
}
this.applyUser({
id: json.id,
username: json.username,
@@ -1026,7 +1030,7 @@ speechSynthesis.getVoices();
fallbackAvatar: json.fallbackAvatar,
profilePicOverride: json.profilePicOverride,
isFriend: false,
location: $app.lastLocation.location
location
});
});
@@ -1355,6 +1359,12 @@ speechSynthesis.getVoices();
) {
json.location = '';
}
if (
typeof json.location === 'undefined' &&
typeof ref !== 'undefined'
) {
json.location = ref.location;
}
if ($app.lastLocation.location) {
json.location = $app.lastLocation.location;
json.$location_at = $app.lastLocation.date;
@@ -7950,6 +7960,9 @@ speechSynthesis.getVoices();
$app.data.lastVideoUrl = '';
$app.methods.addGameLogEntry = function (gameLog, location) {
if (this.gameLogDisabled) {
return;
}
var userId = '';
if (gameLog.userDisplayName) {
for (var ref of API.cachedUsers.values()) {
@@ -11498,6 +11511,9 @@ speechSynthesis.getVoices();
$app.data.photonLoggingEnabled = configRepository.getBool(
'VRCX_photonLoggingEnabled'
);
$app.data.gameLogDisabled = configRepository.getBool(
'VRCX_gameLogDisabled'
);
$app.methods.saveEventOverlay = function () {
configRepository.setBool(
'VRCX_PhotonEventOverlay',
@@ -19018,6 +19034,31 @@ speechSynthesis.getVoices();
}
};
$app.methods.disableGameLogDialog = function () {
if (this.isGameRunning) {
this.$message({
message:
'VRChat needs to be closed before this option can be changed',
type: 'error'
});
this.gameLogDisabled = !this.gameLogDisabled;
return;
}
if (this.gameLogDisabled) {
this.$confirm('Continue? Disable GameLog', 'Confirm', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
type: 'info',
callback: (action) => {
if (action !== 'confirm') {
this.gameLogDisabled = !this.gameLogDisabled;
}
}
});
}
configRepository.setBool('VRCX_gameLogDisabled', this.gameLogDisabled);
};
$app = new Vue($app);
window.$app = $app;
})();