summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework')
-rw-r--r--src/SMAPI/Framework/SCore.cs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs
index 99a809ad..06d9eac1 100644
--- a/src/SMAPI/Framework/SCore.cs
+++ b/src/SMAPI/Framework/SCore.cs
@@ -142,6 +142,9 @@ namespace StardewModdingAPI.Framework
/// <summary>Whether the game is creating the save file and SMAPI has already raised <see cref="IGameLoopEvents.SaveCreating"/>.</summary>
private bool IsBetweenCreateEvents;
+ /// <summary>Whether the player just returned to the title screen.</summary>
+ private bool JustReturnedToTitle;
+
/// <summary>Asset interceptors added or removed since the last tick.</summary>
private readonly List<AssetInterceptorChange> ReloadAssetInterceptorsQueue = new List<AssetInterceptorChange>();
@@ -456,9 +459,17 @@ namespace StardewModdingAPI.Framework
try
{
+ /*********
+ ** Safe queued work
+ *********/
+ // print warnings/alerts
SCore.DeprecationManager.PrintQueued();
SCore.PerformanceMonitor.PrintQueuedAlerts();
+ // reapply overrides
+ if (this.JustReturnedToTitle && !(Game1.mapDisplayDevice is SDisplayDevice))
+ Game1.mapDisplayDevice = new SDisplayDevice(Game1.content, Game1.game1.GraphicsDevice);
+
/*********
** First-tick initialization
*********/
@@ -1039,8 +1050,7 @@ namespace StardewModdingAPI.Framework
{
// perform cleanup
this.Multiplayer.CleanupOnMultiplayerExit();
- if (!(Game1.mapDisplayDevice is SDisplayDevice))
- Game1.mapDisplayDevice = new SDisplayDevice(Game1.content, Game1.game1.GraphicsDevice);
+ this.JustReturnedToTitle = true;
}
/// <summary>Raised before the game exits.</summary>