summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/Input/InputState.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/Input/InputState.cs')
-rw-r--r--src/SMAPI/Framework/Input/InputState.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/Input/InputState.cs b/src/SMAPI/Framework/Input/InputState.cs
index 8b0108ae..7c8676e9 100644
--- a/src/SMAPI/Framework/Input/InputState.cs
+++ b/src/SMAPI/Framework/Input/InputState.cs
@@ -72,6 +72,13 @@ namespace StardewModdingAPI.Framework.Input
return this.GetStatus(button).IsDown();
}
+ /// <summary>Get whether any of the given buttons were pressed or held.</summary>
+ /// <param name="buttons">The buttons to check.</param>
+ public bool IsAnyDown(InputButton[] buttons)
+ {
+ return buttons.Any(button => this.IsDown(button.ToSButton()));
+ }
+
/// <summary>Get the current input state.</summary>
/// <param name="previousState">The previous input state.</param>
public static InputState GetState(InputState previousState)