summaryrefslogtreecommitdiff
path: root/StardewModdingAPI/Events.cs
diff options
context:
space:
mode:
Diffstat (limited to 'StardewModdingAPI/Events.cs')
-rw-r--r--StardewModdingAPI/Events.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/StardewModdingAPI/Events.cs b/StardewModdingAPI/Events.cs
index d4311ac3..e0cfc9ce 100644
--- a/StardewModdingAPI/Events.cs
+++ b/StardewModdingAPI/Events.cs
@@ -4,6 +4,8 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xna.Framework.Input;
+using StardewValley;
+using StardewValley.Menus;
namespace StardewModdingAPI
{
@@ -23,6 +25,14 @@ namespace StardewModdingAPI
public delegate void KeyStateChanged(Keys key);
public static event KeyStateChanged KeyPressed = delegate { };
+ public delegate void ClickableMenuChanged(IClickableMenu newMenu);
+ public static event ClickableMenuChanged MenuChanged = delegate { };
+
+ public delegate void GameLocationsChanged(List<GameLocation> newLocations);
+ public static event GameLocationsChanged LocationsChanged = delegate { };
+
+ public delegate void CurrentLocationsChanged(GameLocation newLocation);
+ public static event CurrentLocationsChanged CurrentLocationChanged = delegate { };
public static void InvokeGameLoaded()
{
@@ -86,5 +96,20 @@ namespace StardewModdingAPI
{
KeyPressed.Invoke(key);
}
+
+ public static void InvokeMenuChanged(IClickableMenu newMenu)
+ {
+ MenuChanged.Invoke(newMenu);
+ }
+
+ public static void InvokeLocationsChanged(List<GameLocation> newLocations)
+ {
+ LocationsChanged.Invoke(newLocations);
+ }
+
+ public static void InvokeCurrentLocationChanged(GameLocation newLocation)
+ {
+ CurrentLocationChanged.Invoke(newLocation);
+ }
}
}