summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-05-27 18:09:04 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-05-27 18:09:04 -0400
commit0209e70695b6d12692d4de554ce1fc9d65ca4715 (patch)
tree011867d845ee3cf2a88f306504a4bdd6fe414ed6 /src/SMAPI/Framework/ContentManagers/BaseContentManager.cs
parent2ab2182645179129997eac3fccb63f6f0683dbe1 (diff)
parente4cd7c8eb09fa50802ce4eb9dbe4683ce61f7a5d (diff)
downloadSMAPI-0209e70695b6d12692d4de554ce1fc9d65ca4715.tar.gz
SMAPI-0209e70695b6d12692d4de554ce1fc9d65ca4715.tar.bz2
SMAPI-0209e70695b6d12692d4de554ce1fc9d65ca4715.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Framework/ContentManagers/BaseContentManager.cs')
-rw-r--r--src/SMAPI/Framework/ContentManagers/BaseContentManager.cs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs b/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs
index ddc02a8c..d7be0c37 100644
--- a/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs
+++ b/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs
@@ -153,7 +153,9 @@ namespace StardewModdingAPI.Framework.ContentManagers
return this.LoadExact<T>(assetName, useCache: useCache);
// check for localized asset
- if (!LocalizedContentManager.localizedAssetNames.TryGetValue(assetName.Name, out _))
+ // ReSharper disable once LocalVariableHidesMember -- this is deliberate
+ Dictionary<string, string> localizedAssetNames = this.Coordinator.LocalizedAssetNames.Value;
+ if (!localizedAssetNames.TryGetValue(assetName.Name, out _))
{
string localeCode = this.LanguageCodeString(language);
IAssetName localizedName = new AssetName(baseName: assetName.BaseName, localeCode: localeCode, languageCode: language);
@@ -161,7 +163,7 @@ namespace StardewModdingAPI.Framework.ContentManagers
try
{
T data = this.LoadExact<T>(localizedName, useCache: useCache);
- LocalizedContentManager.localizedAssetNames[assetName.Name] = localizedName.Name;
+ localizedAssetNames[assetName.Name] = localizedName.Name;
return data;
}
catch (ContentLoadException)
@@ -170,18 +172,18 @@ namespace StardewModdingAPI.Framework.ContentManagers
try
{
T data = this.LoadExact<T>(localizedName, useCache: useCache);
- LocalizedContentManager.localizedAssetNames[assetName.Name] = localizedName.Name;
+ localizedAssetNames[assetName.Name] = localizedName.Name;
return data;
}
catch (ContentLoadException)
{
- LocalizedContentManager.localizedAssetNames[assetName.Name] = assetName.Name;
+ localizedAssetNames[assetName.Name] = assetName.Name;
}
}
}
// use cached key
- string rawName = LocalizedContentManager.localizedAssetNames[assetName.Name];
+ string rawName = localizedAssetNames[assetName.Name];
if (assetName.Name != rawName)
assetName = this.Coordinator.ParseAssetName(rawName, allowLocales: this.TryLocalizeKeys);
return this.LoadExact<T>(assetName, useCache: useCache);