summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/Events
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-12-29 13:29:25 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-12-31 16:19:50 -0500
commit1286a90ec2fb0dcf26bd59feec714544844e4398 (patch)
tree33d10b57442ff38daee9c975506a8ce1ea958f23 /src/SMAPI/Framework/Events
parentaef1b8ac2898e147e6200fe257e8fdd82ee7fdbc (diff)
downloadSMAPI-1286a90ec2fb0dcf26bd59feec714544844e4398.tar.gz
SMAPI-1286a90ec2fb0dcf26bd59feec714544844e4398.tar.bz2
SMAPI-1286a90ec2fb0dcf26bd59feec714544844e4398.zip
minor refactoring
This commit... - removes key fields added to non-keyed types like NetListWatcher and SnapshotListDiff; - fixes existing chests not being watched; - fixes diffs not correctly updated for added/removed chests; - performs minor cleanup, adds missing docs, etc.
Diffstat (limited to 'src/SMAPI/Framework/Events')
-rw-r--r--src/SMAPI/Framework/Events/EventManager.cs6
-rw-r--r--src/SMAPI/Framework/Events/ModWorldEvents.cs7
2 files changed, 7 insertions, 6 deletions
diff --git a/src/SMAPI/Framework/Events/EventManager.cs b/src/SMAPI/Framework/Events/EventManager.cs
index dad45f95..892cbc7b 100644
--- a/src/SMAPI/Framework/Events/EventManager.cs
+++ b/src/SMAPI/Framework/Events/EventManager.cs
@@ -148,8 +148,8 @@ namespace StardewModdingAPI.Framework.Events
/// <summary>Raised after objects are added or removed in a location.</summary>
public readonly ManagedEvent<ObjectListChangedEventArgs> ObjectListChanged;
- /// <summary>Raised after a new item is added or removed from a chest in a location.</summary>
- public readonly ManagedEvent<ChestItemChangedEventArgs> ChestItemsChanged;
+ /// <summary>Raised after items are added or removed from a chest.</summary>
+ public readonly ManagedEvent<ChestInventoryChangedEventArgs> ChestInventoryChanged;
/// <summary>Raised after terrain features (like floors and trees) are added or removed in a location.</summary>
public readonly ManagedEvent<TerrainFeatureListChangedEventArgs> TerrainFeatureListChanged;
@@ -224,7 +224,7 @@ namespace StardewModdingAPI.Framework.Events
this.LocationListChanged = ManageEventOf<LocationListChangedEventArgs>(nameof(IModEvents.World), nameof(IWorldEvents.BuildingListChanged));
this.NpcListChanged = ManageEventOf<NpcListChangedEventArgs>(nameof(IModEvents.World), nameof(IWorldEvents.NpcListChanged));
this.ObjectListChanged = ManageEventOf<ObjectListChangedEventArgs>(nameof(IModEvents.World), nameof(IWorldEvents.ObjectListChanged));
- this.ChestItemsChanged = ManageEventOf<ChestItemChangedEventArgs>(nameof(IModEvents.World), nameof(IWorldEvents.ChestItemChanged));
+ this.ChestInventoryChanged = ManageEventOf<ChestInventoryChangedEventArgs>(nameof(IModEvents.World), nameof(IWorldEvents.ChestInventoryChanged));
this.TerrainFeatureListChanged = ManageEventOf<TerrainFeatureListChangedEventArgs>(nameof(IModEvents.World), nameof(IWorldEvents.TerrainFeatureListChanged));
this.LoadStageChanged = ManageEventOf<LoadStageChangedEventArgs>(nameof(IModEvents.Specialized), nameof(ISpecializedEvents.LoadStageChanged));
diff --git a/src/SMAPI/Framework/Events/ModWorldEvents.cs b/src/SMAPI/Framework/Events/ModWorldEvents.cs
index 8d6701ec..2ae69669 100644
--- a/src/SMAPI/Framework/Events/ModWorldEvents.cs
+++ b/src/SMAPI/Framework/Events/ModWorldEvents.cs
@@ -51,10 +51,11 @@ namespace StardewModdingAPI.Framework.Events
remove => this.EventManager.ObjectListChanged.Remove(value);
}
- public event EventHandler<ChestItemChangedEventArgs> ChestItemChanged
+ /// <summary>Raised after items are added or removed from a chest.</summary>
+ public event EventHandler<ChestInventoryChangedEventArgs> ChestInventoryChanged
{
- add => this.EventManager.ChestItemsChanged.Add(value);
- remove => this.EventManager.ChestItemsChanged.Remove(value);
+ add => this.EventManager.ChestInventoryChanged.Add(value);
+ remove => this.EventManager.ChestInventoryChanged.Remove(value);
}
/// <summary>Raised after terrain features (like floors and trees) are added or removed in a location.</summary>