From 436eb95a8617cf6df061a61b66d6cd7c1cd6a494 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 16 Sep 2020 17:26:20 -0400 Subject: fix typo in error messages --- src/SMAPI/Framework/SCore.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/SMAPI/Framework/SCore.cs') diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 8be62ccf..c9477c52 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -975,7 +975,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 +992,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()) -- cgit From f06b4dd6102e64f929a218192002c1d2ba05ebed Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 16 Sep 2020 17:35:25 -0400 Subject: fix conflict with PyTK's map display device --- docs/release-notes.md | 1 + src/SMAPI/Framework/SCore.cs | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'src/SMAPI/Framework/SCore.cs') diff --git a/docs/release-notes.md b/docs/release-notes.md index bbf6e437..05f17a2f 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -10,6 +10,7 @@ ## Upcoming release * For players: * Fixed errors on Linux/Mac due to mods with incorrect filename case. + * Fixed map rendering crash due to conflict between SMAPI and PyTK. * For modders: * All content pack file paths accessed through `IContentPack` are now case-insensitive. diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index c9477c52..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 @@ -1738,6 +1744,13 @@ namespace StardewModdingAPI.Framework return translations; } + /// Get the map display device which applies SMAPI features like tile rotation to loaded maps. + /// This is separate to let mods like PyTK wrap it with their own functionality. + private IDisplayDevice GetMapDisplayDevice() + { + return new SDisplayDevice(Game1.content, Game1.game1.GraphicsDevice); + } + /// Get the absolute path to the next available log file. private string GetLogPath() { -- cgit