From 41715cefcde3c838bb079cb37aac5a3b2dcb1004 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 11 Mar 2018 19:09:08 -0400 Subject: add initial compatibility with Stardew Valley 1.3 (#453) --- src/SMAPI/Events/EventArgsInventoryChanged.cs | 12 +++++++++++- src/SMAPI/Events/EventArgsLocationObjectsChanged.cs | 18 ++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) (limited to 'src/SMAPI/Events') diff --git a/src/SMAPI/Events/EventArgsInventoryChanged.cs b/src/SMAPI/Events/EventArgsInventoryChanged.cs index 1ee02842..b85ae9db 100644 --- a/src/SMAPI/Events/EventArgsInventoryChanged.cs +++ b/src/SMAPI/Events/EventArgsInventoryChanged.cs @@ -12,7 +12,11 @@ namespace StardewModdingAPI.Events ** Accessors *********/ /// The player's inventory. +#if STARDEW_VALLEY_1_3 + public IList Inventory { get; } +#else public List Inventory { get; } +#endif /// The added items. public List Added { get; } @@ -30,7 +34,13 @@ namespace StardewModdingAPI.Events /// Construct an instance. /// The player's inventory. /// The inventory changes. - public EventArgsInventoryChanged(List inventory, List changedItems) + public EventArgsInventoryChanged( +#if STARDEW_VALLEY_1_3 + IList inventory, +#else + List inventory, +#endif + List changedItems) { this.Inventory = inventory; this.Added = changedItems.Where(n => n.ChangeType == ChangeType.Added).ToList(); diff --git a/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs b/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs index 058999e9..de3c31ea 100644 --- a/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs +++ b/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs @@ -1,6 +1,10 @@ -using System; +using System; using Microsoft.Xna.Framework; +#if STARDEW_VALLEY_1_3 +using Netcode; +#else using StardewValley; +#endif using Object = StardewValley.Object; namespace StardewModdingAPI.Events @@ -12,7 +16,11 @@ namespace StardewModdingAPI.Events ** Accessors *********/ /// The current list of objects in the current location. +#if STARDEW_VALLEY_1_3 + public IDictionary> NewObjects { get; } +#else public SerializableDictionary NewObjects { get; } +#endif /********* @@ -20,7 +28,13 @@ namespace StardewModdingAPI.Events *********/ /// Construct an instance. /// The current list of objects in the current location. - public EventArgsLocationObjectsChanged(SerializableDictionary newObjects) + public EventArgsLocationObjectsChanged( +#if STARDEW_VALLEY_1_3 + IDictionary> newObjects +#else + SerializableDictionary newObjects +#endif + ) { this.NewObjects = newObjects; } -- cgit From 6db91f832998ab07e7a937c25b32f1151a0274bc Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 11 Mar 2018 19:10:27 -0400 Subject: drop support for some deprecated APIs in the Stardew Valley 1.3 branch (#453) --- src/SMAPI/Events/EventArgsInput.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/SMAPI/Events') diff --git a/src/SMAPI/Events/EventArgsInput.cs b/src/SMAPI/Events/EventArgsInput.cs index a5325b76..75b9b8cd 100644 --- a/src/SMAPI/Events/EventArgsInput.cs +++ b/src/SMAPI/Events/EventArgsInput.cs @@ -18,9 +18,11 @@ namespace StardewModdingAPI.Events /// The current cursor position. public ICursorPosition Cursor { get; } +#if !STARDEW_VALLEY_1_3 /// Whether the input is considered a 'click' by the game for enabling action. [Obsolete("Use " + nameof(EventArgsInput.IsActionButton) + " or " + nameof(EventArgsInput.IsUseToolButton) + " instead")] // deprecated in SMAPI 2.1 public bool IsClick => this.IsActionButton; +#endif /// Whether the input should trigger actions on the affected tile. public bool IsActionButton { get; } -- cgit From 98fa9f03891e3dc487bee6dcb3756e6251c67aef Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 11 Mar 2018 20:45:58 -0400 Subject: update for Stardew Valley 1.3.0.5 (#453) --- src/SMAPI/Events/EventArgsGameLocationsChanged.cs | 6 +++--- src/SMAPI/Events/EventArgsLocationObjectsChanged.cs | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/SMAPI/Events') diff --git a/src/SMAPI/Events/EventArgsGameLocationsChanged.cs b/src/SMAPI/Events/EventArgsGameLocationsChanged.cs index fb8c821e..78ba38fa 100644 --- a/src/SMAPI/Events/EventArgsGameLocationsChanged.cs +++ b/src/SMAPI/Events/EventArgsGameLocationsChanged.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using StardewValley; @@ -11,7 +11,7 @@ namespace StardewModdingAPI.Events ** Accessors *********/ /// The current list of game locations. - public List NewLocations { get; } + public IList NewLocations { get; } /********* @@ -19,7 +19,7 @@ namespace StardewModdingAPI.Events *********/ /// Construct an instance. /// The current list of game locations. - public EventArgsGameLocationsChanged(List newLocations) + public EventArgsGameLocationsChanged(IList newLocations) { this.NewLocations = newLocations; } diff --git a/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs b/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs index de3c31ea..180e9d78 100644 --- a/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs +++ b/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs @@ -1,6 +1,7 @@ using System; using Microsoft.Xna.Framework; #if STARDEW_VALLEY_1_3 +using System.Collections.Generic; using Netcode; #else using StardewValley; -- cgit