diff --git a/MiraAPI/Patches/MeetingHudPatches.cs b/MiraAPI/Patches/MeetingHudPatches.cs index e813730..6abe4c0 100644 --- a/MiraAPI/Patches/MeetingHudPatches.cs +++ b/MiraAPI/Patches/MeetingHudPatches.cs @@ -3,9 +3,28 @@ using MiraAPI.Hud; namespace MiraAPI.Patches; +/// +/// Harmony patches for the MeetingHud class. +/// [HarmonyPatch(typeof(MeetingHud))] public static class MeetingHudPatches { + /// + /// Resets the cooldown and effect of all custom buttons when the meeting starts. + /// + [HarmonyPostfix] + [HarmonyPatch(nameof(MeetingHud.Start))] + public static void StartPostfix() + { + foreach (var customActionButton in CustomButtonManager.CustomButtons) + { + customActionButton.ResetCooldownAndOrEffect(); + } + } + + /// + /// Resets the cooldown and effect of all custom buttons when the voting is complete. + /// [HarmonyPostfix] [HarmonyPatch(nameof(MeetingHud.VotingComplete))] public static void VotingCompletePostfix() @@ -15,4 +34,4 @@ public static class MeetingHudPatches customActionButton.ResetCooldownAndOrEffect(); } } -} \ No newline at end of file +}