fix(mods): longshot mod settings knows the game languages mods add #3092

Merged
HumanBean merged 2 commits from llun/Longshot:fix/mod-settings-languages into main 2026-12-03 18:26:44 +00:00
Member

Summary

A mod can add a game language. The longshot mod settings command didn't know about those languages: it showed Auto when
one was chosen, and refused to set one. Now it knows them, and shows the name of any game language ("Italiano",
"English (Retold)"), which was empty before.

BeanBot found this in its review of #3084 (its point L1). #3084 was merged before the fix was pushed.

The cause: the Game language row finds a mod's language in a list that the game fills in when it starts. The command
runs without the game, so the list was empty. The command now fills it in from the profile's mods, only for a mod that has
a Game language row.

To see it on main: use a profile with a mod that adds a language, for example en-US-x-retold, and run
longshot mod settings system/interface. It shows game_language = 0. With --set game_language=17 it refuses.

Read first: settings and language_name in game/crates/modtool/src/cmd/state.rs.

Testing

Tested: Windows 11 with an RTX 5080, and Linux in WSL (Ubuntu 24.04). Which commit each test ran on is named below. The
head is 9939a3a7f, on main 1c91b18f8.

  • The real command on Linux (WSL, head): on a throwaway profile with a mod that adds en-US-x-retold, it shows 17
    "English (Retold)", sets 6 "Italiano" ("it") and 17 ("en-US-x-retold"), and refuses 18 and changes nothing.
  • The real command on Windows (5d327053b, before the names): the same numbers and codes.
  • The game (Windows, 5d327053b): dev.py smoke passes.
  • The menu (BeanBot's point L2 in #3084; Windows, 5d327053b): Italian picked on the Game language row with the menu's own keys, over the
    control bridge. The menu's restart question came up, "yes" was pressed, and the log says
    menu: restart now, to apply game_language. The run had no window, so the game did not restart from that; the control
    bridge's relaunch restarted it. The next start logs oe: language it (game_language in the settings).
  • New test: a_game_language_a_mod_adds_is_read_and_set_by_the_settings_command fails on main, and passes on the head
    on Windows and on Linux (WSL). It checks the names too: without language_name it fails on an empty name.

The suite, run in parts, all with gnullvm:

  • modtool, the crate this changes, on the head: 234 pass, 0 fail on Windows. cargo fmt --all --check and modtool's
    clippy are clean there.
  • The other Rust tests, on b6488e65a (main 0b3710dc8, before the names): 2 of 3445 failed. ffi-gen's the_repositorys_files_are_current fails on main
    too. the_typescript_system_mods_pass_their_tests was over its time limit while other builds were running, and passes
    in the modtool run above.
  • Python checks, on b6488e65a: 822 pass and 8 fail. All 8 fail on main too, each run there once:
    test_cursor_hidden_in_play, test_cursor_hidden_linux, test_display_pointer, test_dlss_why,
    test_game_menu_mouse_buttons, test_menu_size, test_screensaver and test_switch_table.
  • Not run: the Linux-only Python checks.

Still to test: None.

Measurements

Nothing to measure: one command line tool reads the languages of the profile's mods, which it has already loaded.

Risks

A revert is enough. Only longshot mod settings changes, and only for a mod with a Game language row. Players see nothing
in the game.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary A mod can add a game language. The `longshot mod settings` command didn't know about those languages: it showed Auto when one was chosen, and refused to set one. Now it knows them, and shows the name of any game language ("Italiano", "English (Retold)"), which was empty before. BeanBot found this in its review of #3084 (its point L1). #3084 was merged before the fix was pushed. **The cause:** the Game language row finds a mod's language in a list that the game fills in when it starts. The command runs without the game, so the list was empty. The command now fills it in from the profile's mods, only for a mod that has a Game language row. **To see it on `main`:** use a profile with a mod that adds a language, for example `en-US-x-retold`, and run `longshot mod settings system/interface`. It shows `game_language = 0`. With `--set game_language=17` it refuses. Read first: `settings` and `language_name` in `game/crates/modtool/src/cmd/state.rs`. ## Testing **Tested:** Windows 11 with an RTX 5080, and Linux in WSL (Ubuntu 24.04). Which commit each test ran on is named below. The head is 9939a3a7f, on main 1c91b18f8. - **The real command on Linux (WSL, head):** on a throwaway profile with a mod that adds `en-US-x-retold`, it shows 17 "English (Retold)", sets 6 "Italiano" (`"it"`) and 17 (`"en-US-x-retold"`), and refuses 18 and changes nothing. - **The real command on Windows (5d327053b, before the names):** the same numbers and codes. - **The game (Windows, 5d327053b):** `dev.py smoke` passes. - **The menu (BeanBot's point L2 in #3084; Windows, 5d327053b):** Italian picked on the Game language row with the menu's own keys, over the control bridge. The menu's restart question came up, "yes" was pressed, and the log says `menu: restart now, to apply game_language`. The run had no window, so the game did not restart from that; the control bridge's `relaunch` restarted it. The next start logs `oe: language it (game_language in the settings)`. - **New test:** `a_game_language_a_mod_adds_is_read_and_set_by_the_settings_command` fails on `main`, and passes on the head on Windows and on Linux (WSL). It checks the names too: without `language_name` it fails on an empty name. The suite, run in parts, all with gnullvm: - **modtool**, the crate this changes, on the head: 234 pass, 0 fail on Windows. `cargo fmt --all --check` and modtool's clippy are clean there. - **The other Rust tests**, on b6488e65a (main 0b3710dc8, before the names): 2 of 3445 failed. `ffi-gen`'s `the_repositorys_files_are_current` fails on `main` too. `the_typescript_system_mods_pass_their_tests` was over its time limit while other builds were running, and passes in the modtool run above. - **Python checks**, on b6488e65a: 822 pass and 8 fail. All 8 fail on `main` too, each run there once: `test_cursor_hidden_in_play`, `test_cursor_hidden_linux`, `test_display_pointer`, `test_dlss_why`, `test_game_menu_mouse_buttons`, `test_menu_size`, `test_screensaver` and `test_switch_table`. - **Not run:** the Linux-only Python checks. **Still to test:** None. ## Measurements Nothing to measure: one command line tool reads the languages of the profile's mods, which it has already loaded. ## Risks A revert is enough. Only `longshot mod settings` changes, and only for a mod with a Game language row. Players see nothing in the game. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(mods): longshot mod settings knows the game languages mods add
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
a434bed7be
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Tested in game: Windows 11, RTX 5080: longshot mod settings on a throwaway profile with a mod that adds a language shows it, sets it by its code and refuses a number past the list; dev.py smoke passes; Italian picked with the menu's own keys is played after a restart. This ran on 5d327053b, before the rebase onto 1c91b18f8.

Tested in game: Windows 11, RTX 5080: longshot mod settings on a throwaway profile with a mod that adds a language shows it, sets it by its code and refuses a number past the list; dev.py smoke passes; Italian picked with the menu's own keys is played after a restart. This ran on 5d327053b, before the rebase onto 1c91b18f8.
Author
Member
@review
BeanBot left a comment

Recommendation: Approve. The command now reads and writes the added language in the reported Windows test, but its returned label is empty for that choice. The stated Linux command test is still outstanding. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

The settings command loads the profile’s added game languages before reading or changing a language setting. This fixes the reported numeric selection without changing the game, though the command still does not return the added language’s label.

Should fix (1): not blocking, but worth doing before merging.

  • L1 game/crates/modtool/src/cmd/state.rs:652: The command returns an empty text label for the newly recognized language. (more on the line) Do: Populate the language row’s choices or its returned text from the published stock and added language list, and assert the label in the new test.

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)

  • L2: The Linux command run listed as still to test is needed before merge. When: The only reported real-command run was on Windows; Linux users also invoke this settings command with profile paths and added languages. Do: Run the command on Linux with a profile containing an added language; check reading it, setting it and refusing an out-of-range value.

