diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-05-22 16:41:50 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-05-22 16:41:50 -0400 |
commit | 51d56f1eecdc171052fea425f92562f695c068b0 (patch) | |
tree | 38dce0935868c1dad21d83ea00b000976a13d6be /src | |
parent | ec19c85d66a10bbd41c7fabfd9ea858fe659e747 (diff) | |
download | SMAPI-51d56f1eecdc171052fea425f92562f695c068b0.tar.gz SMAPI-51d56f1eecdc171052fea425f92562f695c068b0.tar.bz2 SMAPI-51d56f1eecdc171052fea425f92562f695c068b0.zip |
add Context.IsInDrawLoop for specialised mods
Diffstat (limited to 'src')
-rw-r--r-- | src/StardewModdingAPI/Context.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/StardewModdingAPI/Context.cs b/src/StardewModdingAPI/Context.cs index 6bc5ae56..6ceabd5a 100644 --- a/src/StardewModdingAPI/Context.cs +++ b/src/StardewModdingAPI/Context.cs @@ -1,4 +1,5 @@ -using StardewValley; +using StardewModdingAPI.Events; +using StardewValley; using StardewValley.Menus; namespace StardewModdingAPI @@ -15,6 +16,9 @@ namespace StardewModdingAPI /// <summary>Whether the player has loaded a save and the world has finished initialising.</summary> public static bool IsWorldReady { get; internal set; } + /// <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; set; } + /**** ** Internal ****/ @@ -23,8 +27,5 @@ namespace StardewModdingAPI /// <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 - - /// <summary>Whether the game is currently running the draw loop.</summary> - internal static bool IsInDrawLoop { get; set; } } } |