Launcher: a graphical launcher, and the keyboard pad's keys chosen by VICTORY_KEYMAP #982

Open
alexx307 wants to merge 2 commits from upstream-pr/982 into main
alexx307 commented 2026-11-28 10:35:39 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by alexx307 on 2026-11-28T10:35:39Z.


A window to start the game without typing PowerShell options, built with Tauri 2 in apps/launcher.

What it does

  • Setup: pick your own dump's executable (a path inside the repository is refused), see whether the layer is built and whether the DLSS and FSR 3 files are there, and fetch them with the existing Get-NVIDIA-DLSS.cmd and Get-AMD-FSR.cmd.
  • Settings: the F1 menu's choices (console profile, resolution, DLSS, frame generation and its type, frame rate cap). They are written to victory-settings.txt as VICTORY_MENU_*, which play-foxhound.ps1 and the F1 menu already read, so the launcher and the menu always agree. Other lines of the file are kept.
  • Play: runs scripts\play-nvidia.ps1 -Exe <dump> in a console window of its own, so the build, the log's path and the output stay visible.
  • Controller: which key presses which control of the keyboard's stand-in pad (see below). A key already in use is swapped; F1 and F3 are refused.
  • Updates: lists what the official repository has that the checkout has not. "Update now" closes the launcher and runs scripts\update-launcher.ps1 (git pull --ff-only, rebuild of the layer if it was built, rebuild of the launcher, restart). Offered only on a clean main; otherwise the launcher says why not.
  • Logs opens %LOCALAPPDATA%\victory\logs; About links to this repository and to the original VIctory.
  • Keyboard, controller (Gamepad API) and mouse navigation; a frameless window with its own title bar.

Changes outside the launcher

  • gameinput: the stand-in pad's keys come from VICTORY_KEYMAP (control=key pairs, keys as hexadecimal virtual-key codes, letters by their place on a US keyboard). The defaults are the keys it always had. LETTER_POSITIONS now knows all 26 letters, so any letter can be used; the existing tests pass unchanged, plus three new ones in gameinput/keymap.rs.
  • xtask/src/policy.rs: html, css and js added to the allowed text extensions, for the launcher's page. The other checks (size, NUL bytes, encoded runs) still apply to them.
  • Cargo.toml: tauri (with custom-protocol), tauri-build, tauri-plugin-dialog in [workspace.dependencies]. Cargo.lock grows with Tauri's crates; no existing crate changes version.
  • .gitignore: /apps/launcher/gen/ (schemas tauri-build writes).
  • README: one line in Credits.

No binary files

