diff options
author | DiscipleOfEris <discipleoferis1@gmail.com> | 2021-05-26 11:50:49 -0700 |
---|---|---|
committer | DiscipleOfEris <discipleoferis1@gmail.com> | 2021-05-26 11:50:49 -0700 |
commit | b149e11338ba2dbaf030a70783d28b6be21ccf1e (patch) | |
tree | 4081de50a7af24d5892329167083f4de96ca6b4d /src/SMAPI/Framework/Events | |
parent | 112b505118e65d2741a5cfebce44abd02742dd2f (diff) | |
download | SMAPI-b149e11338ba2dbaf030a70783d28b6be21ccf1e.tar.gz SMAPI-b149e11338ba2dbaf030a70783d28b6be21ccf1e.tar.bz2 SMAPI-b149e11338ba2dbaf030a70783d28b6be21ccf1e.zip |
Add `World.FurnitureListChanged` event
Create a new event available to SMAPI mods to track furniture changes. To facilitate the event, a `FurnitureListChangedEventArgs` class is added as well.
Fixes #778
Diffstat (limited to 'src/SMAPI/Framework/Events')
-rw-r--r-- | src/SMAPI/Framework/Events/EventManager.cs | 4 | ||||
-rw-r--r-- | src/SMAPI/Framework/Events/ModWorldEvents.cs | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/Events/EventManager.cs b/src/SMAPI/Framework/Events/EventManager.cs index f4abfffe..dfc289ed 100644 --- a/src/SMAPI/Framework/Events/EventManager.cs +++ b/src/SMAPI/Framework/Events/EventManager.cs @@ -162,6 +162,9 @@ namespace StardewModdingAPI.Framework.Events /// <summary>Raised after terrain features (like floors and trees) are added or removed in a location.</summary> public readonly ManagedEvent<TerrainFeatureListChangedEventArgs> TerrainFeatureListChanged; + /// <summary>Raised after furniture are added or removed in a location.</summary> + public readonly ManagedEvent<FurnitureListChangedEventArgs> FurnitureListChanged; + /**** ** Specialized ****/ @@ -238,6 +241,7 @@ namespace StardewModdingAPI.Framework.Events this.ObjectListChanged = ManageEventOf<ObjectListChangedEventArgs>(nameof(IModEvents.World), nameof(IWorldEvents.ObjectListChanged)); this.ChestInventoryChanged = ManageEventOf<ChestInventoryChangedEventArgs>(nameof(IModEvents.World), nameof(IWorldEvents.ChestInventoryChanged)); this.TerrainFeatureListChanged = ManageEventOf<TerrainFeatureListChangedEventArgs>(nameof(IModEvents.World), nameof(IWorldEvents.TerrainFeatureListChanged)); + this.FurnitureListChanged = ManageEventOf<FurnitureListChangedEventArgs>(nameof(IModEvents.World), nameof(IWorldEvents.FurnitureListChanged)); this.LoadStageChanged = ManageEventOf<LoadStageChangedEventArgs>(nameof(IModEvents.Specialized), nameof(ISpecializedEvents.LoadStageChanged)); this.UnvalidatedUpdateTicking = ManageEventOf<UnvalidatedUpdateTickingEventArgs>(nameof(IModEvents.Specialized), nameof(ISpecializedEvents.UnvalidatedUpdateTicking), isPerformanceCritical: true); diff --git a/src/SMAPI/Framework/Events/ModWorldEvents.cs b/src/SMAPI/Framework/Events/ModWorldEvents.cs index 21b1b664..f4c40abc 100644 --- a/src/SMAPI/Framework/Events/ModWorldEvents.cs +++ b/src/SMAPI/Framework/Events/ModWorldEvents.cs @@ -65,6 +65,13 @@ namespace StardewModdingAPI.Framework.Events remove => this.EventManager.TerrainFeatureListChanged.Remove(value); } + /// <summary>Raised after furniture are added or removed in a location.</summary> + public event EventHandler<FurnitureListChangedEventArgs> FurnitureListChanged + { + add => this.EventManager.FurnitureListChanged.Add(value, this.Mod); + remove => this.EventManager.FurnitureListChanged.Remove(value); + } + /********* ** Public methods |