fix(settings): the ReShade preset, a mod's Menu theme and a mod's game language apply from the start #3198

Merged
HumanBean merged 1 commit from HumanBean/Longshot:fix/reshade-on-at-start into main 2026-12-04 20:14:33 +00:00
Owner

Summary

Three settings did not apply after a start until some other setting was changed: the ReShade preset was off, a mod's Menu theme showed as Modern dark, and a game language a mod adds read as none chosen in its row (the game itself still played in it, from the file's line).

Why: the host reads the settings at boot (HOS_SETTING_START, for the memory and window settings), which makes the settings snapshot before game_init has made the lists those three are places in: the presets, the themes and the mods' languages. game_init opened the settings again, which does nothing the second time.

Fix: DocOptions::lists_made, called by game_init once the lists are there, works the three out again, in the current snapshot and in the start-of-run copy a restart is asked against, so no restart is asked for a change the player did not make (game/crates/longshot-game/src/settings_now.rs, lib.rs).

The other settings do not depend on a late list: the snapshot takes them from the file's own lines, and the renderer finds devices by their ids.

To see the bug on main: pick a ReShade preset, restart, and see no effect until you change any setting.

Testing

Tested: not in the game, as the person who asked for it chose; the cause was found by reading the code. cargo test of longshot-game (Linux) and cargo fmt --check pass. Clippy with warnings as errors stops at large_const_arrays in host-sys, which this does not touch.

Still to test:

  • Any OS and GPU: choose a ReShade preset, restart, expecting it on from the start of play and no restart question on closing the menu (by hand).
  • Any OS and GPU: the same with a mod's Menu theme and with a mod's game language, expecting each chosen after the restart (by hand).

Measurements

Nothing to measure: no change aims at speed.

Risks

  • The start publishes the settings snapshot once more, and the start-of-run copy the host and the renderer read is replaced for those three fields (the earlier one stays valid for whoever holds it).
  • No switch; reverting is enough.

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. (Not run.)
  • mise run test passes (any failure that also fails on main is named). (Not run; see Testing.)
  • 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. (None: the fault is in the order game_init and the host run, which no test off the game runs.)
  • Docs updated. (No documented behaviour changes.)
  • 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.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH

## Summary Three settings did not apply after a start until some other setting was changed: the **ReShade preset** was off, a **mod's Menu theme** showed as Modern dark, and a **game language a mod adds** read as none chosen in its row (the game itself still played in it, from the file's line). **Why:** the host reads the settings at boot (`HOS_SETTING_START`, for the memory and window settings), which makes the settings snapshot before `game_init` has made the lists those three are places in: the presets, the themes and the mods' languages. `game_init` opened the settings again, which does nothing the second time. **Fix:** `DocOptions::lists_made`, called by `game_init` once the lists are there, works the three out again, in the current snapshot and in the start-of-run copy a restart is asked against, so no restart is asked for a change the player did not make (`game/crates/longshot-game/src/settings_now.rs`, `lib.rs`). The other settings do not depend on a late list: the snapshot takes them from the file's own lines, and the renderer finds devices by their ids. To see the bug on `main`: pick a ReShade preset, restart, and see no effect until you change any setting. ## Testing **Tested:** not in the game, as the person who asked for it chose; the cause was found by reading the code. `cargo test` of `longshot-game` (Linux) and `cargo fmt --check` pass. Clippy with warnings as errors stops at `large_const_arrays` in `host-sys`, which this does not touch. **Still to test:** - Any OS and GPU: choose a ReShade preset, restart, expecting it on from the start of play and no restart question on closing the menu (by hand). - Any OS and GPU: the same with a mod's Menu theme and with a mod's game language, expecting each chosen after the restart (by hand). ## Measurements Nothing to measure: no change aims at speed. ## Risks - The start publishes the settings snapshot once more, and the start-of-run copy the host and the renderer read is replaced for those three fields (the earlier one stays valid for whoever holds it). - No switch; reverting is enough. ## Checklist ### Ready for review - [x] 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. (Not run.) - [ ] `mise run test` passes (any failure that also fails on `main` is named). (Not run; see Testing.) - [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 - [ ] A fix: a game-free test that fails on `main` and passes here. (None: the fault is in the order `game_init` and the host run, which no test off the game runs.) - [x] Docs updated. (No documented behaviour changes.) - [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) https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
fix(reshade): the chosen preset is on from the start, not only after a setting changes
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
0f4bef3395
The host reads the settings at boot, before game_init has listed the ReShade presets, so the snapshot had the chosen
preset as Off. Nothing made it again until a setting changed. game_init now makes it again once the lists are there,
which also covers a mod's Menu theme and a game language a mod adds, resolved against lists the same way.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
Member

