diff --git a/MiraAPI/Hud/CustomActionButton.cs b/MiraAPI/Hud/CustomActionButton.cs index c197a746..7763aac0 100644 --- a/MiraAPI/Hud/CustomActionButton.cs +++ b/MiraAPI/Hud/CustomActionButton.cs @@ -166,7 +166,7 @@ public abstract class CustomActionButton // Invoke the generic button click event. var genericEvent = new MiraButtonClickEvent(this); genericEvent.InvokeEvent(); - if (genericEvent.IsCancelled) MiraEventManager.InvokeEvent(new MiraButtonCancelledEvent(this)); + if (genericEvent.IsCancelled) new MiraButtonCancelledEvent(this).InvokeEvent(); // Invoke the button click event for specific button. var eventType = CustomButtonManager.ButtonEventTypes[GetType()]; diff --git a/MiraAPI/Patches/Events/FreeplayRoundStartPatch.cs b/MiraAPI/Patches/Events/FreeplayRoundStartPatch.cs index 8427679d..a05bb936 100644 --- a/MiraAPI/Patches/Events/FreeplayRoundStartPatch.cs +++ b/MiraAPI/Patches/Events/FreeplayRoundStartPatch.cs @@ -19,6 +19,6 @@ public static class FreeplayRoundStartPatch { if (__result) return; MeetingButtonManager.OnGameStart(); - MiraEventManager.InvokeEvent(new RoundStartEvent(true)); + new RoundStartEvent(true).InvokeEvent(); } } diff --git a/MiraAPI/Patches/Events/VanillaButtonPatches.cs b/MiraAPI/Patches/Events/VanillaButtonPatches.cs index 3b882da7..070c6c7e 100644 --- a/MiraAPI/Patches/Events/VanillaButtonPatches.cs +++ b/MiraAPI/Patches/Events/VanillaButtonPatches.cs @@ -69,7 +69,7 @@ public static class VanillaButtonPatches genericEvent.InvokeEvent(); if (genericEvent.IsCancelled) { - MiraEventManager.InvokeEvent(new VanillaButtonCancelledEvent(__instance)); + new VanillaButtonCancelledEvent(__instance).InvokeEvent(); } var eventType = typeof(VanillaButtonClickEvent<>).MakeGenericType(__instance.GetType()); diff --git a/MiraAPI/Patches/IntroCutscenePatches.cs b/MiraAPI/Patches/IntroCutscenePatches.cs index 47f4de8b..dfd668c8 100644 --- a/MiraAPI/Patches/IntroCutscenePatches.cs +++ b/MiraAPI/Patches/IntroCutscenePatches.cs @@ -135,13 +135,13 @@ public static class IntroCutscenePatches Info("IntroCutscene ended"); MeetingButtonManager.OnGameStart(); - MiraEventManager.InvokeEvent(new IntroEndEvent(introCutscene)); + new IntroEndEvent(introCutscene).InvokeEvent(); var @event = new BeforeRoundStartEvent(true); @event.InvokeEvent(); if (@event.IsCancelled) return; - MiraEventManager.InvokeEvent(new RoundStartEvent(true)); + new RoundStartEvent(true).InvokeEvent(); } } } diff --git a/MiraAPI/Patches/Voting/MeetingHudPatches.cs b/MiraAPI/Patches/Voting/MeetingHudPatches.cs index 3f3f6c82..af3c4b1a 100644 --- a/MiraAPI/Patches/Voting/MeetingHudPatches.cs +++ b/MiraAPI/Patches/Voting/MeetingHudPatches.cs @@ -106,7 +106,7 @@ internal static class MeetingHudPatches [HarmonyPatch(nameof(MeetingHud.OnDestroy))] public static void OnDestroyPatch(MeetingHud __instance) { - MiraEventManager.InvokeEvent(new EndMeetingEvent(__instance)); + new EndMeetingEvent(__instance).InvokeEvent(); } [HarmonyPostfix] @@ -123,7 +123,7 @@ internal static class MeetingHudPatches } } - MiraEventManager.InvokeEvent(new VotingCompleteEvent(__instance)); + new VotingCompleteEvent(__instance).InvokeEvent(); } // this is necessary because the actual ForceSkipAll method is inlined.