diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-05-27 18:09:04 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-05-27 18:09:04 -0400 |
commit | 0209e70695b6d12692d4de554ce1fc9d65ca4715 (patch) | |
tree | 011867d845ee3cf2a88f306504a4bdd6fe414ed6 /src/SMAPI/Framework/ContentManagers/BaseContentManager.cs | |
parent | 2ab2182645179129997eac3fccb63f6f0683dbe1 (diff) | |
parent | e4cd7c8eb09fa50802ce4eb9dbe4683ce61f7a5d (diff) | |
download | SMAPI-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.cs | 12 |
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); |