@fix can 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 the command on Windows reads the added language as 17, sets it and Italian, and refuses 18; the new game-free test covers those cases and is reported to fail on main.

Other systems: The changed path is the mod settings command, not game startup or rendering. The loader uses the same loading-mod selection and language ordering as the game; Linux command behavior remains untested.

Switches: None.

Reviewed: a434bed7be against 1c91b18f86: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the pull request template, both changed files, the diff and both commit messages. Traced the loader, language registry, settings codec, command caller and test fixture. docs/review-checklist.md and the adjacent Tooling/AGENTS.md were absent. No recorded runs, translations or generated files were changed.; nothing run (a code review).

Checked and fine:

  • Both commits record AI assistance.
  • The added test exercises reading, setting stock and added values, and rejecting an out-of-range value.
  • The change adds no switch, generated file, game-derived artifact or renderer API change.

Testing: Read-only review; no commands from the project or tests were run. The author reports 234 modtool tests passing on the current head. CI is still running.

Overlaps and merge order: None identified from the supplied review context.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The command now reads and writes the added language in the reported Windows test, but its returned label is empty for that choice. The stated Linux command test is still outstanding. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. The settings command loads the profile’s added game languages before reading or changing a language setting. This fixes the reported numeric selection without changing the game, though the command still does not return the added language’s label. **Should fix (1)**: not blocking, but worth doing before merging. - **L1** `game/crates/modtool/src/cmd/state.rs:652`: The command returns an empty text label for the newly recognized language. (more on the line) **Do:** Populate the language row’s choices or its returned text from the published stock and added language list, and assert the label in the new test. **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) - **L2**: The Linux command run listed as still to test is needed before merge. *When:* The only reported real-command run was on Windows; Linux users also invoke this settings command with profile paths and added languages. **Do:** Run the command on Linux with a profile containing an added language; check reading it, setting it and refusing an out-of-range value. `@fix` can do L1. **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes. The author reports that the command on Windows reads the added language as 17, sets it and Italian, and refuses 18; the new game-free test covers those cases and is reported to fail on main. **Other systems:** The changed path is the mod settings command, not game startup or rendering. The loader uses the same loading-mod selection and language ordering as the game; Linux command behavior remains untested. **Switches:** None. **Reviewed:** a434bed7be60 against 1c91b18f86ae: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the pull request template, both changed files, the diff and both commit messages. Traced the loader, language registry, settings codec, command caller and test fixture. docs/review-checklist.md and the adjacent Tooling/AGENTS.md were absent. No recorded runs, translations or generated files were changed.; nothing run (a code review). **Checked and fine:** - Both commits record AI assistance. - The added test exercises reading, setting stock and added values, and rejecting an out-of-range value. - The change adds no switch, generated file, game-derived artifact or renderer API change. **Testing:** Read-only review; no commands from the project or tests were run. The author reports 234 modtool tests passing on the current head. CI is still running. **Overlaps and merge order:** None identified from the supplied review context. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
@ -649,1 +649,4 @@
let mut storage = storage(&user, profile.as_deref(), disk);
// (the Game language row's list goes on with the languages the mods on add, as the game's does)
if m.settings.iter().any(|s| s.native.codec == api::settings::Codec::Language) {
api::game_languages::publish(st.loader.game_languages());
Member

L1 (should fix): The command returns an empty text label for the newly recognized language.

When: With the test’s added language selected, the value is now 17, but the manifest’s options contain only Auto. The command passes that index to value_text, which indexes those options and returns an empty string, so a client cannot display the selected language’s name from the settings result.

Do: Populate the language row’s choices or its returned text from the published stock and added language list, and assert the label in the new test.

**L1** (should fix): The command returns an empty text label for the newly recognized language. *When:* With the test’s added language selected, the value is now 17, but the manifest’s options contain only Auto. The command passes that index to value_text, which indexes those options and returns an empty string, so a client cannot display the selected language’s name from the settings result. **Do:** Populate the language row’s choices or its returned text from the published stock and added language list, and assert the label in the new test.
Author
Member

Both of BeanBot's points are done; the head is now 9939a3a7f.

  • L1: fixed. The command returns the language's name: "English (Retold)" for 17, "Italiano" for 6, "Auto" for 0. The game's own languages had an empty name too. The test checks the names; it failed before the fix and passes now.
  • L2: run on Linux in WSL (Ubuntu 24.04), with the real longshot-builder built there from this head. It shows the added language, sets 6 and 17 by their codes, and refuses 18 without changing the file. The new test passes there too.

On Windows, modtool's tests (234 pass, 0 fail), cargo fmt --all --check and modtool's clippy ran again on this head. The game was not run again: only the command changed.

Both of BeanBot's points are done; the head is now 9939a3a7f. - **L1:** fixed. The command returns the language's name: "English (Retold)" for 17, "Italiano" for 6, "Auto" for 0. The game's own languages had an empty name too. The test checks the names; it failed before the fix and passes now. - **L2:** run on Linux in WSL (Ubuntu 24.04), with the real `longshot-builder` built there from this head. It shows the added language, sets 6 and 17 by their codes, and refuses 18 without changing the file. The new test passes there too. On Windows, modtool's tests (234 pass, 0 fail), `cargo fmt --all --check` and modtool's clippy ran again on this head. The game was not run again: only the command changed.
llun force-pushed fix/mod-settings-languages from a434bed7be
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 9939a3a7f7
Some checks failed
CI / What the change needs (pull_request) Successful in 9s
CI / Third-party parts and guide screenshots (pull_request) Successful in 14s
PR description / Title and description (pull_request_target) Successful in 6s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 13s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 1m12s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 12m51s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 12m44s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 15m29s
CI / Website build and checks (pull_request) Successful in 1m21s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 49m56s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 1h0m4s
2026-12-03 16:43:16 +00:00
Compare
Author
Member
@review
BeanBot left a comment

Recommendation: Approve. The command now returns names for stock and mod-added game languages, and the reported Linux run confirms that it reads and sets the added language. Both ledger items are resolved. Recommend approval; not approved on the forge.

The settings command recognizes languages supplied by enabled mods and displays their names. The change reuses the game's language list and adds a focused regression test.

Since the last review (on a434bed7be)
Resolved: L1 (The command returns an empty text label for the newly recognized language.); L2 (The Linux command run listed as still to test is needed before merge.)

Checks: Still running: 11 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes. The reported head run on Linux showed and set the added language, set Italian, and refused an out-of-range value without changing the file; the regression test reportedly passes on Windows and Linux.

Other systems: The changed path is the mod settings command on Windows and Linux; it does not change the game's language handling. The author reports a Windows command run on the earlier implementation and a Linux command run on head.

Switches: None.

Reviewed: 9939a3a7f7 against 1c91b18f86: Read the repository rules and pull request template, the diff, and the changed language handling and regression test; inspected the language registry and settings callers. The review checklist and sibling Tooling rules were not present. Other portions of the changed files were skimmed.; nothing run (a code review).

Checked and fine:

  • The language registry is populated before settings are read or changed.
  • The test checks the persisted codes and that an invalid value leaves the file unchanged.

Testing: Read-only review; no commands, builds or tests from the project were run. CI was still running in the supplied status.

Overlaps and merge order: None found in the supplied context.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The command now returns names for stock and mod-added game languages, and the reported Linux run confirms that it reads and sets the added language. Both ledger items are resolved. Recommend approval; not approved on the forge. The settings command recognizes languages supplied by enabled mods and displays their names. The change reuses the game's language list and adds a focused regression test. **Since the last review** (on a434bed7be60) Resolved: L1 (The command returns an empty text label for the newly recognized language.); L2 (The Linux command run listed as still to test is needed before merge.) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes. The reported head run on Linux showed and set the added language, set Italian, and refused an out-of-range value without changing the file; the regression test reportedly passes on Windows and Linux. **Other systems:** The changed path is the mod settings command on Windows and Linux; it does not change the game's language handling. The author reports a Windows command run on the earlier implementation and a Linux command run on head. **Switches:** None. **Reviewed:** 9939a3a7f774 against 1c91b18f86ae: Read the repository rules and pull request template, the diff, and the changed language handling and regression test; inspected the language registry and settings callers. The review checklist and sibling Tooling rules were not present. Other portions of the changed files were skimmed.; nothing run (a code review). **Checked and fine:** - The language registry is populated before settings are read or changed. - The test checks the persisted codes and that an invalid value leaves the file unchanged. **Testing:** Read-only review; no commands, builds or tests from the project were run. CI was still running in the supplied status. **Overlaps and merge order:** None found in the supplied context. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
HumanBean deleted branch fix/mod-settings-languages 2026-12-03 18:26:45 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!3092
No description provided.