add PerScreen.IsActiveForScreen()

This commit is contained in:
Jesse Plamondon-Willard 2023-02-18 15:09:18 -05:00
parent 7f7561469f
commit 7b5566d075
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
2 changed files with 9 additions and 0 deletions

View File

@ -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)). * 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). * 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 ## 3.18.2
Released 09 January 2023 for Stardew Valley 1.5.6 or later. Released 09 January 2023 for Stardew Valley 1.5.6 or later.

View File

@ -101,6 +101,12 @@ namespace StardewModdingAPI.Utilities
this.RemoveScreens(_ => true); 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 ** Private methods