Bug fixes

This commit is contained in:
Natsumi
2021-07-31 19:22:01 +12:00
parent 7739a32fc1
commit 393335db59
2 changed files with 16 additions and 18 deletions

View File

@@ -119,29 +119,21 @@ namespace VRCX
} }
if (!File.Exists(UnityPlayerDll)) 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" %* using (var key = Registry.ClassesRoot.OpenSubKey(@"VRChat\shell\open\command"))
var match = Regex.Match(key.GetValue(string.Empty) as string, "(?!\")(.+?\\\\VRChat.*)(!?\\\\launch.exe\")");
if (match.Success == true)
{ {
// "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"); var fileLocation = Path.Combine(match.Groups[1].Value, "UnityPlayer.dll");
if (File.Exists(fileLocation)) File.Copy(fileLocation, Path.Combine(Program.BaseDirectory, "AssetBundleCacher\\UnityPlayer.dll"));
{
File.Copy(fileLocation, Path.Combine(Program.BaseDirectory, "AssetBundleCacher\\UnityPlayer.dll"));
}
else
{
DownloadProgress = -11;
return;
}
}
else
{
DownloadProgress = -11;
return;
} }
} }
catch
{
DownloadProgress = -11;
return;
}
} }
DownloadProgress = 0; DownloadProgress = 0;
VRChatCacheLocation = GetVRChatCacheLocation(cacheDir); VRChatCacheLocation = GetVRChatCacheLocation(cacheDir);

View File

@@ -8089,6 +8089,12 @@ speechSynthesis.getVoices();
this.notificationTTSVoice = index; this.notificationTTSVoice = index;
configRepository.setString('VRCX_notificationTTSVoice', this.notificationTTSVoice); configRepository.setString('VRCX_notificationTTSVoice', this.notificationTTSVoice);
var voices = speechSynthesis.getVoices(); var voices = speechSynthesis.getVoices();
if (voices.length === 0) {
return;
}
if (index > voices.length) {
index = 0;
}
var voiceName = voices[index].name; var voiceName = voices[index].name;
speechSynthesis.cancel(); speechSynthesis.cancel();
this.speak(voiceName); this.speak(voiceName);