Skip to content

Conversation

@SinZ163
Copy link
Contributor

@SinZ163 SinZ163 commented Sep 15, 2025

This attempts to fix a situation where a mod (like FIASA) had a tilesheet reference explicitly loading a localized tilesheet when the user isn't playing in that language which can chain react into causing every content manager to load that localized version when its trying to propagate to each of their caches.

Before: https://smapi.io/log/8e5b17a013ce4582bed7dddb5cb0fc8e?Levels=trace~debug~info~warn~error~alert~critical&Page=37&PerPage=1000
image

After: https://smapi.io/log/5162e2ea154146158fd2dcb1a7b3a338?Levels=trace%7Edebug%7Einfo%7Ewarn%7Eerror%7Ealert%7Ecritical&Page=36&PerPage=1000
image

@Pathoschild Pathoschild force-pushed the bugfix/localized-towninterior branch from 4d4a3c4 to 5822898 Compare December 27, 2025 17:15
This is meant to change the texture that would be retrieved by a fresh `Load`, and `contentManager.Load<T>(assetName)` uses the current language as the default instead of the asset locale.
@Pathoschild Pathoschild force-pushed the bugfix/localized-towninterior branch from 084f7b5 to 5119d85 Compare December 27, 2025 17:45
@Pathoschild
Copy link
Owner

Thanks for the PR!

I think we can extend your fix further. The propagation is meant to replace the texture that would have been retrieved by a fresh Load. The contentManager.Load<T>(assetName) method calls LoadLocalized<T>(assetName, currentLanguage) regardless of the asset name's locale, which is handled separately. So we can probably strip out the custom language handling entirely here.

I rewrote the previous code to make it easier to follow, rebased the PR, and stripped out the language handling entirely. Could you run a test with Profiler for the case you mentioned to make sure it's still fixed?

@Pathoschild Pathoschild added the bug This is an unintended error or behavior that can be addressed with specific development changes. label Dec 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug This is an unintended error or behavior that can be addressed with specific development changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants