using System; using StardewModdingAPI.Framework.Events; namespace StardewModdingAPI.Events { /// Events raised when a game menu is opened or closed (including internal menus like the title screen). public static class MenuEvents { /********* ** Properties *********/ /// The core event manager. private static EventManager EventManager; /********* ** Events *********/ /// Raised after a game menu is opened or replaced with another menu. This event is not invoked when a menu is closed. public static event EventHandler MenuChanged { add => MenuEvents.EventManager.Menu_Changed.Add(value); remove => MenuEvents.EventManager.Menu_Changed.Remove(value); } /// Raised after a game menu is closed. public static event EventHandler MenuClosed { add => MenuEvents.EventManager.Menu_Closed.Add(value); remove => MenuEvents.EventManager.Menu_Closed.Remove(value); } /********* ** Public methods *********/ /// Initialise the events. /// The core event manager. internal static void Init(EventManager eventManager) { MenuEvents.EventManager = eventManager; } } }