diff options
-rw-r--r-- | docs/release-notes.md | 3 | ||||
-rw-r--r-- | src/SMAPI/Utilities/PerScreen.cs | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md index 6915cb3c..a61d024c 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -13,6 +13,9 @@ * Updated to [FluentHttpClient](https://github.com/Pathoschild/FluentHttpClient#readme) 4.3.0 (see [changes](https://github.com/Pathoschild/FluentHttpClient/blob/develop/RELEASE-NOTES.md#430)). * Removed `LargeAddressAware` flag on SMAPI (no longer needed since it's 64-bit now). +* For mod authors: + * Added `IsActiveForScreen()` method to `PerScreen<T>`. + ## 3.18.2 Released 09 January 2023 for Stardew Valley 1.5.6 or later. diff --git a/src/SMAPI/Utilities/PerScreen.cs b/src/SMAPI/Utilities/PerScreen.cs index 87bf2027..674ec760 100644 --- a/src/SMAPI/Utilities/PerScreen.cs +++ b/src/SMAPI/Utilities/PerScreen.cs @@ -101,6 +101,12 @@ namespace StardewModdingAPI.Utilities this.RemoveScreens(_ => true); } + /// <summary>Get whether the current screen has a value created yet.</summary> + public bool IsActiveForScreen() + { + return this.States.ContainsKey(Context.ScreenId); + } + /********* ** Private methods |