summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/Events
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-06-01 02:14:01 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-06-01 02:14:01 -0400
commit07bbfea7dd9dac5bbacf8bfc3c35d3f65ec71b75 (patch)
tree073ce173468e3e26b6a9e7a61696ad2baeb7c59b /src/SMAPI/Framework/Events
parentb3f116a8f123387b1f2f9ce1a099d1fd8081708d (diff)
downloadSMAPI-07bbfea7dd9dac5bbacf8bfc3c35d3f65ec71b75.tar.gz
SMAPI-07bbfea7dd9dac5bbacf8bfc3c35d3f65ec71b75.tar.bz2
SMAPI-07bbfea7dd9dac5bbacf8bfc3c35d3f65ec71b75.zip
add NPC list changed event (#310)
Diffstat (limited to 'src/SMAPI/Framework/Events')
-rw-r--r--src/SMAPI/Framework/Events/EventManager.cs4
-rw-r--r--src/SMAPI/Framework/Events/ModWorldEvents.cs7
2 files changed, 11 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/Events/EventManager.cs b/src/SMAPI/Framework/Events/EventManager.cs
index c909c1bd..cb331e7a 100644
--- a/src/SMAPI/Framework/Events/EventManager.cs
+++ b/src/SMAPI/Framework/Events/EventManager.cs
@@ -20,6 +20,9 @@ namespace StardewModdingAPI.Framework.Events
/// <summary>Raised after buildings are added or removed in a location.</summary>
public readonly ManagedEvent<WorldBuildingListChangedEventArgs> World_BuildingListChanged;
+ /// <summary>Raised after NPCs are added or removed in a location.</summary>
+ public readonly ManagedEvent<WorldNpcListChangedEventArgs> World_NpcListChanged;
+
/// <summary>Raised after objects are added or removed in a location.</summary>
public readonly ManagedEvent<WorldObjectListChangedEventArgs> World_ObjectListChanged;
@@ -230,6 +233,7 @@ namespace StardewModdingAPI.Framework.Events
// init events (new)
this.World_BuildingListChanged = ManageEventOf<WorldBuildingListChangedEventArgs>(nameof(IModEvents.World), nameof(IWorldEvents.LocationListChanged));
this.World_LocationListChanged = ManageEventOf<WorldLocationListChangedEventArgs>(nameof(IModEvents.World), nameof(IWorldEvents.BuildingListChanged));
+ this.World_NpcListChanged = ManageEventOf<WorldNpcListChangedEventArgs>(nameof(IModEvents.World), nameof(IWorldEvents.NpcListChanged));
this.World_ObjectListChanged = ManageEventOf<WorldObjectListChangedEventArgs>(nameof(IModEvents.World), nameof(IWorldEvents.ObjectListChanged));
this.World_TerrainFeatureListChanged = ManageEventOf<WorldTerrainFeatureListChangedEventArgs>(nameof(IModEvents.World), nameof(IWorldEvents.TerrainFeatureListChanged));
diff --git a/src/SMAPI/Framework/Events/ModWorldEvents.cs b/src/SMAPI/Framework/Events/ModWorldEvents.cs
index 14646c5d..ca851550 100644
--- a/src/SMAPI/Framework/Events/ModWorldEvents.cs
+++ b/src/SMAPI/Framework/Events/ModWorldEvents.cs
@@ -33,6 +33,13 @@ namespace StardewModdingAPI.Framework.Events
remove => this.EventManager.World_BuildingListChanged.Remove(value);
}
+ /// <summary>Raised after NPCs are added or removed in a location.</summary>
+ public event EventHandler<WorldNpcListChangedEventArgs> NpcListChanged
+ {
+ add => this.EventManager.World_NpcListChanged.Add(value);
+ remove => this.EventManager.World_NpcListChanged.Remove(value);
+ }
+
/// <summary>Raised after objects are added or removed in a location.</summary>
public event EventHandler<WorldObjectListChangedEventArgs> ObjectListChanged
{