From 136bbde516f34a5fd2a005490cc42e8bcb3ffc34 Mon Sep 17 00:00:00 2001 From: Atony <75191600+AtonyGit@users.noreply.github.com> Date: Sat, 29 Nov 2025 13:40:21 -0600 Subject: [PATCH] Fix MaxUses check --- MiraAPI/Hud/CustomActionButton.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/MiraAPI/Hud/CustomActionButton.cs b/MiraAPI/Hud/CustomActionButton.cs index 9f4444b..1d256e8 100644 --- a/MiraAPI/Hud/CustomActionButton.cs +++ b/MiraAPI/Hud/CustomActionButton.cs @@ -64,9 +64,14 @@ public abstract class CustomActionButton public virtual float EffectDuration => 0; /// - /// Gets the maximum amount of uses the button has. If the button has infinite uses, set to 0. + /// Gets a value indicating whether the button has limited uses. /// - public virtual int MaxUses => 0; + public bool LimitedUses => ZeroIsInfinite ? MaxUses > 0 : MaxUses >= 0; + + /// + /// Gets the maximum number of uses the button has. If the button has infinite uses, set to 0 or -1 based on what value that ZeroIsInfinite is set to. + /// + public virtual int MaxUses => ZeroIsInfinite ? 0 : -1; /// /// Gets the value indicating uses mode. @@ -88,11 +93,6 @@ public abstract class CustomActionButton /// public virtual ButtonLocation Location { get; set; } = ButtonLocation.BottomLeft; - /// - /// Gets a value indicating whether the button has limited uses. - /// - public bool LimitedUses => ZeroIsInfinite ? MaxUses > 0 : MaxUses >= 0; - /// /// Gets or sets a value indicating whether limited uses are determined via zero or a negative number of uses. ///