A mod for the game Hollow Knight. Goal is to improve boss fight training experience in Godhome by tracking per-boss win/loss counts for Hall of Gods and pantheons.
Roy — Today at 4:42 PM
(3rd) different topic:
I think the modding api / custom menu part of it is caching the menu/screen instances and it causes menu localization to work weirdly.
Currently behavior: if one open some mod menu (e.g. the mod list and some inner mod menu), then change language, then visit those menus again, they remain in previous language.
(Arguable) expected behavior: after change language, revisiting the menus will see them in the current language.
Someone — Today at 6:58 PM
I’ve mentioned this before, the result was make monobehaviors for changing text yourself and add them to menu objects
Roy — Today at 7:02 PM
And how do I trigger the monobehaviors? E.g. are there some event like "changing language" that I can subscribe to; or is it already a part of the monobehavior setup (which I'm not familiar with at all).
Someone — Today at 7:04 PM
I’ve used On.Language.Language.DoSwitch in a unreleased mod, but it’s been a while since I’ve tested it. If that’s not it, it’s somewhere in the Language class
In the monobehavior’s Awake method i’d subscribe an instance method to it, in Start I’d set the text to the current language, and in OnDestroy I’d unsubscribe
Ex (in a monobehavior class):
Roy — Today at 4:42 PM (3rd) different topic: I think the modding api / custom menu part of it is caching the menu/screen instances and it causes menu localization to work weirdly. Currently behavior: if one open some mod menu (e.g. the mod list and some inner mod menu), then change language, then visit those menus again, they remain in previous language. (Arguable) expected behavior: after change language, revisiting the menus will see them in the current language.
Someone — Today at 6:58 PM I’ve mentioned this before, the result was make monobehaviors for changing text yourself and add them to menu objects
Roy — Today at 7:02 PM And how do I trigger the monobehaviors? E.g. are there some event like "changing language" that I can subscribe to; or is it already a part of the monobehavior setup (which I'm not familiar with at all).
Someone — Today at 7:04 PM I’ve used On.Language.Language.DoSwitch in a unreleased mod, but it’s been a while since I’ve tested it. If that’s not it, it’s somewhere in the Language class In the monobehavior’s Awake method i’d subscribe an instance method to it, in Start I’d set the text to the current language, and in OnDestroy I’d unsubscribe Ex (in a monobehavior class):