fix(mods): longshot mod settings knows the game languages mods add #3092
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!3092
Loading…
Reference in a new issue
No description provided.
Delete branch "llun/Longshot:fix/mod-settings-languages"
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 mod can add a game language. The
longshot mod settingscommand didn't know about those languages: it showed Auto whenone 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 exampleen-US-x-retold, and runlongshot mod settings system/interface. It showsgame_language = 0. With--set game_language=17it refuses.Read first:
settingsandlanguage_nameingame/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 main1c91b18f8.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.dev.py smokepasses.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 controlbridge's
relaunchrestarted it. The next start logsoe: language it (game_language in the settings).a_game_language_a_mod_adds_is_read_and_set_by_the_settings_commandfails onmain, and passes on the headon Windows and on Linux (WSL). It checks the names too: without
language_nameit fails on an empty name.The suite, run in parts, all with gnullvm:
cargo fmt --all --checkand modtool'sclippy are clean there.
0b3710dc8, before the names): 2 of 3445 failed.ffi-gen'sthe_repositorys_files_are_currentfails onmaintoo.
the_typescript_system_mods_pass_their_testswas over its time limit while other builds were running, and passesin the modtool run above.
maintoo, 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_screensaverandtest_switch_table.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 settingschanges, and only for a mod with a Game language row. Players see nothingin the game.
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: 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.@review
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.
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)
@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 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:
a434bed7beagainst1c91b18f86: 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:
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.
@ -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());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.
Both of BeanBot's points are done; the head is now
9939a3a7f.longshot-builderbuilt 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 --checkand modtool's clippy ran again on this head. The game was not run again: only the command changed.a434bed7be9939a3a7f7@review
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:
9939a3a7f7against1c91b18f86: 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:
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.
llun referenced this pull request2026-12-03 20:16:18 +00:00