diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-09-16 21:33:53 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-09-16 21:33:53 -0400 |
commit | de84adb47751c96fc60be66f6fdb186a09160820 (patch) | |
tree | 5c09422db13fba3c9a231308def6913188989946 /src/SMAPI/Framework/SCore.cs | |
parent | 44e91ca5e1527333fdbd2993b694cc17601293e3 (diff) | |
parent | 59974c18a6fb6f8f2e7e3a8c5df109e060fc5ae6 (diff) | |
download | SMAPI-de84adb47751c96fc60be66f6fdb186a09160820.tar.gz SMAPI-de84adb47751c96fc60be66f6fdb186a09160820.tar.bz2 SMAPI-de84adb47751c96fc60be66f6fdb186a09160820.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Framework/SCore.cs')
-rw-r--r-- | src/SMAPI/Framework/SCore.cs | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 8be62ccf..e64c2801 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -43,6 +43,7 @@ using StardewModdingAPI.Toolkit.Serialization; using StardewModdingAPI.Toolkit.Utilities; using StardewModdingAPI.Utilities; using StardewValley; +using xTile.Display; using SObject = StardewValley.Object; namespace StardewModdingAPI.Framework @@ -472,8 +473,13 @@ namespace StardewModdingAPI.Framework SCore.PerformanceMonitor.PrintQueuedAlerts(); // reapply overrides - if (this.JustReturnedToTitle && !(Game1.mapDisplayDevice is SDisplayDevice)) - Game1.mapDisplayDevice = new SDisplayDevice(Game1.content, Game1.game1.GraphicsDevice); + if (this.JustReturnedToTitle) + { + if (!(Game1.mapDisplayDevice is SDisplayDevice)) + Game1.mapDisplayDevice = this.GetMapDisplayDevice(); + + this.JustReturnedToTitle = false; + } /********* ** First-tick initialization @@ -975,7 +981,7 @@ namespace StardewModdingAPI.Framework } catch (Exception ex) { - this.LogManager.MonitorForGame.Log($"An error occured in the base update loop: {ex.GetLogSummary()}", LogLevel.Error); + this.LogManager.MonitorForGame.Log($"An error occurred in the base update loop: {ex.GetLogSummary()}", LogLevel.Error); } events.UnvalidatedUpdateTicked.RaiseEmpty(); @@ -992,7 +998,7 @@ namespace StardewModdingAPI.Framework catch (Exception ex) { // log error - this.Monitor.Log($"An error occured in the overridden update loop: {ex.GetLogSummary()}", LogLevel.Error); + this.Monitor.Log($"An error occurred in the overridden update loop: {ex.GetLogSummary()}", LogLevel.Error); // exit if irrecoverable if (!this.UpdateCrashTimer.Decrement()) @@ -1738,6 +1744,13 @@ namespace StardewModdingAPI.Framework return translations; } + /// <summary>Get the map display device which applies SMAPI features like tile rotation to loaded maps.</summary> + /// <remarks>This is separate to let mods like PyTK wrap it with their own functionality.</remarks> + private IDisplayDevice GetMapDisplayDevice() + { + return new SDisplayDevice(Game1.content, Game1.game1.GraphicsDevice); + } + /// <summary>Get the absolute path to the next available log file.</summary> private string GetLogPath() { |