From dab1ef6acc243726247cee57877c3b3100106522 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 20 Jun 2022 18:01:48 -0400 Subject: add flag to disable deprecated code --- src/SMAPI/Framework/Content/AssetInfo.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/SMAPI/Framework/Content/AssetInfo.cs') 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 { @@ -29,6 +31,10 @@ namespace StardewModdingAPI.Framework.Content /// public IAssetName NameWithoutLocale => this.NameWithoutLocaleImpl ??= this.Name.GetBaseAssetName(); + /// + public Type DataType { get; } + +#if SMAPI_DEPRECATED /// [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; } } - - /// - public Type DataType { get; } +#endif /********* @@ -71,6 +75,7 @@ namespace StardewModdingAPI.Framework.Content this.GetNormalizedPath = getNormalizedPath; } +#if SMAPI_DEPRECATED /// [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 /********* -- cgit