summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/SCore.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-09-16 21:33:53 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-09-16 21:33:53 -0400
commitde84adb47751c96fc60be66f6fdb186a09160820 (patch)
tree5c09422db13fba3c9a231308def6913188989946 /src/SMAPI/Framework/SCore.cs
parent44e91ca5e1527333fdbd2993b694cc17601293e3 (diff)
parent59974c18a6fb6f8f2e7e3a8c5df109e060fc5ae6 (diff)
downloadSMAPI-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.cs21
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()
{