diff options
-rw-r--r-- | docs/release-notes.md | 3 | ||||
-rw-r--r-- | src/SMAPI/Events/BuildingListChangedEventArgs.cs | 3 | ||||
-rw-r--r-- | src/SMAPI/Events/DebrisListChangedEventArgs.cs | 3 | ||||
-rw-r--r-- | src/SMAPI/Events/LargeTerrainFeatureListChangedEventArgs.cs | 3 | ||||
-rw-r--r-- | src/SMAPI/Events/NpcListChangedEventArgs.cs | 3 | ||||
-rw-r--r-- | src/SMAPI/Events/ObjectListChangedEventArgs.cs | 3 | ||||
-rw-r--r-- | src/SMAPI/Events/TerrainFeatureListChangedEventArgs.cs | 3 |
7 files changed, 20 insertions, 1 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md index a8fa99c3..56c2f50f 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,4 +1,4 @@ -# Release notes +# Release notes ## Upcoming release * For players: * Added `world_clear` console command to remove spawned or placed entities. @@ -9,6 +9,7 @@ * Added new [events](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Events): * `GameLoop.OneSecondUpdateTicking` and `OneSecondUpdateTicked`; * `Specialised.LoadStageChanged`. + * Added `e.IsCurrentLocation` event arg to `World` events. * You can now use `helper.Data.Read/WriteSaveData` as soon as the save is loaded (instead of once the world is initialised). * For the web UI: diff --git a/src/SMAPI/Events/BuildingListChangedEventArgs.cs b/src/SMAPI/Events/BuildingListChangedEventArgs.cs index 0237342f..74f37710 100644 --- a/src/SMAPI/Events/BuildingListChangedEventArgs.cs +++ b/src/SMAPI/Events/BuildingListChangedEventArgs.cs @@ -21,6 +21,9 @@ namespace StardewModdingAPI.Events /// <summary>The buildings removed from the location.</summary> public IEnumerable<Building> Removed { get; } + /// <summary>Whether this is the location containing the local player.</summary> + public bool IsCurrentLocation => object.ReferenceEquals(this.Location, Game1.player?.currentLocation); + /********* ** Public methods diff --git a/src/SMAPI/Events/DebrisListChangedEventArgs.cs b/src/SMAPI/Events/DebrisListChangedEventArgs.cs index 68328885..61b7590a 100644 --- a/src/SMAPI/Events/DebrisListChangedEventArgs.cs +++ b/src/SMAPI/Events/DebrisListChangedEventArgs.cs @@ -20,6 +20,9 @@ namespace StardewModdingAPI.Events /// <summary>The debris removed from the location.</summary> public IEnumerable<Debris> Removed { get; } + /// <summary>Whether this is the location containing the local player.</summary> + public bool IsCurrentLocation => object.ReferenceEquals(this.Location, Game1.player?.currentLocation); + /********* ** Public methods diff --git a/src/SMAPI/Events/LargeTerrainFeatureListChangedEventArgs.cs b/src/SMAPI/Events/LargeTerrainFeatureListChangedEventArgs.cs index c7d55bf8..59d79f0f 100644 --- a/src/SMAPI/Events/LargeTerrainFeatureListChangedEventArgs.cs +++ b/src/SMAPI/Events/LargeTerrainFeatureListChangedEventArgs.cs @@ -21,6 +21,9 @@ namespace StardewModdingAPI.Events /// <summary>The large terrain features removed from the location.</summary> public IEnumerable<LargeTerrainFeature> Removed { get; } + /// <summary>Whether this is the location containing the local player.</summary> + public bool IsCurrentLocation => object.ReferenceEquals(this.Location, Game1.player?.currentLocation); + /********* ** Public methods diff --git a/src/SMAPI/Events/NpcListChangedEventArgs.cs b/src/SMAPI/Events/NpcListChangedEventArgs.cs index a9ec2a3b..3a37f1e7 100644 --- a/src/SMAPI/Events/NpcListChangedEventArgs.cs +++ b/src/SMAPI/Events/NpcListChangedEventArgs.cs @@ -20,6 +20,9 @@ namespace StardewModdingAPI.Events /// <summary>The NPCs removed from the location.</summary> public IEnumerable<NPC> Removed { get; } + /// <summary>Whether this is the location containing the local player.</summary> + public bool IsCurrentLocation => object.ReferenceEquals(this.Location, Game1.player?.currentLocation); + /********* ** Public methods diff --git a/src/SMAPI/Events/ObjectListChangedEventArgs.cs b/src/SMAPI/Events/ObjectListChangedEventArgs.cs index d0cf9e7b..b21d2867 100644 --- a/src/SMAPI/Events/ObjectListChangedEventArgs.cs +++ b/src/SMAPI/Events/ObjectListChangedEventArgs.cs @@ -22,6 +22,9 @@ namespace StardewModdingAPI.Events /// <summary>The objects removed from the location.</summary> public IEnumerable<KeyValuePair<Vector2, Object>> Removed { get; } + /// <summary>Whether this is the location containing the local player.</summary> + public bool IsCurrentLocation => object.ReferenceEquals(this.Location, Game1.player?.currentLocation); + /********* ** Public methods diff --git a/src/SMAPI/Events/TerrainFeatureListChangedEventArgs.cs b/src/SMAPI/Events/TerrainFeatureListChangedEventArgs.cs index 0992633e..cdf1e6dc 100644 --- a/src/SMAPI/Events/TerrainFeatureListChangedEventArgs.cs +++ b/src/SMAPI/Events/TerrainFeatureListChangedEventArgs.cs @@ -22,6 +22,9 @@ namespace StardewModdingAPI.Events /// <summary>The terrain features removed from the location.</summary> public IEnumerable<KeyValuePair<Vector2, TerrainFeature>> Removed { get; } + /// <summary>Whether this is the location containing the local player.</summary> + public bool IsCurrentLocation => object.ReferenceEquals(this.Location, Game1.player?.currentLocation); + /********* ** Public methods |