feat(ux): show notification on chat log draw failure (F7.1)

Surfaces a per-session warning notification when DrawChatLog throws so
the user knows something went wrong instead of staring at an empty
window. Stack trace stays in /xllog as before. The one-shot guard
prevents the notification stack from flooding frame-by-frame; it
resets only on the next plugin reload.
This commit is contained in:
2026-05-12 13:22:24 +02:00
parent 3e4601a0c8
commit 4ecbaf2a4b
+17
View File
@@ -90,6 +90,10 @@ public sealed class ChatLogWindow : Window
private bool PlayedClosingSound = true; private bool PlayedClosingSound = true;
private bool DrewThisFrame; private bool DrewThisFrame;
// F7.1: one-shot guard so a recurring draw failure doesn't spam the
// notification stack frame-by-frame. Resets only on next plugin reload.
private bool _notifiedDrawFailure;
private long FrameTime; // set every frame private long FrameTime; // set every frame
internal long LastActivityTime = Environment.TickCount64; internal long LastActivityTime = Environment.TickCount64;
@@ -627,6 +631,19 @@ public sealed class ChatLogWindow : Window
catch (Exception ex) catch (Exception ex)
{ {
Plugin.Log.Error(ex, "Error drawing Chat Log window"); Plugin.Log.Error(ex, "Error drawing Chat Log window");
if (!_notifiedDrawFailure)
{
Plugin.Notification.AddNotification(
new Dalamud.Interface.ImGuiNotification.Notification
{
Title = "Hellion Chat",
Content = "A drawing error occurred. Check /xllog for details.",
Type = Dalamud.Interface.ImGuiNotification.NotificationType.Warning,
InitialDuration = TimeSpan.FromSeconds(20),
}
);
_notifiedDrawFailure = true;
}
// Prevent recurring draw failures from constantly trying to grab // Prevent recurring draw failures from constantly trying to grab
// input focus, which breaks every other ImGui window. // input focus, which breaks every other ImGui window.
Activate = false; Activate = false;