mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-18 13:57:43 +01:00
add exception handling for some event delegates
This commit is contained in:
parent
805133c9fe
commit
652b357341
8 changed files with 166 additions and 100 deletions
|
|
@ -773,7 +773,7 @@ namespace Dalamud.Interface.Internal
|
|||
var customFontFirstConfigIndex = ioFonts.ConfigData.Size;
|
||||
|
||||
Log.Verbose("[FONT] Invoke OnBuildFonts");
|
||||
this.BuildFonts?.Invoke();
|
||||
this.BuildFonts?.Raise();
|
||||
Log.Verbose("[FONT] OnBuildFonts OK!");
|
||||
|
||||
for (int i = customFontFirstConfigIndex, i_ = ioFonts.ConfigData.Size; i < i_; i++)
|
||||
|
|
@ -881,7 +881,7 @@ namespace Dalamud.Interface.Internal
|
|||
}
|
||||
|
||||
Log.Verbose("[FONT] Invoke OnAfterBuildFonts");
|
||||
this.AfterBuildFonts?.Invoke();
|
||||
this.AfterBuildFonts?.Raise();
|
||||
Log.Verbose("[FONT] OnAfterBuildFonts OK!");
|
||||
|
||||
if (ioFonts.Fonts[0].NativePtr != DefaultFont.NativePtr)
|
||||
|
|
@ -978,7 +978,7 @@ namespace Dalamud.Interface.Internal
|
|||
Log.Verbose($"Calling resizebuffers swap@{swapChain.ToInt64():X}{bufferCount} {width} {height} {newFormat} {swapChainFlags}");
|
||||
#endif
|
||||
|
||||
this.ResizeBuffers?.Invoke();
|
||||
this.ResizeBuffers?.Raise();
|
||||
|
||||
// We have to ensure we're working with the main swapchain,
|
||||
// as viewports might be resizing as well
|
||||
|
|
@ -1105,7 +1105,7 @@ namespace Dalamud.Interface.Internal
|
|||
var snap = ImGuiManagedAsserts.GetSnapshot();
|
||||
|
||||
if (this.IsDispatchingEvents)
|
||||
this.Draw?.Invoke();
|
||||
this.Draw?.Raise();
|
||||
|
||||
ImGuiManagedAsserts.ReportProblems("Dalamud Core", snap);
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ using Dalamud.Interface.GameFonts;
|
|||
using Dalamud.Interface.Internal;
|
||||
using Dalamud.Interface.Internal.ManagedAsserts;
|
||||
using Dalamud.Interface.Internal.Notifications;
|
||||
using Dalamud.Utility;
|
||||
using ImGuiNET;
|
||||
using ImGuiScene;
|
||||
using Serilog;
|
||||
|
|
@ -392,7 +393,7 @@ namespace Dalamud.Interface
|
|||
/// </summary>
|
||||
internal void OpenConfig()
|
||||
{
|
||||
this.OpenConfigUi?.Invoke();
|
||||
this.OpenConfigUi?.Raise();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -400,7 +401,7 @@ namespace Dalamud.Interface
|
|||
/// </summary>
|
||||
internal void NotifyHideUi()
|
||||
{
|
||||
this.HideUi?.Invoke();
|
||||
this.HideUi?.Raise();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -408,7 +409,7 @@ namespace Dalamud.Interface
|
|||
/// </summary>
|
||||
internal void NotifyShowUi()
|
||||
{
|
||||
this.ShowUi?.Invoke();
|
||||
this.ShowUi?.Raise();
|
||||
}
|
||||
|
||||
private void OnDraw()
|
||||
|
|
@ -428,7 +429,7 @@ namespace Dalamud.Interface
|
|||
if (!this.lastFrameUiHideState)
|
||||
{
|
||||
this.lastFrameUiHideState = true;
|
||||
this.HideUi?.Invoke();
|
||||
this.HideUi?.Raise();
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
@ -437,7 +438,7 @@ namespace Dalamud.Interface
|
|||
if (this.lastFrameUiHideState)
|
||||
{
|
||||
this.lastFrameUiHideState = false;
|
||||
this.ShowUi?.Invoke();
|
||||
this.ShowUi?.Raise();
|
||||
}
|
||||
|
||||
if (!this.interfaceManager.FontsReady)
|
||||
|
|
@ -470,7 +471,7 @@ namespace Dalamud.Interface
|
|||
|
||||
try
|
||||
{
|
||||
this.Draw?.Invoke();
|
||||
this.Draw?.Raise();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -503,17 +504,17 @@ namespace Dalamud.Interface
|
|||
|
||||
private void OnBuildFonts()
|
||||
{
|
||||
this.BuildFonts?.Invoke();
|
||||
this.BuildFonts?.Raise();
|
||||
}
|
||||
|
||||
private void OnAfterBuildFonts()
|
||||
{
|
||||
this.AfterBuildFonts?.Invoke();
|
||||
this.AfterBuildFonts?.Raise();
|
||||
}
|
||||
|
||||
private void OnResizeBuffers()
|
||||
{
|
||||
this.ResizeBuffers?.Invoke();
|
||||
this.ResizeBuffers?.Raise();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue