F1 menu since #4634: mouse, key-binding focus guard, safe save, RESET error and hand-set values are gone #4940
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA#4940
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Jesper-Andersson on GitHub · 2026-12-01 14:47 UTC · original
What happened
Found by reading code while merging upstream
maininto our branch, not from a crash report or a play session. Nothing below has been seen in game yet (see "What was not tested"). Cause found only by reading code, so please treat these as likely regressions to confirm, not confirmed bugs.The five points are posted together because they share one cause: the #4635 rewrite of
menu.rsleft them out. Each can be fixed on its own, and I can split this into separate issues if that is easier to track.The merge of #4635 (
f5c3d2434, commit3bde49236"UI: anti-aliased Segoe UI/Consolas F1 menu and slim F3 stats panel") rewrotecrates/victory-gpu/src/host/menu.rs(3257 → 1752 lines). The new drawing is a clear improvement, but five behaviours thatmainhad just before the merge did not come across. "Before" =7d93ee075(the merge's first parent,3bde49236^); "now" =mainat5fabb46ea.1. Mouse in F1 (added by #2225): only the wheel is left.
VK_LBUTTON/VK_RBUTTONwhile the menu was open (menu.rs:817,:831-832). Hover selected the row under the cursor (handle_hover,:1654), left-click cycled a setting left/right of its value or ran an action, with the same two-click confirm as Enter for PRELOAD / CLEAR SHADERS / IMPORT (handle_left_click,:1750-1800, confirm at:1754), and right-click went back from KEY BINDINGS or IMPORT SAVE, or closed the menu (handle_right_click,:1803-1817; dispatched at:1904-1912).watch_keyswatches seven keys, no mouse buttons (menu.rs:653); there is no hover or click handling. The wheel still moves the selection (menu.rs:1370).2. Key binding: a wait for a key no longer ends when the game window loses focus (added by #2245,
9e0c369db).heard_fromended the wait withHeard::Lostas soon as the game window was not in front, before reading any key, and the note saidNOT CHANGED: THE GAME WINDOW WAS NOT IN FRONT(menu.rs:2165-2170,:578,:1220-1227).GetAsyncKeyStateanswers for the whole desktop, so without this, a key typed in another window after Alt+Tab is written tobindings.ini(the reason given in the comment at:2159-2164).heardreads the keys without checking focus (menu.rs:1686-1696; caller:1101-1103).focused()still exists (:643-647) but is only used for the menu's own keys and pad buttons (:659,:1394), not for the binding wait.bindings.initook it", is still there (menu.rs:1666-1675).3. Settings save is no longer safe: a failed read can drop the other saved F1 settings (added by #2256,
9b2b3ff46).write_settings(menu.rs:1351-1396) refused to save if the existing settings file could not be read (anything but "not found",:1360-1363), wrote a temp file, synced it and swapped it in (:1392-1396), and wrote through a symlink to its target (:1352-1359).save(menu.rs:1176-1219) reads the old file with.unwrap_or_default()(:1184-1185) and writes with plainstd::fs::write(:1201).read_to_stringfails withInvalidDataon a file that is not valid UTF-8 (for example one saved as UTF-16 "Unicode" in Notepad), while the write still succeeds. Also, a plainfs::writetruncates first, so a crash, kill or full disk during the write can leave an empty or partialvictory-settings.txt. Every setting change saves at once (change_and_save,:1355-1360), so this path runs on every Left/Right in F1. (A symlinked file is still written through, sincefs::writefollows the link; only the temp-file swap and the read check are gone.)4. RESET always says it worked (added by #2256,
9b2b3ff46).reset_atreported a failed delete withCOULD NOT RESET THE SETTINGS FILEand logged it; a missing file counted as reset (menu.rs:1587-1596).resetignores the result ofremove_fileand always showsRESET. PLAY DEFAULTS AT THE NEXT START(menu.rs:1348-1353). If the delete fails (read-only file, file held open), the old settings come back at the next start while the menu said they were reset.5. A value set by hand no longer stays in the setting's cycle (added by #2296,
bb946c0ff).VICTORY_AMBIENT=1.5) was kept as an extra step after the last listed one, both ways (change,menu.rs:1265-1288,ownat:1270). The save also skipped an emptyVICTORY_MENU_*=line for a launcher choice returned to NOT SET, because an emptyVICTORY_MENU_CONSOLE=reads as Series X (:1375-1380).changesteps through the listed values only (menu.rs:1115-1132). One Left/Right on such a line replaces the hand-set value, and since the change is saved at once, it is also gone from the settings file. (The empty-line guard only matters together with the hand-set step, so it should come back with it.)Also removed with the rewrite
menu.rshad 28#[test]functions andpanel.rs10; both now have none. Among them were the tests for each point above:failed_settings_read_keeps_the_previous_file,failed_settings_replace_keeps_the_previous_file,reset_settings_reports_errors_and_accepts_missing_file,a_wait_for_a_key_ends_when_the_window_is_not_in_front,a_binding_is_shown_only_once_its_file_took_it,a_value_set_by_hand_stays_in_the_cycle_both_ways,hover_updates_selection_only_when_cursor_moves,left_click_cycles_setting_left_and_right_around_arrows,left_click_executes_actions_and_two_click_confirmation,right_click_exits_picking_or_closes_menu,wheel_scroll_steps_selection_and_drains_notches.RAY TRACING HARDWARE (DXR)/SOFTWARE/OFF,panel.rs:357-365before, added in9a427c140) is not in the new panel.Suggested fix
heard_from+Heard::Lost,write_settings/save_to,reset_atand thelaunched/ownstep inchangecan be restored from7d93ee075nearly as they were.hit_test_menu_boxmapped the cursor to the old character grid), then the oldhandle_hover/handle_left_click/handle_right_clicklogic can sit on top of it.Related, checked
menu.rs) and #4765 (open, depends on #4712): theirmenu.rsdiffs don't add back any of the above (searched for the old function names,VK_LBUTTON,NamedTempFile,ErrorKind::NotFound). A fix may be easiest inside or right after #4712 to avoid conflicts.menu.rs.What was not tested
mainor on our merge build. They come from comparing the two versions of the source.cargo testrun for this report.Spec dependence
Likely general: the code paths don't depend on the GPU, the console profile or the card's memory. Our PC, for the record: RTX 2070 SUPER 8 GB, driver 621.40; Ryzen 7 5800X, 32 GB, Windows 11 Pro Insider 10.0.26320.
GPU and driver
RTX 2070 SUPER 8 GB, driver 621.40 (not used: found by reading code)
CPU, RAM and Windows version
Ryzen 7 5800X, 32 GB, Windows 11 Pro Insider 10.0.26320
VIctory release or commit
mainat5fabb46ea(compared with7d93ee075, the parent of #4635's merge)Settings
Not applicable (no run).
Logs
None: no run was made for this report.
Are you working on a fix?
No
Drafted with AI assistance (Claude Code).
@github-actions[bot] on GitHub · 2026-12-01 14:48 UTC · original
Please attach both logs from the run that went wrong. Without them we can only guess. Paste
%LOCALAPPDATA%into the address bar of File Explorer to get there.%LOCALAPPDATA%\victory\logs\: the newestvictory-nvidia-play-<date>-<time>-<number>.log(fromvictory.exe) orvictory-nvidia-<date>-<time>.log(from the script launcher). The window shows its path at the start, on the lineLog: ....%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newestvictory-<date>-<time>-<number>.crash.login%LOCALAPPDATA%\VIctory\data\7952987A\temp\.Also say which GPU you have and which Windows version (10 or 11).
If this issue needs logs and none are posted here within 12 hours, it will be closed. Add them by editing your post or in a comment.
@Jesper-Andersson on GitHub · 2026-12-01 15:42 UTC · original
Checked in game now (a short menu-only session, 2026-12-01):
RESET. PLAY DEFAULTS AT THE NEXT START. We did not make the delete fail (read-only or held file), so the failure case is still untested.Build: our fork's merge of
mainat5fabb46ea, not cleanmain. Ourmenu.rsadds rows and slider lines (sharpen, vignette, lens flares, depth of field, map key speed, fog cap, light sliders, four look-key binding rows), a hook note and an off-by-default retire switch. Ourmenu.rsadds no mouse, hover or click code (it does change what Left/Right does on the new light-slider rows), andmain'smenu.rshas no hover or click code either. But our merge differs frommainin about 75 files (a large bundle of our own changes), including the input code inmnk.rsandgameinput.rs, so we cannot rule our build out; we have not tried cleanmain. RTX 2070 SUPER 8 GB, driver 621.40, Ryzen 7 5800X, 32 GB, Windows 11 Pro Insider 10.0.26320, Series S.Logs: no crash, and
crashes.loghas no entry from this session (its last entry is from around 2026-11-28). The play log is not attached: it has the user name and game paths, and no RESET line was logged (only foursettings menu: savedlines). Happy to paste specific lines. This note is in place of the logs the bot asked for.Drafted with AI assistance (Claude Code).
@eipastel on GitHub · 2026-12-01 15:50 UTC · original
Point 2 (binding wait and window focus): #4969 brings back #2245's check on the new menu, with its test.