summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-09-07 16:38:17 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-09-14 19:22:08 -0400
commit4b3a593941bf9880404171c4bef9a3b3f60b6dca (patch)
tree11b95ebc49847ee380d1bbc083742ddffcd877e0 /src/SMAPI/Framework
parent449d793979ade4445b3c7b22f24131dbdae41780 (diff)
downloadSMAPI-4b3a593941bf9880404171c4bef9a3b3f60b6dca.tar.gz
SMAPI-4b3a593941bf9880404171c4bef9a3b3f60b6dca.tar.bz2
SMAPI-4b3a593941bf9880404171c4bef9a3b3f60b6dca.zip
track texture asset keys, fix NPC portrait propagation
Diffstat (limited to 'src/SMAPI/Framework')
-rw-r--r--src/SMAPI/Framework/ContentManagers/BaseContentManager.cs6
1 files changed, 6 insertions, 0 deletions
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
/// <param name="language">The language code for which to inject the asset.</param>
protected virtual void Inject<T>(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;
}