diff options
Diffstat (limited to 'src/SMAPI/Events')
-rw-r--r-- | src/SMAPI/Events/EventArgsGameLocationsChanged.cs | 6 | ||||
-rw-r--r-- | src/SMAPI/Events/EventArgsInput.cs | 2 | ||||
-rw-r--r-- | src/SMAPI/Events/EventArgsInventoryChanged.cs | 12 | ||||
-rw-r--r-- | src/SMAPI/Events/EventArgsLocationObjectsChanged.cs | 19 |
4 files changed, 33 insertions, 6 deletions
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 *********/ /// <summary>The current list of game locations.</summary> - public List<GameLocation> NewLocations { get; } + public IList<GameLocation> NewLocations { get; } /********* @@ -19,7 +19,7 @@ namespace StardewModdingAPI.Events *********/ /// <summary>Construct an instance.</summary> /// <param name="newLocations">The current list of game locations.</param> - public EventArgsGameLocationsChanged(List<GameLocation> newLocations) + public EventArgsGameLocationsChanged(IList<GameLocation> newLocations) { this.NewLocations = newLocations; } 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 /// <summary>The current cursor position.</summary> public ICursorPosition Cursor { get; } +#if !STARDEW_VALLEY_1_3 /// <summary>Whether the input is considered a 'click' by the game for enabling action.</summary> [Obsolete("Use " + nameof(EventArgsInput.IsActionButton) + " or " + nameof(EventArgsInput.IsUseToolButton) + " instead")] // deprecated in SMAPI 2.1 public bool IsClick => this.IsActionButton; +#endif /// <summary>Whether the input should trigger actions on the affected tile.</summary> public bool IsActionButton { get; } 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 *********/ /// <summary>The player's inventory.</summary> +#if STARDEW_VALLEY_1_3 + public IList<Item> Inventory { get; } +#else public List<Item> Inventory { get; } +#endif /// <summary>The added items.</summary> public List<ItemStackChange> Added { get; } @@ -30,7 +34,13 @@ namespace StardewModdingAPI.Events /// <summary>Construct an instance.</summary> /// <param name="inventory">The player's inventory.</param> /// <param name="changedItems">The inventory changes.</param> - public EventArgsInventoryChanged(List<Item> inventory, List<ItemStackChange> changedItems) + public EventArgsInventoryChanged( +#if STARDEW_VALLEY_1_3 + IList<Item> inventory, +#else + List<Item> inventory, +#endif + List<ItemStackChange> 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..180e9d78 100644 --- a/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs +++ b/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs @@ -1,6 +1,11 @@ -using System; +using System; using Microsoft.Xna.Framework; +#if STARDEW_VALLEY_1_3 +using System.Collections.Generic; +using Netcode; +#else using StardewValley; +#endif using Object = StardewValley.Object; namespace StardewModdingAPI.Events @@ -12,7 +17,11 @@ namespace StardewModdingAPI.Events ** Accessors *********/ /// <summary>The current list of objects in the current location.</summary> +#if STARDEW_VALLEY_1_3 + public IDictionary<Vector2, NetRef<Object>> NewObjects { get; } +#else public SerializableDictionary<Vector2, Object> NewObjects { get; } +#endif /********* @@ -20,7 +29,13 @@ namespace StardewModdingAPI.Events *********/ /// <summary>Construct an instance.</summary> /// <param name="newObjects">The current list of objects in the current location.</param> - public EventArgsLocationObjectsChanged(SerializableDictionary<Vector2, Object> newObjects) + public EventArgsLocationObjectsChanged( +#if STARDEW_VALLEY_1_3 + IDictionary<Vector2, NetRef<Object>> newObjects +#else + SerializableDictionary<Vector2, Object> newObjects +#endif + ) { this.NewObjects = newObjects; } |