From 51d56f1eecdc171052fea425f92562f695c068b0 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 22 May 2017 16:41:50 -0400 Subject: add Context.IsInDrawLoop for specialised mods --- src/StardewModdingAPI/Context.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') 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 /// Whether the player has loaded a save and the world has finished initialising. public static bool IsWorldReady { get; internal set; } + /// Whether the game is currently running the draw loop. This isn't relevant to most mods, since you should use to draw to the screen. + public static bool IsInDrawLoop { get; set; } + /**** ** Internal ****/ @@ -23,8 +27,5 @@ namespace StardewModdingAPI /// Whether the game is currently writing to the save file. 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 - - /// Whether the game is currently running the draw loop. - internal static bool IsInDrawLoop { get; set; } } } -- cgit