-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save in-game language setting #4026
Save in-game language setting #4026
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems a bit odd to just thow a CVarSave()
call in here
we already have a call to execute hooks when setting the language
Shipwright/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c
Lines 753 to 757 in 612da02
// Persist the new language so it is not overridden on the next frame | |
if (languageChanged) { | |
CVarSetInteger("gLanguages", gSaveContext.language); | |
GameInteractor_ExecuteOnSetGameLanguage(); | |
} |
that is also called when changing it from the menu bar
Shipwright/soh/soh/SohMenuBar.cpp
Lines 521 to 533 in 897d3ef
if (ImGui::BeginMenu("Languages")) { | |
UIWidgets::PaddedEnhancementCheckbox("Translate Title Screen", "gTitleScreenTranslation"); | |
if (UIWidgets::EnhancementRadioButton("English", "gLanguages", LANGUAGE_ENG)) { | |
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnSetGameLanguage>(); | |
} | |
if (UIWidgets::EnhancementRadioButton("German", "gLanguages", LANGUAGE_GER)) { | |
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnSetGameLanguage>(); | |
} | |
if (UIWidgets::EnhancementRadioButton("French", "gLanguages", LANGUAGE_FRA)) { | |
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnSetGameLanguage>(); | |
} | |
ImGui::EndMenu(); | |
} |
it seems the actual issue is the strange mix of using the cvar and global save setting and setting the in game language based on that in a few places https://github.com/search?q=repo%3AHarbourMasters%2FShipwright%20gLanguages&type=code
for a short term fix i think moving the CVarSave()
call down inside the if (languageChanged)
block should work, but it'd be nice to clean this up and not use 2 things to track the language selection
That was the first iteration of my changes before I created this PR, but |
that definitely makes things odd, because it seems with the current logic you could update the language in the in-game options menu, then change something unrelated in the menu bar and have the language saved without choosing to save it in-game not something this PR is introducing, just messy language logic that's been around for a while |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems actually cleaning this up will be decently big, so i made an issue for that #4044
for now let's just
Fixes #4022.
Build Artifacts