From 1011a8086c9ef0ead7ac4d3ed4f5ed13eea33f22 Mon Sep 17 00:00:00 2001 From: Soapwood Date: Thu, 19 Sep 2024 22:58:25 +0100 Subject: [PATCH] WE ARE SO BACK. Return ChatBox notifications to their former glory. NewLines have been returned to the VRChat Beta. --- .../VRChat/VrChatOscNotificationClient.cs | 12 +++++++++--- VXMusicDesktop/VXMusicActions.cs | 6 +++--- VXMusicDesktop/VXMusicDesktop.csproj | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/VXMusic/Notifications/VRChat/VrChatOscNotificationClient.cs b/VXMusic/Notifications/VRChat/VrChatOscNotificationClient.cs index 89111c4..9af47d0 100644 --- a/VXMusic/Notifications/VRChat/VrChatOscNotificationClient.cs +++ b/VXMusic/Notifications/VRChat/VrChatOscNotificationClient.cs @@ -48,23 +48,29 @@ public void Disconnect() public void SendNotification(NotificationLevel level, string title, string content, int timeout, string image) { + var chatBoxTextFormatted = string.IsNullOrWhiteSpace(content) ? title : title + "\n" + content; + if(IsConnectedToVrChatRuntime) - Instance.SendChatbox(title + content, true); // Bypass keyboard and sends string to Chatbox + Instance.SendChatbox(chatBoxTextFormatted, true); // Bypass keyboard and sends string to Chatbox } public void SendNotification(NotificationLevel level, string title, string content, int timeout) { + var chatBoxTextFormatted = string.IsNullOrWhiteSpace(content) ? title : title + "\n" + content; + if (IsConnectedToVrChatRuntime) { - Instance.SendChatbox(title + content, true); // Bypass keyboard and sends string to Chatbox + Instance.SendChatbox(chatBoxTextFormatted, true); // Bypass keyboard and sends string to Chatbox } } public async Task SendNotificationAsync(NotificationLevel level, string title, string content, int timeout) { + var chatBoxTextFormatted = string.IsNullOrWhiteSpace(content) ? title : title + "\n" + content; + if (IsConnectedToVrChatRuntime) { - Instance.SendChatbox(title + content, true); // Bypass keyboard and sends string to Chatbox + Instance.SendChatbox(chatBoxTextFormatted, true); // Bypass keyboard and sends string to Chatbox await Task.Delay(timeout); Instance.SendChatbox("", true); // Bypass keyboard and sends string to Chatbox } diff --git a/VXMusicDesktop/VXMusicActions.cs b/VXMusicDesktop/VXMusicActions.cs index cfd4d7c..d322b04 100644 --- a/VXMusicDesktop/VXMusicActions.cs +++ b/VXMusicDesktop/VXMusicActions.cs @@ -71,7 +71,7 @@ await Task.Run(() => App.VXMusicSession.ToastNotification.SendNotification(NotificationLevel.Warning,"Oops, couldn't get that.", "Tech Tip: Have you tried turning up your Media Volume?", 5); if(App.VXMusicSession.NotificationSettings.IsVRChatNotificationServiceEnabled) - App.VXMusicSession.VrChatNotification.SendNotificationAsync(NotificationLevel.Warning, $"Couldn't catch that! ", "Try turning up World Volume.", 3000); + App.VXMusicSession.VrChatNotification.SendNotificationAsync(NotificationLevel.Warning, $"Couldn't catch that!", "Try turning up World Volume.", 3000); } else if (result.Status == Status.RecordingError) { @@ -92,8 +92,8 @@ await Task.Run(() => $"{result.Result.Album} ({result.Result.ReleaseDate})", 8, result.Result.AlbumArt); if(App.VXMusicSession.NotificationSettings.IsVRChatNotificationServiceEnabled) - App.VXMusicSession.VrChatNotification.SendNotificationAsync(NotificationLevel.Success,$"{result.Result.Artist} - {result.Result.Title} ", - $"[{result.Result.Album}] ({result.Result.ReleaseDate})", 5000); + App.VXMusicSession.VrChatNotification.SendNotificationAsync(NotificationLevel.Success,$"{result.Result.Artist} - {result.Result.Title}", + $"({result.Result.Album} - {result.Result.ReleaseDate})", 5000); } if(App.VXMusicSession.NotificationSettings.IsVRChatNotificationServiceEnabled) diff --git a/VXMusicDesktop/VXMusicDesktop.csproj b/VXMusicDesktop/VXMusicDesktop.csproj index 70e21d0..b44df98 100644 --- a/VXMusicDesktop/VXMusicDesktop.csproj +++ b/VXMusicDesktop/VXMusicDesktop.csproj @@ -9,7 +9,7 @@ VXLogo.png Images\VXLogoIcon.ico Always - 0.6.6.2 + 0.6.6.3 en VXMusicDesktop VirtualXtensions