Add IFramework (#1286)

This commit is contained in:
MidoriKami 2023-09-10 13:19:44 -07:00 committed by GitHub
parent 342e1bc06c
commit 385c4b7a8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 150 additions and 87 deletions

View file

@ -2,6 +2,7 @@ using System;
using System.Linq;
using Dalamud.Game;
using Dalamud.Plugin.Services;
using Serilog;
using static Dalamud.Game.Framework;
@ -72,12 +73,12 @@ internal static class EventHandlerExtensions
/// </summary>
/// <param name="updateDelegate">The OnUpdateDelegate in question.</param>
/// <param name="framework">Framework to be passed on to OnUpdateDelegate.</param>
public static void InvokeSafely(this OnUpdateDelegate updateDelegate, Framework framework)
public static void InvokeSafely(this IFramework.OnUpdateDelegate updateDelegate, Framework framework)
{
if (updateDelegate == null)
return;
foreach (var action in updateDelegate.GetInvocationList().Cast<OnUpdateDelegate>())
foreach (var action in updateDelegate.GetInvocationList().Cast<IFramework.OnUpdateDelegate>())
{
HandleInvoke(() => action(framework));
}