mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-11-19 13:17:10 +00:00
Added signature as overload
This commit is contained in:
1 parent
6a25793599
commit
b94c1315c4
2 files changed
+12
-2
No files matched your search
@@ -153,6 +153,17 @@ public static class MiraEventManager
|
||||
return RegisterEventHandler(type, @delegate, priority);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Register a <see cref="MiraEvent"/> handler.
|
||||
/// </summary>
|
||||
/// <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)
|
||||
{
|
||||
return RegisterEventHandler(methodInfo.GetParameters()[0].ParameterType, methodInfo, priority);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Register a <typeparamref name="T"/> handler.
|
||||
/// </summary>
|
||||
|
||||
@@ -197,8 +197,7 @@ public sealed class MiraPluginManager
|
||||
continue;
|
||||
}
|
||||
|
||||
var paramType = parameters[0].ParameterType;
|
||||
MiraEventManager.RegisterEventHandler(paramType, method, eventAttribute.Priority);
|
||||
MiraEventManager.RegisterEventHandler(method, eventAttribute.Priority);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user