Use case:
- Start the game in language X and register the mod template through
setModTemplate(linkage, template, callback).
- Close the game, switch to language Y, and start the game again.
- Our mod now resolves language Y at runtime, but ModsSettingsApi still shows the cached language X template.
Observed behavior:
- The stale template survives a full client restart and language change.
- Calling
setModTemplate() again with the same linkage is not enough to replace it.
- In practice, the only reliable way we found to switch the configurator text from X to Y is bumping our internal
settingsVersion.
Why this is hard for mod authors:
settingsVersion looks like a schema/versioning field, but today it also acts as the only public cache-busting mechanism for title/tooltip/option-text changes.
- We would prefer not to bump it for every localization fix or packaging mistake.
Requested API:
- A public way to invalidate or replace the cached template for one linkage, for example:
invalidateModTemplate(linkage)
refreshModTemplate(linkage, template, callback=None, buttonHandler=None)
- or a
force=True option on setModTemplate()
The important part is being able to replace the persisted template cache for an existing linkage without having to artificially increase settingsVersion.
If this is intentionally unsupported, it would still help to document that settingsVersion is the expected cache-busting mechanism for any template text change, not only schema changes.
Use case:
setModTemplate(linkage, template, callback).Observed behavior:
setModTemplate()again with the same linkage is not enough to replace it.settingsVersion.Why this is hard for mod authors:
settingsVersionlooks like a schema/versioning field, but today it also acts as the only public cache-busting mechanism for title/tooltip/option-text changes.Requested API:
invalidateModTemplate(linkage)refreshModTemplate(linkage, template, callback=None, buttonHandler=None)force=Trueoption onsetModTemplate()The important part is being able to replace the persisted template cache for an existing linkage without having to artificially increase
settingsVersion.If this is intentionally unsupported, it would still help to document that
settingsVersionis the expected cache-busting mechanism for any template text change, not only schema changes.