Repository navigation
victory menu: speak Portuguese where Windows does (stacked on #1609) - #1618
Open
EduBertozzi wants to merge 9 commits into
Open
EduBertozzi wants to merge 9 commits into
EduBertozzi wants to merge 9 commits into
Conversation
…s at once Double-clicking victory.exe printed clap's help in a console window that closed before it could be read (Marvisak#527). Started with no arguments in a console of its own (`GetConsoleProcessList` gives one process), or with VICTORY_MENU=1, it now shows a menu: 1. Run a game: drag the title's .exe onto the window, or type or paste its path. Quotes and PowerShell's `& '...'` are taken off. It runs as `victory run <exe> --execute` would. 2. Run again: the last game run from the menu, remembered in the data folder while the file is still there. 3. Check this PC, in two sections with a mark and a hint per line: * This PC: the Windows build (Windows 10's built-in D3D12 stops at SM 6.5, and the hint says whether a D3D12\ folder sits beside the exe), AVX2, and what a run of this executable gets from the GPU: SM 6.6, mesh shaders, the widest wave. * Paths: the game, data and cache folders. 4. Open the data folder (saves, crashes.log) in Explorer. After a run, or a run that stops with an error, the window waits for Enter so the last lines can be read. A wrong key shows what to type. Colours: a sunset gradient of VIctory's own (dusk blue, violet, orchid, pink, peach, amber) for the name and its horizon line, and marks in the same palette. Nothing of the title's. Virtual-terminal sequences are turned on in the console; NO_COLOR turns colour off, CLICOLOR_FORCE=1 on. With arguments, or in a console another program already uses (cmd, PowerShell, a terminal), nothing changes. Tests: dragged and pasted paths, answers (and a byte-order mark before piped input), the remembered game, the check's lines on Windows 10 with a 32-lane GPU without mesh shaders and on Windows 11 without SM 6.6, the gradient, plain output without colour, and the "run again" line. A piped run of check / wrong key / bad path / quit printed what's expected. Dependencies: windows-sys (console, registry) and windows (D3D12 feature queries) for the app, both already in the workspace; tempfile for tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… when SM 6.6 is missing Show the Windows 10 Agility hint only when the SM 6.6 check needs it
A run from the menu was `run::run` in the menu's own process, so a title that crashed or exited took the window with it, and its last lines with it. It is now a child `victory run <game> --execute` in the same console: the menu says how it ended (the exit code, in hex for an NTSTATUS such as 0xC0000005) and waits for Enter. Ctrl+C and Ctrl+Break stop the run, not the menu. Also: hints wrap to the console's width, under the line they explain (they ran back to the left edge); "Checking this PC..." shows while the GPU device is made; the window is titled VIctory; opening the data folder says which folder it opened. Tried on Windows 10 19045 with a file that isn't a game: the child stops with "malformed image", the menu shows exit code 1 and carries on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eport "Check this PC" now starts its GPU lines with the default adapter's name and user-mode driver version from DXGI, which it reads also where no shader model 6.6 device can be made (the case "can't run" reports are about). After the check, C then Enter puts it on the clipboard as plain text for a GitHub report: no colour, no wrapping, the user's profile folder written as %USERPROFILE%, through the Win32 clipboard as Unicode text with CRLF line ends. Tried on Windows 10 19045 with a GTX 1060: the line reads "GPU: NVIDIA GeForce GTX 1060 6GB (driver 32.0.15.8266)", and the copied text starts with "VIctory 0.1.0", keeps the check marks and holds no profile path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PowerShell (Windows Terminal's default) pastes a dragged path as `& 'D:\Games\Tom''s Game\title.exe'`, an apostrophe doubled inside single quotes. The menu took the quotes off and kept `''`, so such a game was "No file there". A double-quoted path (cmd) keeps its apostrophe as it is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three entries after the launcher in Marvisak#1330 (sahajiscoding), written for this menu: - S sets [paths].game_dir in the config file the tools read (VICTORY_CONFIG, else victory.toml beside a double-clicked victory.exe). A dropped .exe stands for its folder. The active game_dir line is replaced, or one is added under [paths], or [paths] is appended. Every other line and comment stays. A folder inside the repository is refused with the asset-policy message, and the menu says when VICTORY_GAME_DIR overrides the file. - K shows the keyboard's stand-in pad as gameinput.rs maps it and the README lists it. - M switches the console model a run uses (victory run --console), remembered in the data folder. Tests: the config edit on an empty file, on the example file (comments kept, one game_dir), with and without [paths], with an apostrophe (a basic string) and with CRLF, each read back with toml; the model switch and its memory; the keys table; the run command's --console. Tried in the built victory.exe with a scratch VICTORY_CONFIG: S from a dragged .exe, M, K, and a repository folder refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Most "can't run" reports in the tracker are a problem already traced in another issue: Marvisak#998 was Marvisak#741, and so on. A table of those problems (apps/victory/src/doctor.rs) maps each to the text that shows it in a run's output or crash log, with what it means and where it is tracked: - Windows 10's built-in D3D12 too old (root signature flags c01) - the title's instance pool full (+0x5149aec, INSTANCE_LIST) - the Game Init crash at +0xb5a5f8 - no mesh shaders - GPU hang (DXGI_ERROR_DEVICE_HUNG) - 64-lane wave programs on a 32-lane GPU - out of GPU memory - out of commit (os error 1455) - a file that isn't a title's executable Only text that VIctory, D3D12 or the title print verbatim, and that an issue has traced to a cause, is in it; anything else gets no guess. After a run the menu now shows the run's log as it comes and keeps its end. If the log or what the crash logs gained during the run match, it lists the problems under "What happened". `victory doctor [FILES]` does the same for a saved log, or for the data folder's crash logs. Tests: each signature against a line as the issues quote it, colour codes and case, order and repeats, a clean run getting nothing, only the crash log's new part being read, the findings' layout, and a child's error output shown and kept. Tried in the built victory.exe: a file that isn't a title (the menu names it) and a log shaped like Marvisak#998's (`victory doctor` names both problems with their links). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The menu, the check, the keys and the doctor's findings now follow Windows' display language: Portuguese where it is Portuguese (GetUserDefaultUILanguage), English otherwise, and VICTORY_LANG=en|pt chooses. Each screen is still built in English; lang::localize translates the finished text by whole phrases (longest first) as it is printed, so the menu's logic and tests stay in one language. Long hints are translated before they are wrapped. A run's log is never translated, and the report copied for GitHub stays English. Tests: every phrase in the table is one the menu or the doctor writes (so the table can't go stale silently), the Portuguese menu reads whole, longer phrases win over shorter ones inside them, and tests run in English. Tried in the built victory.exe on a Portuguese Windows 10: it picked Portuguese by itself for the menu, the check, a failed run and its findings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Automated triage for the maintainers. Needs rebase. This pull request conflicts with Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1609 (which is stacked on #959): this branch adds one commit,
e62dd00, on top of them. Optional: if the project would rather keep the tools in English, this is easy to leave out.What
The double-click menu, its PC check, the keyboard guide and the doctor's findings now follow Windows' display language. They come out in Portuguese where Windows is in Portuguese (
GetUserDefaultUILanguage, primary language0x16) and in English otherwise.VICTORY_LANG=en|ptoverrides the choice.How it works:
lang::localizetranslates the finished text by whole phrases (longest first) as the menu prints it, so the menu's logic and tests stay in one language.Adding a language is a phrase table, the same as
lang::PT. A test keeps the table honest: every English phrase in it must be one the menu or the doctor actually writes, so a reworded string can't leave a stale translation behind unnoticed.Tested
Native Windows 10 22H2 (19045) with a Portuguese display language, GTX 1060:
cargo test -p victory: 22 tests. The new ones cover:cargo clippy --workspace --all-targets --locked -- -D warnings, with and without--all-features: clean.victory.exewith noVICTORY_LANGset, it picked Portuguese by itself for the menu, the check (including the wrapped Windows 10 hint), a failed run and its What happened findings.Not exercised in the exe: that the copied report stays English while the menu speaks Portuguese. That's
lang::in_englisharound the report's text, but I skipped the clipboard round-trip, so as not to overwrite what the machine's clipboard held.🤖 Generated with Claude Code