Possibly related, for context:

  • PR #3141 feat(mods): menu theme mods load while the game runs, and two small menu follow-ups — Merged menu-theme mod lifecycle work; related context for theme behavior
Possibly related, for context: - PR #3141 feat(mods): menu theme mods load while the game runs, and two small menu follow-ups — Merged menu-theme mod lifecycle work; related context for theme behavior
HumanBean force-pushed fix/reshade-on-at-start from 0f4bef3395
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 acedb1ce46
Some checks failed
CI / What the change needs (pull_request) Successful in 9s
CI / Third-party parts and guide screenshots (pull_request) Successful in 13s
PR description / Title and description (pull_request_target) Failing after 7s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 18s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 1m26s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 9m39s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 9m20s
CI / Website build and checks (pull_request) Failing after 38s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 11m39s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 14m41s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 47m10s
2026-12-04 20:11:11 +00:00
Compare
HumanBean changed title from WIP: fix(reshade): the chosen preset is on from the start, not only after a setting changes to WIP: fix(settings): the ReShade preset, a mod's Menu theme and a mod's game language apply from the start 2026-12-04 20:11:11 +00:00
Author
Owner
@review
BeanBot left a comment

Recommendation: Request changes. The startup fix has no regression test, although its list publication and snapshot behavior can be exercised without the game. Its claimed player-visible fix also remains unverified in a game run.

Recomputes the preset, theme and language after their lists are populated, and updates the restart baseline. The change is small and preserves previously handed-out snapshots, but adds no automated protection for the startup ordering.

Blocking (1): must change before merging.

  1. L1 game/crates/longshot-game/src/lib.rs:146: The fix has no game-free regression test, despite the repository requiring one for a fix. (more on the line) Do: Add a game-free test that opens settings before publishing representative lists, then exercises the startup refresh and checks the live snapshot and restart baseline for the saved choices. Ensure it fails when the refresh is removed.

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 three player-visible startup cases have not been verified in the game. When: A saved ReShade preset, mod theme or mod language may still display or apply incorrectly at startup despite the snapshot being recomputed. Do: On one supported setup, reproduce the saved choices on the base, then restart with this change and check that each applies immediately and does not cause a spurious restart question.

@fix can do L1.

Checks: Still running: 11 checks.

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

Does it help: Unproven: the author reports code inspection and Linux cargo tests, but no reproduction on the base or verification of the three settings in the game.

Other systems: The change affects startup settings consumed by the host, renderer and menu on Windows and Linux. The snapshots are retained and published through atomics and OnceLock; no platform-specific code or renderer API layout changes. The actual renderer and menu behavior has not been run.

Switches: None.

Reviewed: acedb1ce46 against 8c058ddbb9: Read lib.rs in full and the changed portions of settings_now.rs with its snapshot, publication, initialization and restart comparison paths; skimmed its remaining tests. Read the relevant options codecs, list implementations, startup caller, repository rules, standards and PR template. No recorded runs, translations or generated files changed.; nothing run (a code review).

