diff options
Diffstat (limited to 'src/SMAPI/Framework')
-rw-r--r-- | src/SMAPI/Framework/Input/SInputState.cs | 16 | ||||
-rw-r--r-- | 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 /// <summary>Whether there are new overrides in <see cref="CustomPressedKeys"/> or <see cref="CustomReleasedKeys"/> that haven't been applied to the previous state.</summary> private bool HasNewOverrides; - /// <summary>The game tick when the input state was last updated.</summary> - private uint? LastUpdateTick; - /********* ** Accessors @@ -55,14 +52,13 @@ namespace StardewModdingAPI.Framework.Input /********* ** Public methods *********/ - /// <summary>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).</summary> - public override void Update() - { - // skip if already updated - if (this.LastUpdateTick == SCore.TicksElapsed) - return; - this.LastUpdateTick = SCore.TicksElapsed; + /// <summary>This method is called by the game, and does nothing since SMAPI will already have updated by that point.</summary> + [Obsolete("This method should only be called by the game itself.")] + public override void Update() { } + /// <summary>Update the current button states for the given tick.</summary> + 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 |