summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/SGame.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-02-07 22:28:55 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-02-07 22:28:55 -0500
commit9240bdbf9b6b54d820cb01953ceea31f5e06598e (patch)
tree6e5a8b2e59bacc1ad14271982bb60d918c87c358 /src/SMAPI/Framework/SGame.cs
parent79c616600576acf16f70daad68cc60a22cbbbf74 (diff)
downloadSMAPI-9240bdbf9b6b54d820cb01953ceea31f5e06598e.tar.gz
SMAPI-9240bdbf9b6b54d820cb01953ceea31f5e06598e.tar.bz2
SMAPI-9240bdbf9b6b54d820cb01953ceea31f5e06598e.zip
fix save folder constants not available during early load stages
Diffstat (limited to 'src/SMAPI/Framework/SGame.cs')
-rw-r--r--src/SMAPI/Framework/SGame.cs13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/SMAPI/Framework/SGame.cs b/src/SMAPI/Framework/SGame.cs
index 25ffcabd..6aff6c01 100644
--- a/src/SMAPI/Framework/SGame.cs
+++ b/src/SMAPI/Framework/SGame.cs
@@ -69,9 +69,6 @@ namespace StardewModdingAPI.Framework
/// <remarks>Skipping a few frames ensures the game finishes initialising the world before mods try to change it.</remarks>
private readonly Countdown AfterLoadTimer = new Countdown(5);
- /// <summary>The current stage in the game's loading process.</summary>
- private LoadStage LoadStage = LoadStage.None;
-
/// <summary>Whether the game is saving and SMAPI has already raised <see cref="IGameLoopEvents.Saving"/>.</summary>
private bool IsBetweenSaveEvents;
@@ -215,12 +212,12 @@ namespace StardewModdingAPI.Framework
internal void OnLoadStageChanged(LoadStage newStage)
{
// nothing to do
- if (newStage == this.LoadStage)
+ if (newStage == Context.LoadStage)
return;
// update data
- LoadStage oldStage = this.LoadStage;
- this.LoadStage = newStage;
+ LoadStage oldStage = Context.LoadStage;
+ Context.LoadStage = newStage;
if (newStage == LoadStage.None)
{
this.Monitor.Log("Context: returned to title", LogLevel.Trace);
@@ -511,7 +508,7 @@ namespace StardewModdingAPI.Framework
*********/
if (wasWorldReady && !Context.IsWorldReady)
this.OnLoadStageChanged(LoadStage.None);
- else if (Context.IsWorldReady && this.LoadStage != LoadStage.Ready)
+ else if (Context.IsWorldReady && Context.LoadStage != LoadStage.Ready)
{
// print context
string context = $"Context: loaded saved game '{Constants.SaveFolderName}', starting {Game1.currentSeason} {Game1.dayOfMonth} Y{Game1.year}.";
@@ -884,7 +881,7 @@ namespace StardewModdingAPI.Framework
events.GameLaunched.Raise(new GameLaunchedEventArgs());
// preloaded
- if (Context.IsSaveLoaded && this.LoadStage != LoadStage.Loaded && this.LoadStage != LoadStage.Ready)
+ if (Context.IsSaveLoaded && Context.LoadStage != LoadStage.Loaded && Context.LoadStage != LoadStage.Ready)
this.OnLoadStageChanged(LoadStage.Loaded);
// update tick