diff --git a/LightlessSync/Services/PlayerPerformanceService.cs b/LightlessSync/Services/PlayerPerformanceService.cs index 0cf7a72..7db92e1 100644 --- a/LightlessSync/Services/PlayerPerformanceService.cs +++ b/LightlessSync/Services/PlayerPerformanceService.cs @@ -78,19 +78,18 @@ public class PlayerPerformanceService string warningText = string.Empty; if (exceedsTris && !exceedsVram) { - warningText = $"Player {pairHandler.Pair.PlayerName} ({pairHandler.Pair.UserData.AliasOrUID}) exceeds your configured triangle warning threshold (" + - $"{triUsage}/{config.TrisWarningThresholdThousands * 1000} triangles)."; + warningText = $"Player {pairHandler.Pair.PlayerName} ({pairHandler.Pair.UserData.AliasOrUID}) exceeds your configured triangle warning threshold\n" + + $"{triUsage}/{config.TrisWarningThresholdThousands * 1000} triangles"; } else if (!exceedsTris) { - warningText = $"Player {pairHandler.Pair.PlayerName} ({pairHandler.Pair.UserData.AliasOrUID}) exceeds your configured VRAM warning threshold (" + - $"{UiSharedService.ByteToString(vramUsage, true)}/{config.VRAMSizeWarningThresholdMiB} MiB)."; + warningText = $"Player {pairHandler.Pair.PlayerName} ({pairHandler.Pair.UserData.AliasOrUID}) exceeds your configured VRAM warning threshold\n" + + $"{UiSharedService.ByteToString(vramUsage, true)}/{config.VRAMSizeWarningThresholdMiB} MiB"; } else { - warningText = $"Player {pairHandler.Pair.PlayerName} ({pairHandler.Pair.UserData.AliasOrUID}) exceeds both VRAM warning threshold (" + - $"{UiSharedService.ByteToString(vramUsage, true)}/{config.VRAMSizeWarningThresholdMiB} MiB) and " + - $"triangle warning threshold ({triUsage}/{config.TrisWarningThresholdThousands * 1000} triangles)."; + warningText = $"Player {pairHandler.Pair.PlayerName} ({pairHandler.Pair.UserData.AliasOrUID}) exceeds both VRAM warning threshold and triangle warning threshold\n" + + $"{UiSharedService.ByteToString(vramUsage, true)}/{config.VRAMSizeWarningThresholdMiB} MiB and {triUsage}/{config.TrisWarningThresholdThousands * 1000} triangles"; } _mediator.Publish(new PerformanceNotificationMessage( @@ -142,9 +141,8 @@ public class PlayerPerformanceService if (CheckForThreshold(config.AutoPausePlayersExceedingThresholds, config.TrisAutoPauseThresholdThousands * 1000, triUsage, config.AutoPausePlayersWithPreferredPermissionsExceedingThresholds, isPrefPerm)) { - var message = $"Player {pair.PlayerName} ({pair.UserData.AliasOrUID}) exceeded your configured triangle auto pause threshold (" + - $"{triUsage}/{config.TrisAutoPauseThresholdThousands * 1000} triangles)" + - $" and has been automatically paused."; + var message = $"Player {pair.PlayerName} ({pair.UserData.AliasOrUID}) exceeded your configured triangle auto pause threshold and has been automatically paused\n" + + $"{triUsage}/{config.TrisAutoPauseThresholdThousands * 1000} triangles"; _mediator.Publish(new PerformanceNotificationMessage( $"{pair.PlayerName} ({pair.UserData.AliasOrUID}) automatically paused", @@ -223,9 +221,8 @@ public class PlayerPerformanceService if (CheckForThreshold(config.AutoPausePlayersExceedingThresholds, config.VRAMSizeAutoPauseThresholdMiB * 1024 * 1024, vramUsage, config.AutoPausePlayersWithPreferredPermissionsExceedingThresholds, isPrefPerm)) { - var message = $"Player {pair.PlayerName} ({pair.UserData.AliasOrUID}) exceeded your configured VRAM auto pause threshold (" + - $"{UiSharedService.ByteToString(vramUsage, addSuffix: true)}/{config.VRAMSizeAutoPauseThresholdMiB}MiB)" + - $" and has been automatically paused."; + var message = $"Player {pair.PlayerName} ({pair.UserData.AliasOrUID}) exceeded your configured VRAM auto pause threshold and has been automatically paused\n" + + $"{UiSharedService.ByteToString(vramUsage, addSuffix: true)}/{config.VRAMSizeAutoPauseThresholdMiB}MiB"; _mediator.Publish(new PerformanceNotificationMessage( $"{pair.PlayerName} ({pair.UserData.AliasOrUID}) automatically paused", diff --git a/LightlessSync/UI/SettingsUi.cs b/LightlessSync/UI/SettingsUi.cs index 1272742..d5520e0 100644 --- a/LightlessSync/UI/SettingsUi.cs +++ b/LightlessSync/UI/SettingsUi.cs @@ -3661,7 +3661,7 @@ public class SettingsUi : WindowMediatorSubscriberBase var testUserData = new UserData("TEST123", "TestUser", false, false, false, null, null); Mediator.Publish(new PerformanceNotificationMessage( "Test Player (TestUser) exceeds performance threshold(s)", - "Player Test Player (TestUser) exceeds your configured VRAM warning threshold (500 MB/300 MB).", + "Player Test Player (TestUser) exceeds your configured VRAM warning threshold\n500 MB/300 MB", testUserData, false, "Test Player" diff --git a/LightlessSync/UI/TopTabMenu.cs b/LightlessSync/UI/TopTabMenu.cs index 2a6a236..b4327c0 100644 --- a/LightlessSync/UI/TopTabMenu.cs +++ b/LightlessSync/UI/TopTabMenu.cs @@ -196,82 +196,6 @@ public class TopTabMenu if (TabSelection != SelectedTab.None) ImGuiHelpers.ScaledDummy(3f); - #if DEBUG - if (ImGui.Button("Test Pair Request")) - { - _lightlessNotificationService.ShowPairRequestNotification( - "Debug User", - "debug-user-id", - onAccept: () => - { - _lightlessMediator.Publish(new NotificationMessage( - "Pair Accepted", - "Debug pair request was accepted!", - NotificationType.Info, - TimeSpan.FromSeconds(3))); - }, - onDecline: () => - { - _lightlessMediator.Publish(new NotificationMessage( - "Pair Declined", - "Debug pair request was declined.", - NotificationType.Warning, - TimeSpan.FromSeconds(3))); - } - ); - } - - ImGui.SameLine(); - if (ImGui.Button("Test Info")) - { - _lightlessMediator.Publish(new NotificationMessage( - "Information", - "This is a test ifno notification with some longer text to see how it wraps. This is a test ifno notification with some longer text to see how it wraps. This is a test ifno notification with some longer text to see how it wraps. This is a test ifno notification with some longer text to see how it wraps.", - NotificationType.Info, - TimeSpan.FromSeconds(5))); - } - - ImGui.SameLine(); - if (ImGui.Button("Test Warning")) - { - _lightlessMediator.Publish(new NotificationMessage( - "Warning", - "This is a test warning notification.", - NotificationType.Warning, - TimeSpan.FromSeconds(7))); - } - - ImGui.SameLine(); - if (ImGui.Button("Test Error")) - { - _lightlessMediator.Publish(new NotificationMessage( - "Error", - "This is a test error notification erp police", - NotificationType.Error, - TimeSpan.FromSeconds(10))); - } - - if (ImGui.Button("Test Download Progress")) - { - var downloadStatus = new List<(string playerName, float progress, string status)> - { - ("Mauwmauw Nekochan", 0.85f, "downloading"), - ("Raelynn Kitsune", 0.34f, "downloading"), - ("Jaina Elraeth", 0.67f, "downloading"), - ("Vaelstra Bloodthorn", 0.19f, "downloading"), - ("Lydia Hera Moondrop", 0.86f, "downloading"), - ("C'liina Star", 1.0f, "completed") - }; - - _lightlessNotificationService.ShowPairDownloadNotification(downloadStatus); - } - ImGui.SameLine(); - if (ImGui.Button("Dismiss Download")) - { - _lightlessNotificationService.DismissPairDownloadNotification(); - } - #endif - DrawIncomingPairRequests(availableWidth); ImGui.Separator();