From 393335db59df56217aa763c979b62dff8a997c35 Mon Sep 17 00:00:00 2001 From: Natsumi Date: Sat, 31 Jul 2021 19:22:01 +1200 Subject: [PATCH] Bug fixes --- AssetBundleCacher.cs | 28 ++++++++++------------------ html/src/app.js | 6 ++++++ 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/AssetBundleCacher.cs b/AssetBundleCacher.cs index e9ecf216..86cee8f6 100644 --- a/AssetBundleCacher.cs +++ b/AssetBundleCacher.cs @@ -119,29 +119,21 @@ namespace VRCX } if (!File.Exists(UnityPlayerDll)) { - using (var key = Registry.ClassesRoot.OpenSubKey(@"VRChat\shell\open\command")) + try { - // "C:\Program Files (x86)\Steam\steamapps\common\VRChat\launch.exe" "%1" %* - var match = Regex.Match(key.GetValue(string.Empty) as string, "(?!\")(.+?\\\\VRChat.*)(!?\\\\launch.exe\")"); - if (match.Success == true) + using (var key = Registry.ClassesRoot.OpenSubKey(@"VRChat\shell\open\command")) { + // "C:\Program Files (x86)\Steam\steamapps\common\VRChat\launch.exe" "%1" %* + var match = Regex.Match(key.GetValue(string.Empty) as string, "(?!\")(.+?\\\\VRChat.*)(!?\\\\launch.exe\")"); var fileLocation = Path.Combine(match.Groups[1].Value, "UnityPlayer.dll"); - if (File.Exists(fileLocation)) - { - File.Copy(fileLocation, Path.Combine(Program.BaseDirectory, "AssetBundleCacher\\UnityPlayer.dll")); - } - else - { - DownloadProgress = -11; - return; - } - } - else - { - DownloadProgress = -11; - return; + File.Copy(fileLocation, Path.Combine(Program.BaseDirectory, "AssetBundleCacher\\UnityPlayer.dll")); } } + catch + { + DownloadProgress = -11; + return; + } } DownloadProgress = 0; VRChatCacheLocation = GetVRChatCacheLocation(cacheDir); diff --git a/html/src/app.js b/html/src/app.js index b7ee846a..98308c00 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -8089,6 +8089,12 @@ speechSynthesis.getVoices(); this.notificationTTSVoice = index; configRepository.setString('VRCX_notificationTTSVoice', this.notificationTTSVoice); var voices = speechSynthesis.getVoices(); + if (voices.length === 0) { + return; + } + if (index > voices.length) { + index = 0; + } var voiceName = voices[index].name; speechSynthesis.cancel(); this.speak(voiceName);