summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/Content
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-06-20 18:01:48 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-06-20 18:01:48 -0400
commitdab1ef6acc243726247cee57877c3b3100106522 (patch)
tree627610696a998621327fb019586f956b9360bb95 /src/SMAPI/Framework/Content
parente0ef8a20a5e7ccf1de32ff1a06f1aa62e37eb1db (diff)
downloadSMAPI-dab1ef6acc243726247cee57877c3b3100106522.tar.gz
SMAPI-dab1ef6acc243726247cee57877c3b3100106522.tar.bz2
SMAPI-dab1ef6acc243726247cee57877c3b3100106522.zip
add flag to disable deprecated code
Diffstat (limited to 'src/SMAPI/Framework/Content')
-rw-r--r--src/SMAPI/Framework/Content/AssetInfo.cs12
-rw-r--r--src/SMAPI/Framework/Content/AssetInterceptorChange.cs3
2 files changed, 11 insertions, 4 deletions
diff --git a/src/SMAPI/Framework/Content/AssetInfo.cs b/src/SMAPI/Framework/Content/AssetInfo.cs
index 773e3126..43feed27 100644
--- a/src/SMAPI/Framework/Content/AssetInfo.cs
+++ b/src/SMAPI/Framework/Content/AssetInfo.cs
@@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework.Graphics;
+#if SMAPI_DEPRECATED
using StardewModdingAPI.Framework.Deprecations;
+#endif
namespace StardewModdingAPI.Framework.Content
{
@@ -30,6 +32,10 @@ namespace StardewModdingAPI.Framework.Content
public IAssetName NameWithoutLocale => this.NameWithoutLocaleImpl ??= this.Name.GetBaseAssetName();
/// <inheritdoc />
+ public Type DataType { get; }
+
+#if SMAPI_DEPRECATED
+ /// <inheritdoc />
[Obsolete($"Use {nameof(AssetInfo.Name)} or {nameof(AssetInfo.NameWithoutLocale)} instead. This property will be removed in SMAPI 4.0.0.")]
public string AssetName
{
@@ -50,9 +56,7 @@ namespace StardewModdingAPI.Framework.Content
return this.NameWithoutLocale.Name;
}
}
-
- /// <inheritdoc />
- public Type DataType { get; }
+#endif
/*********
@@ -71,6 +75,7 @@ namespace StardewModdingAPI.Framework.Content
this.GetNormalizedPath = getNormalizedPath;
}
+#if SMAPI_DEPRECATED
/// <inheritdoc />
[Obsolete($"Use {nameof(Name)}.{nameof(IAssetName.IsEquivalentTo)} or {nameof(AssetInfo.NameWithoutLocale)}.{nameof(IAssetName.IsEquivalentTo)} instead. This method will be removed in SMAPI 4.0.0.")]
public bool AssetNameEquals(string path)
@@ -90,6 +95,7 @@ namespace StardewModdingAPI.Framework.Content
return this.NameWithoutLocale.IsEquivalentTo(path);
}
+#endif
/*********
diff --git a/src/SMAPI/Framework/Content/AssetInterceptorChange.cs b/src/SMAPI/Framework/Content/AssetInterceptorChange.cs
index f3d4f3f4..3b5068dc 100644
--- a/src/SMAPI/Framework/Content/AssetInterceptorChange.cs
+++ b/src/SMAPI/Framework/Content/AssetInterceptorChange.cs
@@ -1,8 +1,8 @@
+#if SMAPI_DEPRECATED
using System;
using System.Reflection;
using StardewModdingAPI.Internal;
-#pragma warning disable CS0618 // obsolete asset interceptors deliberately supported here
namespace StardewModdingAPI.Framework.Content
{
/// <summary>A wrapper for <see cref="IAssetEditor"/> and <see cref="IAssetLoader"/> for internal cache invalidation.</summary>
@@ -103,3 +103,4 @@ namespace StardewModdingAPI.Framework.Content
}
}
}
+#endif