fix(menu): a Game language or Menu language picked in the menu is kept #3084
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3084
Loading…
Reference in a new issue
No description provided.
Delete branch "llun/Longshot:fix/language-rows-kept"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
A player picked Italian in the Insert menu, but the game stayed in English. The menu's own language also went back to
Auto at every restart. These are two bugs, both from #2822.
game_language = 6) instead of the code ("it"). The gameneeds a code, so it ignored the 6 and played in English. The row read the 6 back and still showed Italiano.
(
choicesFrom), but the file's reader only allowed the options inmod.toml, which for this row is just Auto. Savedchoices of Microphone, Graphics card, ReShade preset file and NFC tag were dropped the same way.
What this changes:
choicesFromhas no upper limit when the file is read.next time the game writes the file.
launcher.inialso ended up as a number, andlongshot modwould write 0. Both are fixed.To see it on
main: in the Insert menu's Gameplay tab, set Game language and Menu language to Italiano, then restart.The game is in English, Menu language is Auto, and the log says
oe: the settings' game_language "6" is not a language the game has.Read first:
options_valueandoptions_linesingame/crates/api/src/settings/service.rs, thenlanguage_codeandin_rangeingame/crates/longshot-game/src/settings_file.rs.Testing
Tested: Windows 11, RTX 5080, sandbox on, no window, the
kokiri-startsave, throwaway profiles. The rows were setover the control bridge, which uses the menu's own setter. One game folder, built from
mainand then from this branch:main@b4d56f526: pick Italian on both rows, then start twice more. Both starts logoe: language en-US (the default), Menu language is Auto, and the file holdsgame_language = 6.oe: language it (game_language in the settings), Menulanguage stays Italiano, also after another setting changes, and the file holds
game_language = "it".pt-BR). Auto removed the line, and the start afterit was in English.
mainhad broken: Italian at the first start. The file held"it"after thenext change of a setting.
dev.py smoke: PASS.Five new tests fail on
mainand pass here. Two of them cover all 16 languages:the_game_language_rows_choice_is_kept_by_its_code,a_game_language_kept_as_its_rows_number_is_read_as_its_code,a_choice_whose_list_goes_on_with_the_pcs_is_kept,a_launchers_game_language_is_set_by_its_codeandthe_game_language_is_written_by_its_code.The suite, run in parts, all with gnullvm:
test_i18n_completefails, as it does onmain@b4d56f526(#3065 fixes it). 51 are markedto be skipped on Windows.
test_lifter's three steps, run directly): format and clippy are clean, and 3424 tests pass, 0 fail. Onetest was left out because it is already known to fail on
main:every_site_has_one_owner_and_the_sites_are_the_ones_before_the_split.Still to test:
the game in that language (by hand)
Measurements
Nothing to measure: this changes how lines of the settings file are read and written, and nothing that runs each frame.
Risks
A revert is enough.
they picked.
picks it again.
limit either.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Tested in game: Windows 11, RTX 5080, sandbox on, kokiri-start, throwaway profiles: on main Italian picked on both rows is English with the menu on Auto after a restart (game_language = 6); here the game and the menu stay Italian over restarts, a profile main left with 6 starts in Italian, Portuguese and Auto work, and dev.py smoke passes.
@review
Recommendation: Approve. The menu fix works for the stock languages in the reported Windows run, but the shared settings path cannot read or select mod-provided languages through
longshot mod settings. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.The change saves Game language by code, repairs stock-language numbers from affected nightlies, and preserves dynamically populated choices. It also makes the settings service depend on a published language list that the offline mod tool does not initialize.
Should fix (1): not blocking, but worth doing before merging.
game/crates/api/src/settings/service.rs:492: The language codec uses the process-global published list, but the offline mod settings command never publishes the loading mods' languages. (more on the line) Do: Give the offline settings service the language list from its scanned loader before reading or setting the row, and test reading and selecting a mod-provided language through the command.Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
@fixcan do L1.Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes. The author reports that Italian remained selected for both rows across restarts on Windows, where main reverted to English and Auto; Portuguese, Auto, and repair of a saved 6 also worked. This is not a performance change.
Other systems: The shared settings reader also handles microphone, GPU, ReShade and NFC choices; the new test covers their saved numbers, but device selection has not been tested on hardware. Mod-provided languages in the offline mod tool need a fix. Linux and manual menu input remain untested.
Switches: None.
Reviewed:
5b3d63d040againstb4d56f5264: Read the repository rules, contribution guide, PR template, standards, diff and commits; inspected the changed settings paths and their callers, language registry, manifest declarations, host language selection and mod tool. The large service and settings-now files were inspected around the changes and relevant callers rather than fully read; no generated files or recorded runs were changed. Tooling's separate repository was not available in the checkout.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no tests or project code were run. CI was still running in the supplied status.
Overlaps and merge order: Not checked; the network is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -485,0 +489,4 @@Codec::Language => {let code = match index() {0 => String::new(),i => crate::game_languages::row_code(i).ok_or("not one of the game's languages")?,L1 (should fix): The language codec uses the process-global published list, but the offline mod settings command never publishes the loading mods' languages.
When: With a mod adding a language at row 17,
longshot mod settings system/interface --set game_language=17reachesrow_code(17)with an empty added-language list and refuses the setting. Reading an existing code for that language similarly reports Auto throughrow_value.Do: Give the offline settings service the language list from its scanned loader before reading or setting the row, and test reading and selecting a mod-provided language through the command.
Both of BeanBot's points, after the merge:
longshot mod settingsdid not know the languages mods add. The fix and its test missed this merge and are in #3092.238f4f65fwith #3092's fix). Italian was picked on the Game language row with the menu's own keys, over the control bridge. The restart question came up and "yes" was pressed (menu: restart now, to apply game_language). The run had no window, so the game did not restart from that; the bridge'srelaunchrestarted it. The next start logsoe: language it (game_language in the settings). A mouse or a gamepad, and the restart from the question itself, are still not tested.