summaryrefslogtreecommitdiff
path: root/StardewModdingAPI/Events/Menu.cs
blob: 0e043780aca893b23f2b9976b09a91ede5c1906e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System;
using StardewValley.Menus;

namespace StardewModdingAPI.Events
{
    public static class MenuEvents
    {
        public static event EventHandler<EventArgsClickableMenuChanged> MenuChanged = delegate { };
        public static event EventHandler<EventArgsClickableMenuClosed> MenuClosed = delegate { };

        internal static void InvokeMenuChanged(IClickableMenu priorMenu, IClickableMenu newMenu)
        {
            MenuChanged.Invoke(null, new EventArgsClickableMenuChanged(priorMenu, newMenu));
        }

        internal static void InvokeMenuClosed(IClickableMenu priorMenu)
        {
            MenuClosed.Invoke(null, new EventArgsClickableMenuClosed(priorMenu));
        }
    }
}