From 398c7d66cb707f475b239c9ba5b06154fd518b49 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 8 Sep 2020 00:10:24 -0400 Subject: [PATCH 1/2] fix input handling issues in SMAPI 3.7 This commit reverses one of the input handling changes in 3.7 to fix... * input being handled twice in some cases (e.g. a left-click to drop a shop item with Better Shop Menu would instantly sell it); * an issue where Harvest With Scythe would cause the player to skid forward more than usual when scything crops; * possibly other reported issues including gamepad input lag. --- src/SMAPI/Framework/Input/SInputState.cs | 16 ++++++---------- src/SMAPI/Framework/SCore.cs | 4 ++-- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/SMAPI/Framework/Input/SInputState.cs b/src/SMAPI/Framework/Input/SInputState.cs index 3dfeb152..f618608a 100644 --- a/src/SMAPI/Framework/Input/SInputState.cs +++ b/src/SMAPI/Framework/Input/SInputState.cs @@ -29,9 +29,6 @@ namespace StardewModdingAPI.Framework.Input /// Whether there are new overrides in or that haven't been applied to the previous state. private bool HasNewOverrides; - /// The game tick when the input state was last updated. - private uint? LastUpdateTick; - /********* ** Accessors @@ -55,14 +52,13 @@ namespace StardewModdingAPI.Framework.Input /********* ** Public methods *********/ - /// Update the current button states for the given tick. This does nothing if the input has already been updated for this tick (e.g. because SMAPI updated it before the game update). - public override void Update() - { - // skip if already updated - if (this.LastUpdateTick == SCore.TicksElapsed) - return; - this.LastUpdateTick = SCore.TicksElapsed; + /// This method is called by the game, and does nothing since SMAPI will already have updated by that point. + [Obsolete("This method should only be called by the game itself.")] + public override void Update() { } + /// Update the current button states for the given tick. + public void TrueUpdate() + { // update base state base.Update(); diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 52b4b9cf..8be62ccf 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -423,7 +423,7 @@ namespace StardewModdingAPI.Framework private void OnGameInitialized() { // set initial state - this.Input.Update(); + this.Input.TrueUpdate(); // init watchers this.Watchers = new WatcherCore(this.Input, this.Game.GetObservableLocations()); @@ -492,7 +492,7 @@ namespace StardewModdingAPI.Framework // user from doing anything on the overnight shipping screen. SInputState inputState = this.Input; if (this.Game.IsActive) - inputState.Update(); + inputState.TrueUpdate(); /********* ** Special cases From 1b5e7da1847776840c5a26a6254efa1ec43053de Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 8 Sep 2020 00:15:27 -0400 Subject: [PATCH 2/2] prepare for release --- build/common.targets | 2 +- docs/release-notes.md | 6 ++++++ src/SMAPI.Mods.ConsoleCommands/manifest.json | 4 ++-- src/SMAPI.Mods.SaveBackup/manifest.json | 4 ++-- src/SMAPI/Constants.cs | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/build/common.targets b/build/common.targets index 021e1fe6..d348b28c 100644 --- a/build/common.targets +++ b/build/common.targets @@ -4,7 +4,7 @@ - 3.7.0 + 3.7.1 SMAPI latest diff --git a/docs/release-notes.md b/docs/release-notes.md index 4671ba95..477a206c 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -7,6 +7,12 @@ * Migrated to Harmony 2.0 (see [_migrate to Harmony 2.0_](https://stardewvalleywiki.com/Modding:Migrate_to_Harmony_2.0) for more info). --> +## 3.7.1 +Released 08 September 2020 for Stardew Valley 1.4.1 or later. + +* For players: + * Fixed input-handling bugs in 3.7. + ## 3.7 Released 07 September 2020 for Stardew Valley 1.4.1 or later. See [release highlights](https://www.patreon.com/posts/41341767). diff --git a/src/SMAPI.Mods.ConsoleCommands/manifest.json b/src/SMAPI.Mods.ConsoleCommands/manifest.json index 368f470c..c3560466 100644 --- a/src/SMAPI.Mods.ConsoleCommands/manifest.json +++ b/src/SMAPI.Mods.ConsoleCommands/manifest.json @@ -1,9 +1,9 @@ { "Name": "Console Commands", "Author": "SMAPI", - "Version": "3.7.0", + "Version": "3.7.1", "Description": "Adds SMAPI console commands that let you manipulate the game.", "UniqueID": "SMAPI.ConsoleCommands", "EntryDll": "ConsoleCommands.dll", - "MinimumApiVersion": "3.7.0" + "MinimumApiVersion": "3.7.1" } diff --git a/src/SMAPI.Mods.SaveBackup/manifest.json b/src/SMAPI.Mods.SaveBackup/manifest.json index 8a95a78f..72e33fd1 100644 --- a/src/SMAPI.Mods.SaveBackup/manifest.json +++ b/src/SMAPI.Mods.SaveBackup/manifest.json @@ -1,9 +1,9 @@ { "Name": "Save Backup", "Author": "SMAPI", - "Version": "3.7.0", + "Version": "3.7.1", "Description": "Automatically backs up all your saves once per day into its folder.", "UniqueID": "SMAPI.SaveBackup", "EntryDll": "SaveBackup.dll", - "MinimumApiVersion": "3.7.0" + "MinimumApiVersion": "3.7.1" } diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 858e832f..7540061d 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -51,7 +51,7 @@ namespace StardewModdingAPI ** Public ****/ /// SMAPI's current semantic version. - public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("3.7.0"); + public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("3.7.1"); /// The minimum supported version of Stardew Valley. public static ISemanticVersion MinimumGameVersion { get; } = new GameVersion("1.4.1");