fix typos and key not found

This commit is contained in:
Az committed 2026-11-11 01:40:49 -05:00
1 parent fc7a1b182e
commit 881ad4de70
3 files changed
+12 -12

No files matched your search

+4 -4
View File
@@ -16,18 +16,18 @@ public class MiraEventHandle
/// <summary>
/// Gets the priority of the handler. Lower values are called first.
/// </summary>
internal int Priority { get; }
public int Priority { get; }
/// <summary>
/// Gets the event handler delegate.
/// </summary>
internal Delegate EventHandler { get; }
public Delegate EventHandler { get; }
/// <summary>
/// Gets a value indicating whether the event handler should also be
/// tirggered by subclasses of <see cref="EventType"/>.
/// triggered by subclasses of <see cref="EventType"/>.
/// </summary>
internal bool InvokeOnSubtype { get; }
public bool InvokeOnSubtype { get; }
internal MiraEventHandle(Delegate eventHandler, int priority, Type type, bool invokeOnSubtype)
{
+6 -6
View File
@@ -27,7 +27,7 @@ public static class MiraEventManager
private static readonly Dictionary<Type, HashSet<Type>> TrackedEventTypes = [];
private static bool loadFinilized = false;
private static bool loadFinalized = false;
/// <summary>
/// Invoke a <see cref="MiraEvent"/>.
@@ -77,7 +77,7 @@ public static class MiraEventManager
internal static bool RegisterEventType(Type eventType, MiraPluginInfo info)
{
if (!eventType.IsSubclassOf(typeof(MiraEvent)))
if (eventType.IsAbstract || !eventType.IsSubclassOf(typeof(MiraEvent)))
{
return false;
}
@@ -243,7 +243,7 @@ public static class MiraEventManager
private static void EventHandlerAdded(Type type, MiraEventHandle eventHandler)
{
if (!loadFinilized)
if (!loadFinalized)
{
EventHandlersToLoad.TryAdd(type, []);
EventHandlersToLoad[type].Add(eventHandler);
@@ -277,7 +277,7 @@ public static class MiraEventManager
/// <returns><see langword="true"/> if the event was unregistered successfully, <see langword="false"/> otherwise.</returns>
public static bool UnregisterEventHandler(MiraEventHandle eventHandle)
{
if (!loadFinilized)
if (!loadFinalized)
{
if (!EventHandlersToLoad.TryGetValue(eventHandle.EventType, out var handlersToLoad))
{
@@ -311,9 +311,9 @@ public static class MiraEventManager
return removed;
}
internal static void OnLoadFinilize()
internal static void OnLoadFinalize()
{
loadFinilized = true;
loadFinalized = true;
EventTypes = new ReadOnlyCollection<Type>(InternalEventTypes);
foreach (var eventType in EventTypes)
+2 -2
View File
@@ -104,7 +104,7 @@ public sealed class MiraPluginManager
PluginsWithOptionsOrGameModes = [.. RegisteredPlugins.Where(m => m.MiraPlugin.DisplayOnOptionsMenu || m.GameModes.Count > 0)];
ModifierManager.Modifiers = new ReadOnlyCollection<BaseModifier>(ModifierManager.InternalModifiers);
MiraEventManager.OnLoadFinilize();
MiraEventManager.OnLoadFinalize();
};
}
@@ -143,7 +143,7 @@ public sealed class MiraPluginManager
{
if (plugin.ForceRegisterEvents)
{
Warning("For optimisation reasons, MiraAPI no longer automatically searches every type for events. Please use RegisterEventsAttribute moving forward.");
Warning("For optimisation reasons, MiraAPI no longer automatically searches every type for events. Please use RegisterEventContainerAttribute moving forward.");
}
foreach (var type in assembly.GetTypes())