Add applauncher settings, refactor some pug code (#544)

* fix(.NET): Stop CheckGameRunning from force checking processes

I'm not really sure what I was thinking when I did that the way I did; They are not supposed to force check if they're closed after the first time...That's what the monitor is for.

* feat(.NET): Add optional child process culling, clean up applauncher

Add an AppApi method to set applauncher settings Enabled/KillChildrenOnExit

Refactor repeated applauncher event code, move into methods

* refactor: Move the pug code for every tab into its own file

* refactor: Add PoC mixins to settings.pug ^& add comments for navigation

Some proof of concept replacements of the categories, switches and a radio group in the General settings seection.
Also added comments for each header-separated section for marginally better navigation of the file.

* refactor: Move the login page to its own file

* fix(.NET): Correct wrong variable being set in SetAppLauncherSettings

* fix(.NET): Remove redundant/exception causing process refresh in monitor

* refactor(.NET): Allow launcher to be disabled; Disabled by default.

* refactor: Change screenshot helper default to true

* feat: Expose new app launcher settings, add new settings category

Translation keys added/removed:
+ view.settings.advanced.advanced.app_launcher.header
+ view.settings.advanced.advanced.app_launcher.folder_tooltip
+ view.settings.advanced.advanced.app_launcher.enable
+ view.settings.advanced.advanced.app_launcher.auto_close
- view.settings.advanced.advanced.auto_launch
- view.settings.advanced.advanced.auto_launch_tooltip

* Add GPU Fix and Udon Exception Logging options, unload favorites tab when not in use

* Fix GPUFix typo

* Fix GPUFix typo 1

* Add logging for AVPro streams without usharp videoplayer

* Lint

---------

Co-authored-by: Natsumi <cmcooper123@hotmail.com>
This commit is contained in:
Teacup
2023-05-13 06:26:29 -04:00
committed by GitHub
parent b538d614e3
commit 24f1a57c5d
22 changed files with 1855 additions and 1571 deletions

View File

@@ -4911,6 +4911,10 @@ speechSynthesis.getVoices();
}
});
AppApi.CheckGameRunning();
AppApi.SetAppLauncherSettings(
this.enableAppLauncher,
this.enableAppLauncherAutoClose
);
API.$on('SHOW_WORLD_DIALOG', (tag) => this.showWorldDialog(tag));
API.$on('SHOW_WORLD_DIALOG_SHORTNAME', (tag) =>
this.verifyShortName('', tag)
@@ -5089,9 +5093,6 @@ speechSynthesis.getVoices();
isGameRunning,
isSteamVRRunning
) {
console.log(
`updateIsGameRunning isGameRunning:${isGameRunning} isSteamVRRunning:${isSteamVRRunning}`
);
if (isGameRunning !== this.isGameRunning) {
this.isGameRunning = isGameRunning;
if (isGameRunning) {
@@ -5113,11 +5114,11 @@ speechSynthesis.getVoices();
60000
);
this.nextDiscordUpdate = 0;
console.log('isGameRunning changed', isGameRunning);
console.log('isGameRunning:', isGameRunning);
}
if (isSteamVRRunning !== this.isSteamVRRunning) {
this.isSteamVRRunning = isSteamVRRunning;
console.log('isSteamVRRunning changed', isSteamVRRunning);
console.log('isSteamVRRunning:', isSteamVRRunning);
}
this.updateOpenVR();
};
@@ -9032,6 +9033,7 @@ speechSynthesis.getVoices();
this.photonLobbyUserData = new Map();
this.photonLobbyWatcherLoopStop();
this.photonLobbyAvatars = new Map();
this.photonLobbyLastModeration = new Map();
this.photonLobbyJointime = new Map();
this.photonEvent7List = new Map();
this.photonLastEvent7List = '';
@@ -9674,7 +9676,9 @@ speechSynthesis.getVoices();
this.updateOpenVR();
break;
case 'udon-exception':
console.log('UdonException', gameLog.data);
if (this.udonExceptionLogging) {
console.log('UdonException', gameLog.data);
}
// var entry = {
// created_at: gameLog.dt,
// type: 'Event',
@@ -9707,6 +9711,7 @@ speechSynthesis.getVoices();
$app.data.photonLobbyUserData = new Map();
$app.data.photonLobbyCurrent = new Map();
$app.data.photonLobbyAvatars = new Map();
$app.data.photonLobbyLastModeration = new Map();
$app.data.photonLobbyWatcherLoop = false;
$app.data.photonLobbyTimeout = [];
$app.data.photonLobbyJointime = new Map();
@@ -10305,10 +10310,12 @@ speechSynthesis.getVoices();
break;
case 254:
// Leave
this.photonUserLeave(data.Parameters[254], gameLogDate);
this.photonLobbyCurrent.delete(data.Parameters[254]);
this.photonLobbyJointime.delete(data.Parameters[254]);
this.photonEvent7List.delete(data.Parameters[254]);
var photonId = data.Parameters[254];
this.photonUserLeave(photonId, gameLogDate);
this.photonLobbyCurrent.delete(photonId);
this.photonLobbyLastModeration.delete(photonId);
this.photonLobbyJointime.delete(photonId);
this.photonEvent7List.delete(photonId);
this.parsePhotonLobbyIds(data.Parameters[252]);
if (typeof data.Parameters[203] !== 'undefined') {
this.setPhotonLobbyMaster(
@@ -10891,6 +10898,7 @@ speechSynthesis.getVoices();
gameLogDate
) {
database.getModeration(ref.id).then((row) => {
var lastType = this.photonLobbyLastModeration.get(photonId);
var type = '';
var text = '';
if (block) {
@@ -10910,7 +10918,7 @@ speechSynthesis.getVoices();
}
if (block === row.block && mute === row.mute) {
// no change
if (type) {
if (type && type !== lastType) {
this.addEntryPhotonEvent({
photonId,
text: `Moderation ${text}`,
@@ -10919,9 +10927,11 @@ speechSynthesis.getVoices();
created_at: gameLogDate
});
}
this.photonLobbyLastModeration.set(photonId, type);
return;
}
}
this.photonLobbyLastModeration.set(photonId, type);
this.moderationAgainstTable.forEach((item) => {
if (item.userId === ref.id && item.type === type) {
removeFromArray(this.moderationAgainstTable, item);
@@ -13419,6 +13429,10 @@ speechSynthesis.getVoices();
'VRCX_randomUserColours',
this.randomUserColours
);
configRepository.setBool(
'VRCX_udonExceptionLogging',
this.udonExceptionLogging
);
this.updateSharedFeed(true);
this.updateVRConfigVars();
this.updateVRLastLocation();
@@ -13493,19 +13507,23 @@ speechSynthesis.getVoices();
);
$app.data.isStartAsMinimizedState = false;
$app.data.isCloseToTray = false;
$app.data.gpuFix = false;
VRCXStorage.Get('VRCX_StartAsMinimizedState').then((result) => {
$app.isStartAsMinimizedState = result === 'true';
});
VRCXStorage.Get('VRCX_CloseToTray').then((result) => {
$app.isCloseToTray = result === 'true';
});
VRCXStorage.Get('VRCX_GPUFix').then((result) => {
$app.gpuFix = result === 'true';
});
if (configRepository.getBool('VRCX_CloseToTray')) {
// move back to JSON
$app.data.isCloseToTray = configRepository.getBool('VRCX_CloseToTray');
VRCXStorage.Set('VRCX_CloseToTray', $app.data.isCloseToTray.toString());
configRepository.remove('VRCX_CloseToTray');
}
var saveVRCXWindowOption = function () {
$app.methods.saveVRCXWindowOption = function () {
configRepository.setBool(
'VRCX_StartAtWindowsStartup',
this.isStartAtWindowsStartup
@@ -13515,11 +13533,9 @@ speechSynthesis.getVoices();
this.isStartAsMinimizedState.toString()
);
VRCXStorage.Set('VRCX_CloseToTray', this.isCloseToTray.toString());
VRCXStorage.Set('VRCX_GPUFix', this.gpuFix.toString());
AppApi.SetStartup(this.isStartAtWindowsStartup);
};
$app.watch.isStartAtWindowsStartup = saveVRCXWindowOption;
$app.watch.isStartAsMinimizedState = saveVRCXWindowOption;
$app.watch.isCloseToTray = saveVRCXWindowOption;
$app.data.photonEventOverlay = configRepository.getBool(
'VRCX_PhotonEventOverlay'
);
@@ -13539,6 +13555,9 @@ speechSynthesis.getVoices();
$app.data.gameLogDisabled = configRepository.getBool(
'VRCX_gameLogDisabled'
);
$app.data.udonExceptionLogging = configRepository.getBool(
'VRCX_udonExceptionLogging'
);
$app.data.instanceUsersSortAlphabetical = configRepository.getBool(
'VRCX_instanceUsersSortAlphabetical'
);
@@ -13877,12 +13896,24 @@ speechSynthesis.getVoices();
);
$app.data.screenshotHelper = configRepository.getBool(
'VRCX_screenshotHelper'
'VRCX_screenshotHelper',
true
);
$app.data.screenshotHelperModifyFilename = configRepository.getBool(
'VRCX_screenshotHelperModifyFilename'
);
$app.data.enableAppLauncher = configRepository.getBool(
'VRCX_enableAppLauncher',
true
);
$app.data.enableAppLauncherAutoClose = configRepository.getBool(
'VRCX_enableAppLauncherAutoClose',
true
);
$app.methods.updateVRConfigVars = function () {
var notificationTheme = 'relax';
if (this.isDarkMode) {
@@ -20662,6 +20693,22 @@ speechSynthesis.getVoices();
AppApi.OpenShortcutFolder();
};
$app.methods.updateAppLauncherSettings = function () {
configRepository.setBool(
'VRCX_enableAppLauncher',
this.enableAppLauncher
);
configRepository.setBool(
'VRCX_enableAppLauncherAutoClose',
this.enableAppLauncherAutoClose
);
AppApi.SetAppLauncherSettings(
this.enableAppLauncher,
this.enableAppLauncherAutoClose
);
};
// Screenshot Helper
$app.methods.saveScreenshotHelper = function () {