diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-03-26 15:02:11 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-03-26 15:02:11 -0400 |
commit | 8d704153762fa73416a3ccb44ee71032952802eb (patch) | |
tree | 1435fe032cee1b88aa31ed567addaea6c2d6443b /src/SMAPI/Framework/Content/AssetInfo.cs | |
parent | 4c64f9f644c2349d2ca2407ce3aff736ba3fc354 (diff) | |
download | SMAPI-8d704153762fa73416a3ccb44ee71032952802eb.tar.gz SMAPI-8d704153762fa73416a3ccb44ee71032952802eb.tar.bz2 SMAPI-8d704153762fa73416a3ccb44ee71032952802eb.zip |
add deprecation notices for SMAPI 4.0.0 (#766)
Diffstat (limited to 'src/SMAPI/Framework/Content/AssetInfo.cs')
-rw-r--r-- | src/SMAPI/Framework/Content/AssetInfo.cs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/SMAPI/Framework/Content/AssetInfo.cs b/src/SMAPI/Framework/Content/AssetInfo.cs index 556f1c2a..6e93c33c 100644 --- a/src/SMAPI/Framework/Content/AssetInfo.cs +++ b/src/SMAPI/Framework/Content/AssetInfo.cs @@ -27,7 +27,20 @@ namespace StardewModdingAPI.Framework.Content /// <inheritdoc /> [Obsolete($"Use {nameof(Name)} or {nameof(NameWithoutLocale)} instead.")] - public string AssetName => this.NameWithoutLocale.Name; + public string AssetName + { + get + { + SCore.DeprecationManager.Warn( + source: SCore.DeprecationManager.GetSourceNameFromStack(), + nounPhrase: $"{nameof(IAssetInfo)}.{nameof(IAssetInfo.AssetName)}", + version: "3.14.0", + severity: DeprecationLevel.Notice + ); + + return this.NameWithoutLocale.Name; + } + } /// <inheritdoc /> public Type DataType { get; } @@ -54,6 +67,14 @@ namespace StardewModdingAPI.Framework.Content [Obsolete($"Use {nameof(Name)}.{nameof(IAssetName.IsEquivalentTo)} or {nameof(NameWithoutLocale)}.{nameof(IAssetName.IsEquivalentTo)} instead.")] public bool AssetNameEquals(string path) { + SCore.DeprecationManager.Warn( + source: SCore.DeprecationManager.GetSourceNameFromStack(), + nounPhrase: $"{nameof(IAssetInfo)}.{nameof(IAssetInfo.AssetNameEquals)}", + version: "3.14.0", + severity: DeprecationLevel.Notice + ); + + return this.NameWithoutLocale.IsEquivalentTo(path); } |