From 7b5566d0751bec14c5bf93b727fa66e7c58fbf00 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 18 Feb 2023 15:09:18 -0500 Subject: add PerScreen.IsActiveForScreen() --- src/SMAPI/Utilities/PerScreen.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/SMAPI/Utilities/PerScreen.cs') 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); } + /// Get whether the current screen has a value created yet. + public bool IsActiveForScreen() + { + return this.States.ContainsKey(Context.ScreenId); + } + /********* ** Private methods -- cgit