diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs index 43d396669..358440a62 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -91,15 +91,9 @@ public void Propagate(IList contentManagers, IDictionary contentManagers, IDictionaryPropagate changes to a cached texture asset. /// The asset name to reload. - /// The language for which to get assets. /// The content managers whose assets to update. /// Whether the in-game world is fully unloaded (e.g. on the title screen), so there's no need to propagate changes into the world. /// Returns whether an asset was loaded. [SuppressMessage("ReSharper", "StringLiteralTypo", Justification = "These deliberately match the asset names.")] - private bool PropagateTexture(IAssetName assetName, LocalizedContentManager.LanguageCode language, IList contentManagers, bool ignoreWorld) + private bool PropagateTexture(IAssetName assetName, IList contentManagers, bool ignoreWorld) { bool changed = false; + // get default language + // This method replaces the textures that would be loaded if you called `contentManager.Load(assetName)`, + // which internally maps to `contentManager.LoadLocalized(assetName, currentLanguage)` regardless of + // the asset name's language. If the asset name includes a locale, `LoadLocalized` handles that internally. + LocalizedContentManager.LanguageCode currentLanguage = LocalizedContentManager.CurrentLanguageCode; + // update textures in-place (0 = localized asset name, 1 = base asset name) for (int i = 0; i < 2; i++) { @@ -170,7 +169,7 @@ private bool PropagateTexture(IAssetName assetName, LocalizedContentManager.Lang Lazy newTexture = new(() => { if (this.DisposableContentManager.DoesAssetExist(name)) - return this.DisposableContentManager.LoadLocalized(name, language, useCache: false); + return this.DisposableContentManager.LoadLocalized(name, currentLanguage, useCache: false); this.Monitor.Log($"Skipped reload for '{name.Name}' because the underlying asset no longer exists.", LogLevel.Warn); return null; @@ -184,7 +183,7 @@ private bool PropagateTexture(IAssetName assetName, LocalizedContentManager.Lang if (newTexture.Value is null) break; - Texture2D texture = contentManager.LoadLocalized(name, language, useCache: true); + Texture2D texture = contentManager.LoadLocalized(name, currentLanguage, useCache: true); texture.CopyFromTexture(newTexture.Value); changed = true; }