From 8fe58ca6cad72edddc2883a0244266cfd31169cf Mon Sep 17 00:00:00 2001
From: XtraCube <72575280+XtraCube@users.noreply.github.com>
Date: Sat, 31 Aug 2024 15:12:39 -0400
Subject: [PATCH] reset buttons on meeting start
---
MiraAPI/Patches/MeetingHudPatches.cs | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
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
+}