The icon is drawn by build.rs. The page draws its own background (SVG, no images). Optional pictures (ui/assets/logo.png, VIctory.png, ico.ico, background/*.jpg) and music (ui/assets/song) are used when present at build time and are not part of this PR. The page loads nothing from the network, and it calls only the launcher's own commands (empty capability list; links open only the two fixed addresses).

How to try it

cargo run -p launcher

Checked

  • cargo clippy -p launcher --all-targets: no warnings. cargo test -p launcher (17), cargo test -p xtask (policy included), cargo test -p victory-hle --lib gameinput (29).
  • The page in a browser: navigation, settings, key mapping (assign, swap, refusal of F1), slideshow, music settings.
  • The update check's git steps on a real checkout.

Not checked

  • Play with a real dump, and the new key mapping in the game (I have no dump to test with).
  • A full update from the launcher (there was nothing new to pull while writing it).
  • Windows 10 without WebView2 (the launcher shows a message box explaining what to install).

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5539237725 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/982). Originally posted by [alexx307](https://github.com/alexx307) on 2026-11-28T10:35:39Z. --- A window to start the game without typing PowerShell options, built with Tauri 2 in `apps/launcher`. ## What it does - **Setup**: pick your own dump's executable (a path inside the repository is refused), see whether the layer is built and whether the DLSS and FSR 3 files are there, and fetch them with the existing `Get-NVIDIA-DLSS.cmd` and `Get-AMD-FSR.cmd`. - **Settings**: the F1 menu's choices (console profile, resolution, DLSS, frame generation and its type, frame rate cap). They are written to `victory-settings.txt` as `VICTORY_MENU_*`, which `play-foxhound.ps1` and the F1 menu already read, so the launcher and the menu always agree. Other lines of the file are kept. - **Play**: runs `scripts\play-nvidia.ps1 -Exe <dump>` in a console window of its own, so the build, the log's path and the output stay visible. - **Controller**: which key presses which control of the keyboard's stand-in pad (see below). A key already in use is swapped; F1 and F3 are refused. - **Updates**: lists what the official repository has that the checkout has not. "Update now" closes the launcher and runs `scripts\update-launcher.ps1` (`git pull --ff-only`, rebuild of the layer if it was built, rebuild of the launcher, restart). Offered only on a clean `main`; otherwise the launcher says why not. - **Logs** opens `%LOCALAPPDATA%\victory\logs`; **About** links to this repository and to the original VIctory. - Keyboard, controller (Gamepad API) and mouse navigation; a frameless window with its own title bar. ## Changes outside the launcher - `gameinput`: the stand-in pad's keys come from `VICTORY_KEYMAP` (`control=key` pairs, keys as hexadecimal virtual-key codes, letters by their place on a US keyboard). The defaults are the keys it always had. `LETTER_POSITIONS` now knows all 26 letters, so any letter can be used; the existing tests pass unchanged, plus three new ones in `gameinput/keymap.rs`. - `xtask/src/policy.rs`: `html`, `css` and `js` added to the allowed text extensions, for the launcher's page. The other checks (size, NUL bytes, encoded runs) still apply to them. - `Cargo.toml`: `tauri` (with `custom-protocol`), `tauri-build`, `tauri-plugin-dialog` in `[workspace.dependencies]`. `Cargo.lock` grows with Tauri's crates; no existing crate changes version. - `.gitignore`: `/apps/launcher/gen/` (schemas tauri-build writes). - README: one line in Credits. ## No binary files The icon is drawn by `build.rs`. The page draws its own background (SVG, no images). Optional pictures (`ui/assets/logo.png`, `VIctory.png`, `ico.ico`, `background/*.jpg`) and music (`ui/assets/song`) are used when present at build time and are not part of this PR. The page loads nothing from the network, and it calls only the launcher's own commands (empty capability list; links open only the two fixed addresses). ## How to try it ```powershell cargo run -p launcher ``` ## Checked - `cargo clippy -p launcher --all-targets`: no warnings. `cargo test -p launcher` (17), `cargo test -p xtask` (policy included), `cargo test -p victory-hle --lib gameinput` (29). - The page in a browser: navigation, settings, key mapping (assign, swap, refusal of F1), slideshow, music settings. - The update check's git steps on a real checkout. ## Not checked - Play with a real dump, and the new key mapping in the game (I have no dump to test with). - A full update from the launcher (there was nothing new to pull while writing it). - Windows 10 without WebView2 (the launcher shows a message box explaining what to install). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ANDREANIADS commented 2026-11-28 23:51:00 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ANDREANIADS on 2026-11-28T23:51:00Z.


At c5c8664, I tested with_values in isolation on Linux with three synthetic settings files. Changing only VICTORY_MENU_FPS preserved comment text, trailing spaces, an unknown VICTORY_ key, an unrelated key and a blank line. The duplicate FPS entry collapsed as intended. All seven CRLF endings in the Windows-style fixture became LF. In a separate LF fixture, saving added a newline after the final comment.

A small regression test for the refresh: given "# note\r\nVICTORY_MENU_FPS=30\r\nOTHER=x", updating FPS to 60 should change only 30 to 60. Keeping each existing line terminator would avoid rewriting unrelated lines. The launcher itself was not run.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7247704052 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/982#issuecomment-7247704052). Originally posted by [ANDREANIADS](https://github.com/ANDREANIADS) on 2026-11-28T23:51:00Z. --- At `c5c8664`, I tested `with_values` in isolation on Linux with three synthetic settings files. Changing only `VICTORY_MENU_FPS` preserved comment text, trailing spaces, an unknown `VICTORY_` key, an unrelated key and a blank line. The duplicate FPS entry collapsed as intended. All seven CRLF endings in the Windows-style fixture became LF. In a separate LF fixture, saving added a newline after the final comment. A small regression test for the refresh: given `"# note\r\nVICTORY_MENU_FPS=30\r\nOTHER=x"`, updating FPS to 60 should change only `30` to `60`. Keeping each existing line terminator would avoid rewriting unrelated lines. The launcher itself was not run.
ANDREANIADS commented 2026-11-29 00:37:56 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ANDREANIADS on 2026-11-29T00:37:56Z.


At c5c8664, settings_file::set reports success when an existing settings file cannot be decoded as UTF-8. I tested the module in isolation with offline Cargo on Linux. My temporary fixture contained # café VICTORY_MENU_FPS=30 VICTORY_OTHER=keep , encoded as UTF-16LE with a BOM. Setting FPS to 60 replaced all 94 bytes with the 20-byte FPS line, losing the other preference.

I tested a small change in set: read the existing text, use an empty string only for ErrorKind::NotFound, and return any other read error before writing. The same fixture then returned InvalidData and all 94 bytes compared equal. Both versions updated only FPS in the UTF-8/LF control and created the expected line when the file was absent.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7248246231 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/982#issuecomment-7248246231). Originally posted by [ANDREANIADS](https://github.com/ANDREANIADS) on 2026-11-29T00:37:56Z. --- At `c5c8664`, `settings_file::set` reports success when an existing settings file cannot be decoded as UTF-8. I tested the module in isolation with offline Cargo on Linux. My temporary fixture contained `# café VICTORY_MENU_FPS=30 VICTORY_OTHER=keep `, encoded as UTF-16LE with a BOM. Setting FPS to 60 replaced all 94 bytes with the 20-byte FPS line, losing the other preference. I tested a small change in `set`: read the existing text, use an empty string only for `ErrorKind::NotFound`, and return any other read error before writing. The same fixture then returned `InvalidData` and all 94 bytes compared equal. Both versions updated only FPS in the UTF-8/LF control and created the expected line when the file was absent.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/982:upstream-pr/982'
git switch 'upstream-pr/982'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/982'
git switch 'upstream-pr/982'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/982'
git switch 'upstream-pr/982'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/982'
git switch 'main'
git merge --squash 'upstream-pr/982'
git switch 'main'
git merge --ff-only 'upstream-pr/982'
git switch 'main'
git merge 'upstream-pr/982'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!982
No description provided.