Updates and fixes

This commit is contained in:
Natsumi
2024-01-09 23:22:31 +13:00
parent 581d5fe418
commit cd2387aa32
16 changed files with 260 additions and 137 deletions

View File

@@ -29,6 +29,7 @@
"LogWatcher": "readonly",
"Discord": "readonly",
"AppApi": "readonly",
"AppApiVr": "readonly",
"SharedVariable": "readonly",
"WebApi": "readonly",
"AssetBundleCacher": "readonly"

View File

@@ -643,8 +643,8 @@ speechSynthesis.getVoices();
options.N > 0
? options.N > options.params.offset
: options.N < 0
? args.json.length
: options.params.n === args.json.length)
? args.json.length
: options.params.n === args.json.length)
) {
this.bulk(options);
} else if ('done' in options) {
@@ -4684,7 +4684,7 @@ speechSynthesis.getVoices();
}
this.errorNoty = new Noty({
type: 'error',
text: `WebSocket Error: ${err}`
text: escapeTag(`WebSocket Error: ${err}`)
}).show();
return;
}
@@ -14687,14 +14687,10 @@ speechSynthesis.getVoices();
'VRCX_StartAtWindowsStartup',
false
);
$app.data.isStartAsMinimizedState = false;
$app.data.isCloseToTray = false;
VRCXStorage.Get('VRCX_StartAsMinimizedState').then((result) => {
$app.isStartAsMinimizedState = result === 'true';
});
VRCXStorage.Get('VRCX_CloseToTray').then((result) => {
$app.isCloseToTray = result === 'true';
});
$app.data.isStartAsMinimizedState =
(await VRCXStorage.Get('VRCX_StartAsMinimizedState')) === 'true';
$app.data.isCloseToTray =
(await VRCXStorage.Get('VRCX_CloseToTray')) === 'true';
if (await configRepository.getBool('VRCX_CloseToTray')) {
// move back to JSON
$app.data.isCloseToTray =
@@ -14702,6 +14698,8 @@ speechSynthesis.getVoices();
VRCXStorage.Set('VRCX_CloseToTray', $app.data.isCloseToTray.toString());
await configRepository.remove('VRCX_CloseToTray');
}
$app.data.disableWorldDatabase =
(await VRCXStorage.Get('VRCX_DisableWorldDatabase')) === 'true';
$app.methods.saveVRCXWindowOption = async function () {
await configRepository.setBool(
'VRCX_StartAtWindowsStartup',
@@ -14712,6 +14710,10 @@ speechSynthesis.getVoices();
this.isStartAsMinimizedState.toString()
);
VRCXStorage.Set('VRCX_CloseToTray', this.isCloseToTray.toString());
VRCXStorage.Set(
'VRCX_DisableWorldDatabase',
this.disableWorldDatabase.toString()
);
AppApi.SetStartup(this.isStartAtWindowsStartup);
};
$app.data.photonEventOverlay = await configRepository.getBool(
@@ -16662,6 +16664,16 @@ speechSynthesis.getVoices();
D.isShowAvatar = true;
}
});
} else {
database
.getUserStats(D.ref, inCurrentWorld)
.then((ref1) => {
if (ref1.userId === D.id) {
D.lastSeen = ref1.created_at;
D.joinCount = ref1.joinCount;
D.timeSpent = ref1.timeSpent;
}
});
}
API.getRepresentedGroup({ userId }).then((args1) => {
D.representedGroup = args1.json;
@@ -19541,14 +19553,25 @@ speechSynthesis.getVoices();
$app.launchOptionsDialog.visible = false;
});
$app.methods.updateLaunchOptions = async function () {
$app.methods.updateLaunchOptions = function () {
var D = this.launchOptionsDialog;
D.visible = false;
D.launchArguments = String(D.launchArguments)
.replace(/\s+/g, ' ')
.trim();
await configRepository.setString('launchArguments', D.launchArguments);
await configRepository.setString(
configRepository.setString('launchArguments', D.launchArguments);
if (
D.vrcLaunchPathOverride &&
D.vrcLaunchPathOverride.endsWith('.exe') &&
!D.vrcLaunchPathOverride.endsWith('launch.exe')
) {
this.$message({
message:
'Invalid path, you must enter VRChat folder or launch.exe',
type: 'error'
});
return;
}
configRepository.setString(
'vrcLaunchPathOverride',
D.vrcLaunchPathOverride
);
@@ -19556,6 +19579,7 @@ speechSynthesis.getVoices();
message: 'Updated launch options',
type: 'success'
});
D.visible = false;
};
$app.methods.showLaunchOptions = function () {
@@ -20101,10 +20125,19 @@ speechSynthesis.getVoices();
}
});
} else {
AppApi.StartGame(args.join(' '));
this.$message({
message: 'VRChat launched',
type: 'success'
AppApi.StartGame(args.join(' ')).then((result) => {
if (!result) {
this.$message({
message:
'Failed to find VRChat, set a custom path in launch options',
type: 'error'
});
} else {
this.$message({
message: 'VRChat launched',
type: 'success'
});
}
});
}
console.log('Launch Game', args.join(' '), desktopMode);

View File

@@ -407,6 +407,14 @@ html
i.el-icon-warning
span.extra(v-if="userDialog.timeSpent === 0") -
span.extra(v-else) {{ userDialog.timeSpent | timeToText }}
template(v-else)
.x-friend-item(@click="showPreviousInstancesUserDialog(userDialog.ref)")
.detail
span.name {{ $t('dialog.user.info.play_time') }}
el-tooltip(v-if="!hideTooltips" placement="top" style="margin-left:5px" :content="$t('dialog.user.info.accuracy_notice')")
i.el-icon-warning
span.extra(v-if="userDialog.timeSpent === 0") -
span.extra(v-else) {{ userDialog.timeSpent | timeToText }}
.x-friend-item(style="cursor:default")
el-tooltip(placement="top")
template(#content)
@@ -1486,7 +1494,7 @@ html
el-button(type="primary" size="small" @click="createGroupInstance()" :disabled="!newInstanceDialog.groupId") {{ $t('dialog.new_instance.create_instance') }}
//- dialog: launch options
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="launchOptionsDialog" :visible.sync="launchOptionsDialog.visible" :title="$t('dialog.launch_options.header')" width="500px")
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="launchOptionsDialog" :visible.sync="launchOptionsDialog.visible" :title="$t('dialog.launch_options.header')" width="600px")
div(style="font-size:12px")
| {{ $t('dialog.launch_options.description') }} #[br]
| {{ $t('dialog.launch_options.example') }} #[el-tag(size="mini") --fps=144]

View File

@@ -403,6 +403,10 @@
"header": "Automatically Manage Cache When Closing VRChat",
"description": "Auto delete old versions from cache"
},
"disable_local_world_persistence": {
"header": "Disable Local World Persistence",
"description": "Disable localhost webserver (requires restart)"
},
"remote_database": {
"header": "Remote Avatar Database",
"enable": "Enable",
@@ -582,6 +586,7 @@
"last_seen": "Last Seen",
"join_count": "Join Count",
"time_together": "Time Together",
"play_time": "Play Time",
"online_for": "Online For",
"offline_for": "Offline For",
"last_activity": "Last Activity",
@@ -592,7 +597,7 @@
"avatar_cloning": "Avatar Cloning",
"avatar_cloning_allow": "Allowed",
"avatar_cloning_deny": "Deny",
"home_location": "Home Location",
"home_location": "Home World",
"id": "User ID",
"id_tooltip": "Copy to clipboard",
"copy_id": "Copy ID",

View File

@@ -415,6 +415,11 @@ mixin settingsTab()
div.options-container-item
span.name(style="min-width:300px") {{ $t('view.settings.advanced.advanced.auto_cache_management.description') }}
el-switch(v-model="autoSweepVRChatCache" @change="saveOpenVROption")
//- Advanced | Disable local world database
span.sub-header {{ $t('view.settings.advanced.advanced.disable_local_world_persistence.header') }}
div.options-container-item
span.name(style="min-width:300px") {{ $t('view.settings.advanced.advanced.disable_local_world_persistence.description') }}
el-switch(v-model="disableWorldDatabase" @change="saveVRCXWindowOption")
//- Advanced | Remote Avatar Database
div.options-container
span.header {{ $t('view.settings.advanced.advanced.remote_database.header') }}

View File

@@ -20,7 +20,7 @@ Vue.component('marquee-text', MarqueeText);
(async function () {
var $app = null;
await CefSharp.BindObjectAsync('AppApi');
await CefSharp.BindObjectAsync('AppApiVr');
Noty.overrideDefaults({
animation: {
@@ -50,6 +50,18 @@ Vue.component('marquee-text', MarqueeText);
String(s).replace(/["&'<>]/gu, (c) => `&#${c.charCodeAt(0)};`);
Vue.filter('escapeTag', escapeTag);
var escapeTagRecursive = (obj) => {
if (typeof obj === 'string') {
return escapeTag(obj);
}
if (typeof obj === 'object') {
for (var key in obj) {
obj[key] = escapeTagRecursive(obj[key]);
}
}
return obj;
};
var commaNumber = (n) =>
String(Number(n) || 0).replace(/(\d)(?=(\d{3})+(?!\d))/gu, '$1,');
Vue.filter('commaNumber', commaNumber);
@@ -216,10 +228,7 @@ Vue.component('marquee-text', MarqueeText);
watch: {},
el: '#x-app',
mounted() {
workerTimers.setTimeout(
() => AppApi.ExecuteAppFunction('vrInit', ''),
1000
);
workerTimers.setTimeout(() => AppApiVr.VrInit(), 1000);
if (this.appType === '1') {
this.updateStatsLoop();
}
@@ -410,7 +419,7 @@ Vue.component('marquee-text', MarqueeText);
.replace(',', '');
if (!this.config.hideCpuUsageFromFeed) {
var cpuUsage = await AppApi.CpuUsage();
var cpuUsage = await AppApiVr.CpuUsage();
this.cpuUsage = cpuUsage.toFixed(0);
}
if (this.lastLocation.date !== 0) {
@@ -429,7 +438,7 @@ Vue.component('marquee-text', MarqueeText);
}
if (!this.config.hideDevicesFromFeed) {
AppApi.GetVRDevices().then((devices) => {
AppApiVr.GetVRDevices().then((devices) => {
var deviceList = [];
var baseStations = 0;
devices.forEach((device) => {
@@ -480,7 +489,7 @@ Vue.component('marquee-text', MarqueeText);
this.devices = [];
}
if (this.config.pcUptimeOnFeed) {
AppApi.GetUptime().then((uptime) => {
AppApiVr.GetUptime().then((uptime) => {
this.pcUptime = timeToText(uptime);
});
} else {
@@ -494,7 +503,12 @@ Vue.component('marquee-text', MarqueeText);
$app.methods.playNoty = function (json) {
var { noty, message, image } = JSON.parse(json);
var message = escapeTag(message);
if (typeof noty === 'undefined') {
console.error('noty is undefined');
return;
}
var noty = escapeTagRecursive(noty);
var message = escapeTag(message) || '';
var text = '';
var img = '';
if (image) {
@@ -515,8 +529,8 @@ Vue.component('marquee-text', MarqueeText);
noty.displayName
}</strong> is in ${this.displayLocation(
noty.location,
escapeTag(noty.worldName),
escapeTag(noty.groupName)
noty.worldName,
noty.groupName
)}`;
break;
case 'Online':
@@ -524,8 +538,8 @@ Vue.component('marquee-text', MarqueeText);
if (noty.worldName) {
locationName = ` to ${this.displayLocation(
noty.location,
escapeTag(noty.worldName),
escapeTag(noty.groupName)
noty.worldName,
noty.groupName
)}`;
}
text = `<strong>${noty.displayName}</strong> has logged in${locationName}`;
@@ -534,16 +548,14 @@ Vue.component('marquee-text', MarqueeText);
text = `<strong>${noty.displayName}</strong> has logged out`;
break;
case 'Status':
text = `<strong>${noty.displayName}</strong> status is now <i>${
noty.status
}</i> ${escapeTag(noty.statusDescription)}`;
text = `<strong>${noty.displayName}</strong> status is now <i>${noty.status}</i> ${noty.statusDescription}`;
break;
case 'invite':
text = `<strong>${
noty.senderUsername
}</strong> has invited you to ${this.displayLocation(
noty.details.worldId,
escapeTag(noty.details.worldName)
noty.details.worldName
)}${message}`;
break;
case 'requestInvite':
@@ -571,19 +583,19 @@ Vue.component('marquee-text', MarqueeText);
text = `<strong>${noty.previousDisplayName}</strong> changed their name to ${noty.displayName}`;
break;
case 'group.announcement':
text = escapeTag(noty.message);
text = noty.message;
break;
case 'group.informative':
text = escapeTag(noty.message);
text = noty.message;
break;
case 'group.invite':
text = escapeTag(noty.message);
text = noty.message;
break;
case 'group.joinRequest':
text = escapeTag(noty.message);
text = noty.message;
break;
case 'group.queueReady':
text = escapeTag(noty.message);
text = noty.message;
break;
case 'PortalSpawn':
if (noty.displayName) {
@@ -591,33 +603,27 @@ Vue.component('marquee-text', MarqueeText);
noty.displayName
}</strong> has spawned a portal to ${this.displayLocation(
noty.instanceId,
escapeTag(noty.worldName),
escapeTag(noty.groupName)
noty.worldName,
noty.groupName
)}`;
} else {
text = 'User has spawned a portal';
}
break;
case 'AvatarChange':
text = `<strong>${
noty.displayName
}</strong> changed into avatar ${escapeTag(noty.name)}`;
text = `<strong>${noty.displayName}</strong> changed into avatar ${noty.name}`;
break;
case 'ChatBoxMessage':
text = `<strong>${noty.displayName}</strong> said ${escapeTag(
noty.text
)}`;
text = `<strong>${noty.displayName}</strong> said ${noty.text}`;
break;
case 'Event':
text = escapeTag(noty.data);
text = noty.data;
break;
case 'External':
text = escapeTag(noty.message);
text = noty.message;
break;
case 'VideoPlay':
text = `<strong>Now playing:</strong> ${escapeTag(
noty.notyName
)}`;
text = `<strong>Now playing:</strong> ${noty.notyName}`;
break;
case 'BlockedOnPlayerJoined':
text = `Blocked user <strong>${noty.displayName}</strong> has joined`;
@@ -766,10 +772,10 @@ Vue.component('marquee-text', MarqueeText);
this.hudTimeout = JSON.parse(json);
};
$app.data.currentCulture = await AppApi.CurrentCulture();
$app.data.currentCulture = await AppApiVr.CurrentCulture();
$app.methods.setDatetimeFormat = async function () {
this.currentCulture = await AppApi.CurrentCulture();
this.currentCulture = await AppApiVr.CurrentCulture();
var formatDate = function (date) {
if (!date) {
return '';