diff --git a/MiraAPI.Example/Buttons/Freezer/FreezeButton.cs b/MiraAPI.Example/Buttons/Freezer/FreezeButton.cs index 726c16f..85edad2 100644 --- a/MiraAPI.Example/Buttons/Freezer/FreezeButton.cs +++ b/MiraAPI.Example/Buttons/Freezer/FreezeButton.cs @@ -16,6 +16,7 @@ public class FreezeButton : CustomActionButton public override string Name => "Freeze"; public override float Cooldown => OptionGroupSingleton.Instance.FreezeDuration; + public override bool PauseTimerInVent => true; public override LoadableAsset Sprite => ExampleAssets.ExampleButton; public override KeyboardKeyCode? DefaultKeybind => KeyboardKeyCode.T; diff --git a/MiraAPI/Hud/CustomActionButton.cs b/MiraAPI/Hud/CustomActionButton.cs index 1c93188..4510e43 100644 --- a/MiraAPI/Hud/CustomActionButton.cs +++ b/MiraAPI/Hud/CustomActionButton.cs @@ -36,6 +36,12 @@ public abstract class CustomActionButton /// public abstract float Cooldown { get; } + /// + /// Gets a value indicating whether the timer should stop decreasing when the player is venting. + /// Note that both cooldown decrease and effect timer decrease is disabled. + /// + public virtual bool PauseTimerInVent => false; + /// /// Gets the sprite of the button. Use to load a sprite from a resource path. Use to load a sprite from an asset bundle. /// @@ -504,7 +510,7 @@ public abstract class CustomActionButton if (Timer >= 0) { - if (!TimerPaused) + if (!TimerPaused && (!PauseTimerInVent || !playerControl.inVent)) { Timer -= Time.deltaTime; }