Checked and fine:

  • The commit records AI assistance with a Co-Authored-By trailer.
  • The diff contains no game-derived files, generated files, third-party changes or API version changes.
  • The original start snapshot remains alive after the listed snapshot is published.

Testing: Read-only review; no code or tests run. The PR reports Linux cargo test and formatting checks passing; CI is still running.

Overlaps and merge order: Unknown; network access is closed.


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

**Recommendation: Request changes.** The startup fix has no regression test, although its list publication and snapshot behavior can be exercised without the game. Its claimed player-visible fix also remains unverified in a game run. Recomputes the preset, theme and language after their lists are populated, and updates the restart baseline. The change is small and preserves previously handed-out snapshots, but adds no automated protection for the startup ordering. **Blocking (1)**: must change before merging. 1. **L1** `game/crates/longshot-game/src/lib.rs:146`: The fix has no game-free regression test, despite the repository requiring one for a fix. (more on the line) **Do:** Add a game-free test that opens settings before publishing representative lists, then exercises the startup refresh and checks the live snapshot and restart baseline for the saved choices. Ensure it fails when the refresh is removed. **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 three player-visible startup cases have not been verified in the game. *When:* A saved ReShade preset, mod theme or mod language may still display or apply incorrectly at startup despite the snapshot being recomputed. **Do:** On one supported setup, reproduce the saved choices on the base, then restart with this change and check that each applies immediately and does not cause a spurious restart question. `@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:** Unproven: the author reports code inspection and Linux cargo tests, but no reproduction on the base or verification of the three settings in the game. **Other systems:** The change affects startup settings consumed by the host, renderer and menu on Windows and Linux. The snapshots are retained and published through atomics and OnceLock; no platform-specific code or renderer API layout changes. The actual renderer and menu behavior has not been run. **Switches:** None. **Reviewed:** acedb1ce4607 against 8c058ddbb91b: Read lib.rs in full and the changed portions of settings_now.rs with its snapshot, publication, initialization and restart comparison paths; skimmed its remaining tests. Read the relevant options codecs, list implementations, startup caller, repository rules, standards and PR template. No recorded runs, translations or generated files changed.; nothing run (a code review). **Checked and fine:** - The commit records AI assistance with a Co-Authored-By trailer. - The diff contains no game-derived files, generated files, third-party changes or API version changes. - The original start snapshot remains alive after the listed snapshot is published. **Testing:** Read-only review; no code or tests run. The PR reports Linux cargo test and formatting checks passing; CI is still running. **Overlaps and merge order:** Unknown; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -144,1 +144,3 @@
settings_now::open();
// (the host has read it already, at boot, before any of those lists were there: worked out again, else the preset,
// theme or language chosen stays as not found, ReShade off, until a setting changes)
settings_now::open().lists_made();
Member

L1 (blocking): The fix has no game-free regression test, despite the repository requiring one for a fix.

When: If this call is removed, the existing tests still do not exercise opening settings before list publication and republishing afterwards; saved list-dependent choices again start with their fallback values.

Do: Add a game-free test that opens settings before publishing representative lists, then exercises the startup refresh and checks the live snapshot and restart baseline for the saved choices. Ensure it fails when the refresh is removed.

**L1** (blocking): The fix has no game-free regression test, despite the repository requiring one for a fix. *When:* If this call is removed, the existing tests still do not exercise opening settings before list publication and republishing afterwards; saved list-dependent choices again start with their fallback values. **Do:** Add a game-free test that opens settings before publishing representative lists, then exercises the startup refresh and checks the live snapshot and restart baseline for the saved choices. Ensure it fails when the refresh is removed.
HumanBean changed title from WIP: fix(settings): the ReShade preset, a mod's Menu theme and a mod's game language apply from the start to fix(settings): the ReShade preset, a mod's Menu theme and a mod's game language apply from the start 2026-12-04 20:14:29 +00:00
HumanBean deleted branch fix/reshade-on-at-start 2026-12-04 20:14:34 +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!3198
No description provided.