diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-02-28 14:22:30 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-02-28 14:22:30 -0500 |
commit | 5ce096c89a15e74102c2741672a4a75afed47ddb (patch) | |
tree | ce48ae728e05a5879fed272df66777d71fbedd74 /src/SMAPI/Framework | |
parent | b2d47e29ffe58142efd0a5084f33fefffd87a460 (diff) | |
download | SMAPI-5ce096c89a15e74102c2741672a4a75afed47ddb.tar.gz SMAPI-5ce096c89a15e74102c2741672a4a75afed47ddb.tar.bz2 SMAPI-5ce096c89a15e74102c2741672a4a75afed47ddb.zip |
fix edge case for non-English farmhands where content coordinator handled return to title too late
Diffstat (limited to 'src/SMAPI/Framework')
-rw-r--r-- | src/SMAPI/Framework/SCore.cs | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 2d783eb2..5df4b61b 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -1054,17 +1054,24 @@ namespace StardewModdingAPI.Framework LoadStage oldStage = Context.LoadStage; Context.LoadStage = newStage; this.Monitor.VerboseLog($"Context: load stage changed to {newStage}"); - if (newStage == LoadStage.None) - { - this.Monitor.Log("Context: returned to title"); - this.OnReturnedToTitle(); - } - // override chatbox - if (newStage == LoadStage.Loaded) + // handle stages + switch (newStage) { - Game1.onScreenMenus.Remove(Game1.chatBox); - Game1.onScreenMenus.Add(Game1.chatBox = new SChatBox(this.LogManager.MonitorForGame)); + case LoadStage.ReturningToTitle: + this.Monitor.Log("Context: returning to title"); + this.OnReturningToTitle(); + break; + + case LoadStage.None: + this.JustReturnedToTitle = true; + break; + + case LoadStage.Loaded: + // override chatbox + Game1.onScreenMenus.Remove(Game1.chatBox); + Game1.onScreenMenus.Add(Game1.chatBox = new SChatBox(this.LogManager.MonitorForGame)); + break; } // raise events @@ -1113,13 +1120,12 @@ namespace StardewModdingAPI.Framework this.EventManager.DayEnding.RaiseEmpty(); } - /// <summary>Raised after the player returns to the title screen.</summary> - private void OnReturnedToTitle() + /// <summary>Raised immediately before the player returns to the title screen.</summary> + private void OnReturningToTitle() { // perform cleanup this.Multiplayer.CleanupOnMultiplayerExit(); this.ContentCore.OnReturningToTitleScreen(); - this.JustReturnedToTitle = true; } /// <summary>Raised before the game exits.</summary> |