diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-04-22 15:05:08 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-04-22 15:05:08 -0400 |
commit | 902814d308289f169750a615ae573edc348893d3 (patch) | |
tree | 1c39629e16a115df34a3bcdc9d65e6d317594806 /src/SMAPI/Framework/Input/InputState.cs | |
parent | 8e9b3741734e32a559b79326f850585a0132e08d (diff) | |
download | SMAPI-902814d308289f169750a615ae573edc348893d3.tar.gz SMAPI-902814d308289f169750a615ae573edc348893d3.tar.bz2 SMAPI-902814d308289f169750a615ae573edc348893d3.zip |
don't send chatbox input to mods (#453)
Diffstat (limited to 'src/SMAPI/Framework/Input/InputState.cs')
-rw-r--r-- | src/SMAPI/Framework/Input/InputState.cs | 7 |
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) |