diff options
-rw-r--r-- | docs/release-notes.md | 1 | ||||
-rw-r--r-- | src/SMAPI/Utilities/KeybindList.cs | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md index 4eb196b6..075dfe4d 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -18,6 +18,7 @@ * SMAPI now updates the NPC pathfinding cache when map warps are changed through the content API. * Reduced performance impact of invalidating cached assets before a save is loaded. * Fixed asset changes not reapplied in the edge case where you're playing in non-English, and the changes are only applied after the save is loaded, and the player returns to title and reloads a save, and the game reloads the target asset before the save is loaded. + * Added a second `KeybindList` constructor to simplify single-key default bindings. ## 3.9.4 Released 07 March 2021 for Stardew Valley 1.5.4 or later. diff --git a/src/SMAPI/Utilities/KeybindList.cs b/src/SMAPI/Utilities/KeybindList.cs index 1845285a..28cae240 100644 --- a/src/SMAPI/Utilities/KeybindList.cs +++ b/src/SMAPI/Utilities/KeybindList.cs @@ -30,6 +30,11 @@ namespace StardewModdingAPI.Utilities this.IsBound = this.Keybinds.Any(); } + /// <summary>Construct an instance.</summary> + /// <param name="singleKey">A single-key binding.</param> + public KeybindList(SButton singleKey) + : this(new Keybind(singleKey)) { } + /// <summary>Parse a keybind list from a string, and throw an exception if it's not valid.</summary> /// <param name="input">The keybind string. See remarks on <see cref="ToString"/> for format details.</param> /// <exception cref="FormatException">The <paramref name="input"/> format is invalid.</exception> |