Reverted method signature change

This commit is contained in:
David Higueros committed 2026-11-06 13:07:04 -07:00
1 parent 903f6250b6
commit 6fce7b20b3
2 files changed
+4 -3

No files matched your search

+2 -2
View File
@@ -138,12 +138,12 @@ public static class MiraEventManager
/// <summary>
/// Register a <see cref="MiraEvent"/> handler.
/// </summary>
/// <param name="type">The type of <see cref="MiraEvent"/> event.</param>
/// <param name="methodInfo">The <see cref="MethodInfo"/> of the event handler.</param>
/// <param name="priority">The priority of the event handler. Lower values are called first.</param>
/// <returns>A <see cref="MiraEventHandle"/> to use when unregistering the event.</returns>
public static MiraEventHandle RegisterEventHandler(MethodInfo methodInfo, int priority = 0)
public static MiraEventHandle RegisterEventHandler(Type type, MethodInfo methodInfo, int priority = 0)
{
Type type = methodInfo.GetParameters()[0].ParameterType;
if (!type.IsAssignableTo(typeof(MiraEvent)))
{
throw new InvalidOperationException($"Type must be a subclass of MiraEvent: {type.FullName}");
+2 -1
View File
@@ -197,7 +197,8 @@ public sealed class MiraPluginManager
continue;
}
MiraEventManager.RegisterEventHandler(method, eventAttribute.Priority);
var paramType = parameters[0].ParameterType;
MiraEventManager.RegisterEventHandler(paramType, method, eventAttribute.Priority);
}
}