diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-01-24 11:44:28 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-01-24 11:44:28 -0500 |
commit | 0da5dab8932c53ba39f2290268294e9a72b9c5bb (patch) | |
tree | 9302a2a53a68202ac97e86662394a509df499541 /src/SMAPI/SButton.cs | |
parent | 15d4b6310e3dd15c62f3faedbf1290b2db26fb59 (diff) | |
parent | 5c96a10da5801049ee17ffa185dbf19e6d8a2306 (diff) | |
download | SMAPI-0da5dab8932c53ba39f2290268294e9a72b9c5bb.tar.gz SMAPI-0da5dab8932c53ba39f2290268294e9a72b9c5bb.tar.bz2 SMAPI-0da5dab8932c53ba39f2290268294e9a72b9c5bb.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/SButton.cs')
-rw-r--r-- | src/SMAPI/SButton.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/SMAPI/SButton.cs b/src/SMAPI/SButton.cs index bd6635c7..3f95169a 100644 --- a/src/SMAPI/SButton.cs +++ b/src/SMAPI/SButton.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using Microsoft.Xna.Framework.Input; using StardewValley; @@ -683,5 +684,19 @@ namespace StardewModdingAPI button = default(InputButton); return false; } + + /// <summary>Get whether the given button is equivalent to <see cref="Options.useToolButton"/>.</summary> + /// <param name="input">The button.</param> + public static bool IsUseToolButton(this SButton input) + { + return input == SButton.ControllerX || Game1.options.useToolButton.Any(p => p.ToSButton() == input); + } + + /// <summary>Get whether the given button is equivalent to <see cref="Options.actionButton"/>.</summary> + /// <param name="input">The button.</param> + public static bool IsActionButton(this SButton input) + { + return input == SButton.ControllerA || Game1.options.actionButton.Any(p => p.ToSButton() == input); + } } } |