diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-03-11 19:10:27 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-03-11 19:10:27 -0400 |
commit | 6db91f832998ab07e7a937c25b32f1151a0274bc (patch) | |
tree | f510083de84a1f9249bd67a6872ed44b199587c6 | |
parent | b8f17e6afb00b78ac31df98f7dc3bbe071a99e47 (diff) | |
download | SMAPI-6db91f832998ab07e7a937c25b32f1151a0274bc.tar.gz SMAPI-6db91f832998ab07e7a937c25b32f1151a0274bc.tar.bz2 SMAPI-6db91f832998ab07e7a937c25b32f1151a0274bc.zip |
drop support for some deprecated APIs in the Stardew Valley 1.3 branch (#453)
-rw-r--r-- | docs/release-notes.md | 3 | ||||
-rw-r--r-- | src/SMAPI/Events/EventArgsInput.cs | 2 | ||||
-rw-r--r-- | src/SMAPI/Framework/ModHelpers/ReflectionHelper.cs | 3 | ||||
-rw-r--r-- | src/SMAPI/Framework/Reflection/ReflectedField.cs | 5 | ||||
-rw-r--r-- | src/SMAPI/Framework/Reflection/ReflectedMethod.cs | 5 | ||||
-rw-r--r-- | src/SMAPI/Framework/Reflection/ReflectedProperty.cs | 5 | ||||
-rw-r--r-- | src/SMAPI/IPrivateField.cs | 2 | ||||
-rw-r--r-- | src/SMAPI/IPrivateMethod.cs | 2 | ||||
-rw-r--r-- | src/SMAPI/IPrivateProperty.cs | 2 | ||||
-rw-r--r-- | src/SMAPI/IReflectionHelper.cs | 2 |
10 files changed, 27 insertions, 4 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md index 05a95fc1..2d71da7f 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -3,6 +3,9 @@ * For players: * Updated for Stardew Valley 1.3 (multiplayer update); no longer compatible with earlier versions. +* For modders: + * Dropped support for some deprecated APIs. + ## 2.5.3 * For players: * Simplified and improved skipped-incompatible-mod messages. 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/Framework/ModHelpers/ReflectionHelper.cs b/src/SMAPI/Framework/ModHelpers/ReflectionHelper.cs index 81453003..e5bf47f6 100644 --- a/src/SMAPI/Framework/ModHelpers/ReflectionHelper.cs +++ b/src/SMAPI/Framework/ModHelpers/ReflectionHelper.cs @@ -107,7 +107,7 @@ namespace StardewModdingAPI.Framework.ModHelpers ); } - +#if !STARDEW_VALLEY_1_3 /**** ** Obsolete ****/ @@ -221,6 +221,7 @@ namespace StardewModdingAPI.Framework.ModHelpers this.DeprecationManager.Warn($"{nameof(IReflectionHelper)}.GetPrivate*", "2.3", DeprecationLevel.Notice); return (IPrivateMethod)this.GetMethod(type, name, required); } +#endif /********* diff --git a/src/SMAPI/Framework/Reflection/ReflectedField.cs b/src/SMAPI/Framework/Reflection/ReflectedField.cs index ad1557bb..fb420dc5 100644 --- a/src/SMAPI/Framework/Reflection/ReflectedField.cs +++ b/src/SMAPI/Framework/Reflection/ReflectedField.cs @@ -5,7 +5,10 @@ namespace StardewModdingAPI.Framework.Reflection { /// <summary>A field obtained through reflection.</summary> /// <typeparam name="TValue">The field value type.</typeparam> - internal class ReflectedField<TValue> : IPrivateField<TValue>, IReflectedField<TValue> + internal class ReflectedField<TValue> : IReflectedField<TValue> +#if !STARDEW_VALLEY_1_3 + , IPrivateField<TValue> +#endif { /********* ** Properties diff --git a/src/SMAPI/Framework/Reflection/ReflectedMethod.cs b/src/SMAPI/Framework/Reflection/ReflectedMethod.cs index 376de869..803bc316 100644 --- a/src/SMAPI/Framework/Reflection/ReflectedMethod.cs +++ b/src/SMAPI/Framework/Reflection/ReflectedMethod.cs @@ -4,7 +4,10 @@ using System.Reflection; namespace StardewModdingAPI.Framework.Reflection { /// <summary>A method obtained through reflection.</summary> - internal class ReflectedMethod : IPrivateMethod, IReflectedMethod + internal class ReflectedMethod : IReflectedMethod +#if !STARDEW_VALLEY_1_3 + , IPrivateMethod +#endif { /********* ** Properties diff --git a/src/SMAPI/Framework/Reflection/ReflectedProperty.cs b/src/SMAPI/Framework/Reflection/ReflectedProperty.cs index d6c964c1..4f9d4e19 100644 --- a/src/SMAPI/Framework/Reflection/ReflectedProperty.cs +++ b/src/SMAPI/Framework/Reflection/ReflectedProperty.cs @@ -5,7 +5,10 @@ namespace StardewModdingAPI.Framework.Reflection { /// <summary>A property obtained through reflection.</summary> /// <typeparam name="TValue">The property value type.</typeparam> - internal class ReflectedProperty<TValue> : IPrivateProperty<TValue>, IReflectedProperty<TValue> + internal class ReflectedProperty<TValue> : IReflectedProperty<TValue> +#if !STARDEW_VALLEY_1_3 + , IPrivateProperty<TValue> +#endif { /********* ** Properties diff --git a/src/SMAPI/IPrivateField.cs b/src/SMAPI/IPrivateField.cs index 512bfdab..42bf7d2e 100644 --- a/src/SMAPI/IPrivateField.cs +++ b/src/SMAPI/IPrivateField.cs @@ -1,3 +1,4 @@ +#if !STARDEW_VALLEY_1_3 using System; using System.Reflection; @@ -26,3 +27,4 @@ namespace StardewModdingAPI void SetValue(TValue value); } } +#endif diff --git a/src/SMAPI/IPrivateMethod.cs b/src/SMAPI/IPrivateMethod.cs index b2fdaaeb..c24db602 100644 --- a/src/SMAPI/IPrivateMethod.cs +++ b/src/SMAPI/IPrivateMethod.cs @@ -1,3 +1,4 @@ +#if !STARDEW_VALLEY_1_3 using System; using System.Reflection; @@ -27,3 +28,4 @@ namespace StardewModdingAPI void Invoke(params object[] arguments); } } +#endif diff --git a/src/SMAPI/IPrivateProperty.cs b/src/SMAPI/IPrivateProperty.cs index a24495dd..a1b21a69 100644 --- a/src/SMAPI/IPrivateProperty.cs +++ b/src/SMAPI/IPrivateProperty.cs @@ -1,3 +1,4 @@ +#if !STARDEW_VALLEY_1_3 using System; using System.Reflection; @@ -26,3 +27,4 @@ namespace StardewModdingAPI void SetValue(TValue value); } } +#endif diff --git a/src/SMAPI/IReflectionHelper.cs b/src/SMAPI/IReflectionHelper.cs index fcebae42..60441471 100644 --- a/src/SMAPI/IReflectionHelper.cs +++ b/src/SMAPI/IReflectionHelper.cs @@ -48,6 +48,7 @@ namespace StardewModdingAPI /// <param name="required">Whether to throw an exception if the field is not found.</param> IReflectedMethod GetMethod(Type type, string name, bool required = true); +#if !STARDEW_VALLEY_1_3 /***** ** Obsolete *****/ @@ -114,5 +115,6 @@ namespace StardewModdingAPI /// <param name="required">Whether to throw an exception if the private field is not found.</param> [Obsolete("Use " + nameof(IReflectionHelper) + "." + nameof(IReflectionHelper.GetMethod) + " instead")] IPrivateMethod GetPrivateMethod(Type type, string name, bool required = true); +#endif } } |