Unleash the PUG linter

This commit is contained in:
Natsumi
2025-01-27 12:28:08 +13:00
parent ca6b52c053
commit cc1a1fbd6a
30 changed files with 6904 additions and 3041 deletions

View File

@@ -95,7 +95,11 @@ export default class extends baseClass {
) {
if (LINUX) {
this.nextGameRunningCheck = 1;
$app.updateIsGameRunning(await AppApi.IsGameRunning(), await AppApi.IsSteamVRRunning(), false);
$app.updateIsGameRunning(
await AppApi.IsGameRunning(),
await AppApi.IsSteamVRRunning(),
false
);
} else {
this.nextGameRunningCheck = 3;
AppApi.CheckGameRunning();

View File

@@ -146,12 +146,12 @@ export default class extends baseClass {
fileInput.accept = '.json';
fileInput.style.display = 'none';
document.body.appendChild(fileInput);
fileInput.onchange = function(event) {
fileInput.onchange = function (event) {
const file = event.target.files[0];
if (file) {
const reader = new FileReader();
reader.onload = function() {
reader.onload = function () {
fileInput.remove();
resolve(reader.result);
};
@@ -161,15 +161,19 @@ export default class extends baseClass {
resolve(null);
}
};
fileInput.click();
});
},
async restoreVrcRegistryFromFile() {
if (WINDOWS) {
var filePath = await AppApi.OpenFileSelectorDialog(null, ".json", "JSON Files (*.json)|*.json");
if (filePath === "") {
var filePath = await AppApi.OpenFileSelectorDialog(
null,
'.json',
'JSON Files (*.json)|*.json'
);
if (filePath === '') {
return;
}
}
@@ -180,7 +184,7 @@ export default class extends baseClass {
} else {
json = await AppApi.ReadVrcRegJsonFile(filePath);
}
try {
var data = JSON.parse(json);
if (!data || typeof data !== 'object') {

View File

@@ -185,23 +185,33 @@ export default class extends baseClass {
}
const notiConditions = {
'Always': () => true,
Always: () => true,
'Inside VR': () => this.isSteamVRRunning,
'Outside VR': () => !this.isSteamVRRunning,
'Game Closed': () => !this.isGameRunning, // Also known as "Outside VRChat"
'Game Running': () => this.isGameRunning, // Also known as "Inside VRChat"
'Desktop Mode': () => this.isGameNoVR && this.isGameRunning,
'AFK': () => this.afkDesktopToast && this.isHmdAfk && this.isGameRunning && !this.isGameNoVR,
AFK: () =>
this.afkDesktopToast &&
this.isHmdAfk &&
this.isGameRunning &&
!this.isGameNoVR
};
const playNotificationTTS = notiConditions[this.notificationTTS]?.();
const playDesktopToast = notiConditions[this.desktopToast]?.() || notiConditions['AFK']();
const playNotificationTTS =
notiConditions[this.notificationTTS]?.();
const playDesktopToast =
notiConditions[this.desktopToast]?.() ||
notiConditions['AFK']();
const playOverlayToast = notiConditions[this.overlayToast]?.();
const playOverlayNotification = this.overlayNotifications && playOverlayToast;
const playOverlayNotification =
this.overlayNotifications && playOverlayToast;
const playXSNotification = this.xsNotifications && playOverlayToast;
const playOvrtHudNotifications = this.ovrtHudNotifications && playOverlayToast;
const playOvrtWristNotifications = this.ovrtWristNotifications && playOverlayToast;
const playOvrtHudNotifications =
this.ovrtHudNotifications && playOverlayToast;
const playOvrtWristNotifications =
this.ovrtWristNotifications && playOverlayToast;
var message = '';
if (noty.title) {
@@ -1299,7 +1309,11 @@ export default class extends baseClass {
if (WINDOWS) {
AppApi.DesktopNotification(displayName, message, image);
} else {
window.electron.desktopNotification(displayName, message, image);
window.electron.desktopNotification(
displayName,
message,
image
);
}
},