add PauseTimerInVent

This commit is contained in:
xChipseq committed 2025-08-29 14:32:13 +02:00
1 parent e6d3819517
commit a6f7171b71
2 files changed
+8 -1

No files matched your search

@@ -16,6 +16,7 @@ public class FreezeButton : CustomActionButton<PlayerControl>
public override string Name => "Freeze";
public override float Cooldown => OptionGroupSingleton<FreezerRoleSettings>.Instance.FreezeDuration;
public override bool PauseTimerInVent => true;
public override LoadableAsset<Sprite> Sprite => ExampleAssets.ExampleButton;
public override KeyboardKeyCode? DefaultKeybind => KeyboardKeyCode.T;
+7 -1
View File
@@ -36,6 +36,12 @@ public abstract class CustomActionButton
/// </summary>
public abstract float Cooldown { get; }
/// <summary>
/// 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.
/// </summary>
public virtual bool PauseTimerInVent => false;
/// <summary>
/// Gets the sprite of the button. Use <see cref="LoadableResourceAsset"/> to load a sprite from a resource path. Use <see cref="LoadableBundleAsset{T}"/> to load a sprite from an asset bundle.
/// </summary>
@@ -504,7 +510,7 @@ public abstract class CustomActionButton
if (Timer >= 0)
{
if (!TimerPaused)
if (!TimerPaused && (!PauseTimerInVent || !playerControl.inVent))
{
Timer -= Time.deltaTime;
}