reset buttons on meeting start

This commit is contained in:
XtraCube committed 2024-08-31 15:12:39 -04:00
1 parent 1d92404b0e
commit 8fe58ca6ca
1 file changed
+20 -1
+20 -1
View File
@@ -3,9 +3,28 @@ using MiraAPI.Hud;
namespace MiraAPI.Patches;
/// <summary>
/// Harmony patches for the MeetingHud class.
/// </summary>
[HarmonyPatch(typeof(MeetingHud))]
public static class MeetingHudPatches
{
/// <summary>
/// Resets the cooldown and effect of all custom buttons when the meeting starts.
/// </summary>
[HarmonyPostfix]
[HarmonyPatch(nameof(MeetingHud.Start))]
public static void StartPostfix()
{
foreach (var customActionButton in CustomButtonManager.CustomButtons)
{
customActionButton.ResetCooldownAndOrEffect();
}
}
/// <summary>
/// Resets the cooldown and effect of all custom buttons when the voting is complete.
/// </summary>
[HarmonyPostfix]
[HarmonyPatch(nameof(MeetingHud.VotingComplete))]
public static void VotingCompletePostfix()
@@ -15,4 +34,4 @@ public static class MeetingHudPatches
customActionButton.ResetCooldownAndOrEffect();
}
}
}
}