mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-17 21:37:43 +01:00
Merge pull request #1410 from Haselnussbomber/catch-draw-exception
This commit is contained in:
commit
035ee008cf
1 changed files with 12 additions and 1 deletions
|
|
@ -1,7 +1,9 @@
|
||||||
|
using System;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
|
||||||
using Dalamud.Configuration.Internal;
|
using Dalamud.Configuration.Internal;
|
||||||
using Dalamud.Game.ClientState.Keys;
|
using Dalamud.Game.ClientState.Keys;
|
||||||
|
using Dalamud.Logging.Internal;
|
||||||
using FFXIVClientStructs.FFXIV.Client.UI;
|
using FFXIVClientStructs.FFXIV.Client.UI;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
|
|
||||||
|
|
@ -12,6 +14,8 @@ namespace Dalamud.Interface.Windowing;
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class Window
|
public abstract class Window
|
||||||
{
|
{
|
||||||
|
private static readonly ModuleLog Log = new("WindowSystem");
|
||||||
|
|
||||||
private static bool wasEscPressedLastFrame = false;
|
private static bool wasEscPressedLastFrame = false;
|
||||||
|
|
||||||
private bool internalLastIsOpen = false;
|
private bool internalLastIsOpen = false;
|
||||||
|
|
@ -284,7 +288,14 @@ public abstract class Window
|
||||||
if (this.ShowCloseButton ? ImGui.Begin(this.WindowName, ref this.internalIsOpen, this.Flags) : ImGui.Begin(this.WindowName, this.Flags))
|
if (this.ShowCloseButton ? ImGui.Begin(this.WindowName, ref this.internalIsOpen, this.Flags) : ImGui.Begin(this.WindowName, this.Flags))
|
||||||
{
|
{
|
||||||
// Draw the actual window contents
|
// Draw the actual window contents
|
||||||
this.Draw();
|
try
|
||||||
|
{
|
||||||
|
this.Draw();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.Error(ex, $"Error during Draw(): {this.WindowName}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wasFocused)
|
if (wasFocused)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue