summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework')
-rw-r--r--src/SMAPI/Framework/ContentCoordinator.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/ContentCoordinator.cs b/src/SMAPI/Framework/ContentCoordinator.cs
index dd3d2917..fc61b44b 100644
--- a/src/SMAPI/Framework/ContentCoordinator.cs
+++ b/src/SMAPI/Framework/ContentCoordinator.cs
@@ -407,6 +407,18 @@ namespace StardewModdingAPI.Framework
}
}
+ // forget localized flags
+ // A mod might provide a localized variant of a normally non-localized asset (like
+ // `Maps/MovieTheater.fr-FR`). When the asset is invalidated, we need to recheck
+ // whether the asset is localized in case it stops providing it.
+ foreach (IAssetName assetName in invalidatedAssets.Keys)
+ {
+ LocalizedContentManager.localizedAssetNames.Remove(assetName.Name);
+
+ if (LocalizedContentManager.localizedAssetNames.TryGetValue(assetName.BaseName, out string? targetForBaseKey) && targetForBaseKey == assetName.Name)
+ LocalizedContentManager.localizedAssetNames.Remove(assetName.BaseName);
+ }
+
// special case: maps may be loaded through a temporary content manager that's removed while the map is still in use.
// This notably affects the town and farmhouse maps.
if (Game1.locations != null)