summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Constants.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-04-29 21:45:37 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-04-29 21:45:37 -0400
commitff5d1ef4e4a096405b343de3f6d27715c248de3b (patch)
tree29ec4c82f4c07f54513ec626254f8952c98ed123 /src/StardewModdingAPI/Constants.cs
parent014014ca0f50f44d8767e46eb82625b2120282e0 (diff)
downloadSMAPI-ff5d1ef4e4a096405b343de3f6d27715c248de3b.tar.gz
SMAPI-ff5d1ef4e4a096405b343de3f6d27715c248de3b.tar.bz2
SMAPI-ff5d1ef4e4a096405b343de3f6d27715c248de3b.zip
add internal context for more robust draw loop detection (#257)
Diffstat (limited to 'src/StardewModdingAPI/Constants.cs')
-rw-r--r--src/StardewModdingAPI/Constants.cs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/StardewModdingAPI/Constants.cs b/src/StardewModdingAPI/Constants.cs
index 6ba16935..cca99027 100644
--- a/src/StardewModdingAPI/Constants.cs
+++ b/src/StardewModdingAPI/Constants.cs
@@ -20,10 +20,10 @@ namespace StardewModdingAPI
** Properties
*********/
/// <summary>The directory path containing the current save's data (if a save is loaded).</summary>
- private static string RawSavePath => Constants.IsSaveLoaded ? Path.Combine(Constants.SavesPath, Constants.GetSaveFolderName()) : null;
+ private static string RawSavePath => Context.IsSaveLoaded ? Path.Combine(Constants.SavesPath, Constants.GetSaveFolderName()) : null;
/// <summary>Whether the directory containing the current save's data exists on disk.</summary>
- private static bool SavePathReady => Constants.IsSaveLoaded && Directory.Exists(Constants.RawSavePath);
+ private static bool SavePathReady => Context.IsSaveLoaded && Directory.Exists(Constants.RawSavePath);
/*********
@@ -54,7 +54,7 @@ namespace StardewModdingAPI
public static string SavesPath { get; } = Path.Combine(Constants.DataPath, "Saves");
/// <summary>The directory name containing the current save's data (if a save is loaded and the directory exists).</summary>
- public static string SaveFolderName => Constants.IsSaveLoaded ? Constants.GetSaveFolderName() : "";
+ public static string SaveFolderName => Context.IsSaveLoaded ? Constants.GetSaveFolderName() : "";
/// <summary>The directory path containing the current save's data (if a save is loaded and the directory exists).</summary>
public static string CurrentSavePath => Constants.SavePathReady ? Path.Combine(Constants.SavesPath, Constants.GetSaveFolderName()) : "";
@@ -74,9 +74,6 @@ namespace StardewModdingAPI
/// <summary>The full path to the folder containing mods.</summary>
internal static string ModPath { get; } = Path.Combine(Constants.ExecutionPath, "Mods");
- /// <summary>Whether a player save has been loaded.</summary>
- internal static bool IsSaveLoaded => Game1.hasLoadedGame && !string.IsNullOrEmpty(Game1.player.name);
-
/// <summary>The game's current semantic version.</summary>
internal static ISemanticVersion GameVersion { get; } = Constants.GetGameVersion();