diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-03-14 04:43:28 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-03-14 04:43:28 -0400 |
commit | 04388fe7e3b721358de25d64607d47d5f6113eda (patch) | |
tree | 2a5993976013d941590743d4cb71f67793d41fe4 /src/SMAPI/Framework/ContentManagers | |
parent | 77629a528a2f93a2977a1bf63e2e18faaaffaaaf (diff) | |
download | SMAPI-04388fe7e3b721358de25d64607d47d5f6113eda.tar.gz SMAPI-04388fe7e3b721358de25d64607d47d5f6113eda.tar.bz2 SMAPI-04388fe7e3b721358de25d64607d47d5f6113eda.zip |
fix some assets not reapplied correctly when playing in non-English and returning to title
Diffstat (limited to 'src/SMAPI/Framework/ContentManagers')
3 files changed, 0 insertions, 32 deletions
diff --git a/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs b/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs index 1a64dab8..7244a534 100644 --- a/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs +++ b/src/SMAPI/Framework/ContentManagers/BaseContentManager.cs @@ -122,9 +122,6 @@ namespace StardewModdingAPI.Framework.ContentManagers public virtual void OnLocaleChanged() { } /// <inheritdoc /> - public virtual void OnReturningToTitleScreen() { } - - /// <inheritdoc /> [Pure] public string NormalizePathSeparators(string path) { diff --git a/src/SMAPI/Framework/ContentManagers/GameContentManager.cs b/src/SMAPI/Framework/ContentManagers/GameContentManager.cs index 8e78faba..80a9937a 100644 --- a/src/SMAPI/Framework/ContentManagers/GameContentManager.cs +++ b/src/SMAPI/Framework/ContentManagers/GameContentManager.cs @@ -137,31 +137,6 @@ namespace StardewModdingAPI.Framework.ContentManagers } /// <inheritdoc /> - public override void OnReturningToTitleScreen() - { - // The game clears LocalizedContentManager.localizedAssetNames after returning to the title screen. That - // causes an inconsistency in the SMAPI asset cache, which leads to an edge case where assets already - // provided by mods via IAssetLoader when playing in non-English are ignored. - // - // For example, let's say a mod provides the 'Data\mail' asset through IAssetLoader when playing in - // Portuguese. Here's the normal load process after it's loaded: - // 1. The game requests Data\mail. - // 2. SMAPI sees that it's already cached, and calls LoadRaw to bypass asset interception. - // 3. LoadRaw sees that there's a localized key mapping, and gets the mapped key. - // 4. In this case "Data\mail" is mapped to "Data\mail" since it was loaded by a mod, so it loads that - // asset. - // - // When the game clears localizedAssetNames, that process goes wrong in step 4: - // 3. LoadRaw sees that there's no localized key mapping *and* the locale is non-English, so it attempts - // to load from the localized key format. - // 4. In this case that's 'Data\mail.pt-BR', so it successfully loads that asset. - // 5. Since we've bypassed asset interception at this point, it's loaded directly from the base content - // manager without mod changes. - if (LocalizedContentManager.CurrentLanguageCode != LocalizedContentManager.LanguageCode.en) - this.InvalidateCache((_, _) => true); - } - - /// <inheritdoc /> public override LocalizedContentManager CreateTemporary() { return this.Coordinator.CreateGameContentManager("(temporary)"); diff --git a/src/SMAPI/Framework/ContentManagers/IContentManager.cs b/src/SMAPI/Framework/ContentManagers/IContentManager.cs index 1e222472..d7963305 100644 --- a/src/SMAPI/Framework/ContentManagers/IContentManager.cs +++ b/src/SMAPI/Framework/ContentManagers/IContentManager.cs @@ -69,9 +69,5 @@ namespace StardewModdingAPI.Framework.ContentManagers /// <summary>Perform any cleanup needed when the locale changes.</summary> void OnLocaleChanged(); - - /// <summary>Clean up when the player is returning to the title screen.</summary> - /// <remarks>This is called after the player returns to the title screen, but before <see cref="Game1.CleanupReturningToTitle"/> runs.</remarks> - void OnReturningToTitleScreen(); } } |