diff options
Diffstat (limited to 'src/SMAPI/Framework/Content/AssetInfo.cs')
-rw-r--r-- | src/SMAPI/Framework/Content/AssetInfo.cs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/SMAPI/Framework/Content/AssetInfo.cs b/src/SMAPI/Framework/Content/AssetInfo.cs index 6a5b4f31..556f1c2a 100644 --- a/src/SMAPI/Framework/Content/AssetInfo.cs +++ b/src/SMAPI/Framework/Content/AssetInfo.cs @@ -23,8 +23,11 @@ namespace StardewModdingAPI.Framework.Content public IAssetName Name { get; } /// <inheritdoc /> - [Obsolete($"Use {nameof(Name)} instead.")] - public string AssetName => this.Name.Name; + public IAssetName NameWithoutLocale { get; } + + /// <inheritdoc /> + [Obsolete($"Use {nameof(Name)} or {nameof(NameWithoutLocale)} instead.")] + public string AssetName => this.NameWithoutLocale.Name; /// <inheritdoc /> public Type DataType { get; } @@ -42,15 +45,16 @@ namespace StardewModdingAPI.Framework.Content { this.Locale = locale; this.Name = assetName; + this.NameWithoutLocale = assetName.GetBaseAssetName(); this.DataType = type; this.GetNormalizedPath = getNormalizedPath; } /// <inheritdoc /> - [Obsolete($"Use {nameof(Name)}.{nameof(IAssetName.IsEquivalentTo)} instead.")] + [Obsolete($"Use {nameof(Name)}.{nameof(IAssetName.IsEquivalentTo)} or {nameof(NameWithoutLocale)}.{nameof(IAssetName.IsEquivalentTo)} instead.")] public bool AssetNameEquals(string path) { - return this.Name.IsEquivalentTo(path); + return this.NameWithoutLocale.IsEquivalentTo(path); } |