summaryrefslogtreecommitdiff
path: root/src/SMAPI/SButton.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/SButton.cs')
-rw-r--r--src/SMAPI/SButton.cs15
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);
+ }
}
}