diff options
-rw-r--r-- | docs/release-notes.md | 1 | ||||
-rw-r--r-- | src/SMAPI/Events/InventoryChangedEventArgs.cs | 3 | ||||
-rw-r--r-- | src/SMAPI/Events/LevelChangedEventArgs.cs | 3 | ||||
-rw-r--r-- | src/SMAPI/Events/WarpedEventArgs.cs | 3 |
4 files changed, 10 insertions, 0 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md index a231b84b..5788fa9f 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -8,6 +8,7 @@ * For modders: * Added ModDrop update keys (see [docs](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Manifest#Update_checks)). + * Added `IsLocalPlayer` to new player events. * Reloading a map asset will now update affected locations. * Reloading the `Data\NPCDispositions` asset will now update affected NPCs. * Fixed some map tilesheets not editable if not playing in English. diff --git a/src/SMAPI/Events/InventoryChangedEventArgs.cs b/src/SMAPI/Events/InventoryChangedEventArgs.cs index 1b22af8d..874c2e48 100644 --- a/src/SMAPI/Events/InventoryChangedEventArgs.cs +++ b/src/SMAPI/Events/InventoryChangedEventArgs.cs @@ -23,6 +23,9 @@ namespace StardewModdingAPI.Events /// <summary>The items whose stack sizes changed, with the relative change.</summary> public IEnumerable<ItemStackSizeChange> QuantityChanged { get; } + /// <summary>Whether the affected player is the local one.</summary> + public bool IsLocalPlayer => this.Player.IsLocalPlayer; + /********* ** Public methods diff --git a/src/SMAPI/Events/LevelChangedEventArgs.cs b/src/SMAPI/Events/LevelChangedEventArgs.cs index a0a761c4..c7303603 100644 --- a/src/SMAPI/Events/LevelChangedEventArgs.cs +++ b/src/SMAPI/Events/LevelChangedEventArgs.cs @@ -22,6 +22,9 @@ namespace StardewModdingAPI.Events /// <summary>The new skill level.</summary> public int NewLevel { get; } + /// <summary>Whether the affected player is the local one.</summary> + public bool IsLocalPlayer => this.Player.IsLocalPlayer; + /********* ** Public methods diff --git a/src/SMAPI/Events/WarpedEventArgs.cs b/src/SMAPI/Events/WarpedEventArgs.cs index cb7ff204..95c53ad9 100644 --- a/src/SMAPI/Events/WarpedEventArgs.cs +++ b/src/SMAPI/Events/WarpedEventArgs.cs @@ -18,6 +18,9 @@ namespace StardewModdingAPI.Events /// <summary>The player's current location.</summary> public GameLocation NewLocation { get; } + /// <summary>Whether the affected player is the local one.</summary> + public bool IsLocalPlayer => this.Player.IsLocalPlayer; + /********* |