Skip to content

Commit

Permalink
WE ARE SO BACK. Return ChatBox notifications to their former glory. N…
Browse files Browse the repository at this point in the history
…ewLines have been returned to the VRChat Beta.
  • Loading branch information
Soapwood committed Sep 19, 2024
1 parent f5aa233 commit 1011a80
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
12 changes: 9 additions & 3 deletions VXMusic/Notifications/VRChat/VrChatOscNotificationClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions VXMusicDesktop/VXMusicActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion VXMusicDesktop/VXMusicDesktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageIcon>VXLogo.png</PackageIcon>
<ApplicationIcon>Images\VXLogoIcon.ico</ApplicationIcon>
<RunPostBuildEvent>Always</RunPostBuildEvent>
<Version>0.6.6.2</Version>
<Version>0.6.6.3</Version>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<Title>VXMusicDesktop</Title>
<Authors>VirtualXtensions</Authors>
Expand Down

0 comments on commit 1011a80

Please sign in to comment.