summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Context.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-10-14 11:44:02 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-10-14 11:44:02 -0400
commit79118316065a01322d8ea12a14589ec016794c32 (patch)
tree7a26668a66ea0630a2b9367ac820fe7a6d99ac77 /src/StardewModdingAPI/Context.cs
parentaf1a2bde8219c5d4b8660b13702725626a4a5647 (diff)
parent8aec1eff99858716afe7b8604b512181f78c214f (diff)
downloadSMAPI-79118316065a01322d8ea12a14589ec016794c32.tar.gz
SMAPI-79118316065a01322d8ea12a14589ec016794c32.tar.bz2
SMAPI-79118316065a01322d8ea12a14589ec016794c32.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/StardewModdingAPI/Context.cs')
-rw-r--r--src/StardewModdingAPI/Context.cs37
1 files changed, 0 insertions, 37 deletions
diff --git a/src/StardewModdingAPI/Context.cs b/src/StardewModdingAPI/Context.cs
deleted file mode 100644
index 119e14c8..00000000
--- a/src/StardewModdingAPI/Context.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using StardewModdingAPI.Events;
-using StardewValley;
-using StardewValley.Menus;
-
-namespace StardewModdingAPI
-{
- /// <summary>Provides information about the current game state.</summary>
- public static class Context
- {
- /*********
- ** Accessors
- *********/
- /****
- ** Public
- ****/
- /// <summary>Whether the player has loaded a save and the world has finished initialising.</summary>
- public static bool IsWorldReady { get; internal set; }
-
- /// <summary>Whether <see cref="IsWorldReady"/> is true and the player is free to act in the world (no menu is displayed, no cutscene is in progress, etc).</summary>
- public static bool IsPlayerFree => Context.IsWorldReady && Game1.activeClickableMenu == null && !Game1.dialogueUp && !Game1.eventUp;
-
- /// <summary>Whether <see cref="IsPlayerFree"/> is true and the player is free to move (e.g. not using a tool).</summary>
- public static bool CanPlayerMove => Context.IsPlayerFree && Game1.player.CanMove;
-
- /// <summary>Whether the game is currently running the draw loop. This isn't relevant to most mods, since you should use <see cref="GraphicsEvents.OnPostRenderEvent"/> to draw to the screen.</summary>
- public static bool IsInDrawLoop { get; internal set; }
-
- /****
- ** Internal
- ****/
- /// <summary>Whether a player save has been loaded.</summary>
- internal static bool IsSaveLoaded => Game1.hasLoadedGame && !string.IsNullOrEmpty(Game1.player.name);
-
- /// <summary>Whether the game is currently writing to the save file.</summary>
- internal static bool IsSaving => Game1.activeClickableMenu is SaveGameMenu || Game1.activeClickableMenu is ShippingMenu; // saving is performed by SaveGameMenu, but it's wrapped by ShippingMenu on days when the player shipping something
- }
-}