fix(settings): the ReShade preset, a mod's Menu theme and a mod's game language apply from the start #3198
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!3198
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:fix/reshade-on-at-start"
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
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 beforegame_inithas made the lists those three are places in: the presets, the themes and the mods' languages.game_initopened the settings again, which does nothing the second time.Fix:
DocOptions::lists_made, called bygame_initonce 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 testoflongshot-game(Linux) andcargo fmt --checkpass. Clippy with warnings as errors stops atlarge_const_arraysinhost-sys, which this does not touch.Still to test:
Measurements
Nothing to measure: no change aims at speed.
Risks
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (Not run; see Testing.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here. (None: the fault is in the ordergame_initand the host run, which no test off the game runs.)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
https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
Possibly related, for context:
0f4bef3395acedb1ce46WIP: fix(reshade): the chosen preset is on from the start, not only after a setting changesto WIP: fix(settings): the ReShade preset, a mod's Menu theme and a mod's game language apply from the start@review
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.
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)
@fixcan 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:
acedb1ce46against8c058ddbb9: 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:
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.
@ -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();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.
WIP: fix(settings): the ReShade preset, a mod's Menu theme and a mod's game language apply from the startto fix(settings): the ReShade preset, a mod's Menu theme and a mod's game language apply from the start