fix input freeze on shipping screen (#482)

This commit is contained in:
Jesse Plamondon-Willard 2018-04-30 21:46:05 -04:00
parent 6a3ff5f151
commit 82ad4cef0d
1 changed files with 12 additions and 5 deletions

View File

@ -210,6 +210,17 @@ namespace StardewModdingAPI.Framework
{ {
try try
{ {
/*********
** Update input
*********/
// This should *always* run, even when suppressing mod events, since the game uses
// this too. For example, doing this after mod event suppression would prevent the
// user from doing anything on the overnight shipping screen.
SInputState previousInputState = this.Input.Clone();
SInputState inputState = this.Input;
if (this.IsActive)
inputState.TrueUpdate();
/********* /*********
** Skip conditions ** Skip conditions
*********/ *********/
@ -388,12 +399,8 @@ namespace StardewModdingAPI.Framework
/********* /*********
** Input events (if window has focus) ** Input events (if window has focus)
*********/ *********/
if (Game1.game1.IsActive) if (this.IsActive)
{ {
SInputState previousInputState = this.Input.Clone();
SInputState inputState = this.Input;
inputState.TrueUpdate();
// raise events // raise events
bool isChatInput = Game1.IsChatting || (Context.IsMultiplayer && Context.IsWorldReady && Game1.activeClickableMenu == null && Game1.currentMinigame == null && inputState.IsAnyDown(Game1.options.chatButton)); bool isChatInput = Game1.IsChatting || (Context.IsMultiplayer && Context.IsWorldReady && Game1.activeClickableMenu == null && Game1.currentMinigame == null && inputState.IsAnyDown(Game1.options.chatButton));
if (!isChatInput) if (!isChatInput)