From 4b3a593941bf9880404171c4bef9a3b3f60b6dca Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 7 Sep 2019 16:38:17 -0400 Subject: track texture asset keys, fix NPC portrait propagation --- src/SMAPI/Framework/ContentManagers/BaseContentManager.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/SMAPI/Framework/ContentManagers') diff --git a/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs b/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs index de39dbae..5283340e 100644 --- a/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs +++ b/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs @@ -6,6 +6,7 @@ using System.Globalization; using System.IO; using System.Linq; using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.Graphics; using StardewModdingAPI.Framework.Content; using StardewModdingAPI.Framework.Exceptions; using StardewModdingAPI.Framework.Reflection; @@ -264,6 +265,11 @@ namespace StardewModdingAPI.Framework.ContentManagers /// The language code for which to inject the asset. protected virtual void Inject(string assetName, T value, LanguageCode language) { + // track asset key + if (value is Texture2D texture) + texture.Name = assetName; + + // cache asset assetName = this.AssertAndNormalizeAssetName(assetName); this.Cache[assetName] = value; } -- cgit