diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-03-26 14:07:16 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-03-26 14:07:16 -0400 |
commit | 4c64f9f644c2349d2ca2407ce3aff736ba3fc354 (patch) | |
tree | 61528364330c2c2d9551da7543a8d83e4fedfaba /src/SMAPI/Framework/ContentManagers/GameContentManagerForAssetPropagation.cs | |
parent | ad8912047beaf84ce34f4918703d55841be13ff0 (diff) | |
download | SMAPI-4c64f9f644c2349d2ca2407ce3aff736ba3fc354.tar.gz SMAPI-4c64f9f644c2349d2ca2407ce3aff736ba3fc354.tar.bz2 SMAPI-4c64f9f644c2349d2ca2407ce3aff736ba3fc354.zip |
rewrite content loading to allow handling locale variants (#766, #786, #812)
The game's content pipeline automatically loads localized variants if present. For example, it will try to load "Maps/cave.fr-FR", then "Maps/cave_international", then "Maps/cave". The old content API obfuscates this logic and treats them as interchangeable, which causes edge cases like bundle corruption (#812). This commit rewrites the loading logic to match the game logic when using the new content events, while maintaining the legacy behavior for the old IAssetLoader/IAssetEditor interfaces that'll be removed in SMAPI 4.0.0.
Diffstat (limited to 'src/SMAPI/Framework/ContentManagers/GameContentManagerForAssetPropagation.cs')
-rw-r--r-- | src/SMAPI/Framework/ContentManagers/GameContentManagerForAssetPropagation.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/SMAPI/Framework/ContentManagers/GameContentManagerForAssetPropagation.cs b/src/SMAPI/Framework/ContentManagers/GameContentManagerForAssetPropagation.cs index 847e2ce1..3f7188da 100644 --- a/src/SMAPI/Framework/ContentManagers/GameContentManagerForAssetPropagation.cs +++ b/src/SMAPI/Framework/ContentManagers/GameContentManagerForAssetPropagation.cs @@ -25,9 +25,9 @@ namespace StardewModdingAPI.Framework.ContentManagers : base(name, serviceProvider, rootDirectory, currentCulture, coordinator, monitor, reflection, onDisposing, onLoadingFirstAsset, onAssetLoaded, aggressiveMemoryOptimizations) { } /// <inheritdoc /> - public override T Load<T>(IAssetName assetName, LanguageCode language, bool useCache) + public override T LoadExact<T>(IAssetName assetName, bool useCache) { - T data = base.Load<T>(assetName, language, useCache); + T data = base.LoadExact<T>(assetName, useCache); if (data is Texture2D texture) texture.Tag = this.Tag; |