Skip to content

HLE/xgameui: a password text entry hides what is typed - #836

Open
CwWwWwW wants to merge 1 commit into
trustno1-coder:mainfrom
CwWwWwW:fix/gameui-password-scope
Open

CwWwWwW wants to merge 1 commit into
trustno1-coder:mainfrom
CwWwWwW:fix/gameui-password-scope

Conversation

@CwWwWwW

@CwWwWwW CwWwWwW commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Ported to trustno1-coder/VIctory-NVIDIA from the same change submitted to fxceless/victory-fork as PR #1467 (head f75c359, author CwWwWwW). The fork's own line was dropped when it rebased onto 959dcaf (5dbf5ce), so this is submitted here directly. The description below is the original one; its 'Verification' numbers refer to the fork tree. Rebased onto main 63b902f.

The problem

The text-entry call ignored its input scope (_scope, crates/victory-hle/src/modules/xgameui.rs:60). The GDK's XGameUiTextEntryInputScope::Password is 31, and its documented behaviour is that the text box hides what the user types. The HLE opened an ordinary ES_AUTOHSCROLL edit box, so an in-game password prompt echoed the password in clear. The title still received the typed text, so the result path is unchanged.

The current title does not call text entry; this is a latent privacy/compatibility defect for any title that asks for a password through this API.

Contract evidence (read-only research, no code taken)

The change

text_entry_async now reads scope, computes password = scope == 31, and threads the flag through ask/dialog::ask; the dialog's edit box adds ES_PASSWORD when the entry is a password. Every other scope is unchanged and produces exactly the previous dialog and result.

Evidence

New test gameui::tests::a_password_entry_asks_for_a_text_box_that_hides_what_is_typed: the module's test dialog marks a dialog that was asked to hide its text with a trailing *.

  • without the wiring the test fails: the password-scope call returns 9 bytes / abctyped instead of 10 bytes / abctyped*;
  • with the change it passes, and a default-scope call still returns the visible abctyped.

Verification on this branch (base 9a9091d):

  • cargo test -p victory-hle --lib --locked -- --test-threads=1 鈥?104 passed, 0 failed
  • cargo clippy -p victory-hle --all-targets --locked -- -D warnings 鈥?clean
  • cargo clippy -p victory-hle --all-targets --locked --all-features -- -D warnings 鈥?clean
  • git diff --check clean; the change adds no new fmt diff (the crate already has pre-existing fmt diffs on this toolchain).

The masked rendering itself is a host dialog style and is not exercised by unit tests (this module's tests mock the dialog, as before); the scope-to-mask wiring is pinned by the test and the style addition is a two-line, review-visible change.

Scope and overlap

One file, crates/victory-hle/src/modules/xgameui.rs (+87/-11). The Password 1024-character cap is covered by open #653/#331/#295 and is not duplicated; #653 does not implement hiding the text (its xgameui.rs has no ES_PASSWORD). This change touches the text_entry_async/ask lines that #653 rewrites, so a rebase may be needed when either lands. CI's check may be red from main's own clippy and asset-policy failures (#1440/#1322), which this diff does not touch.

Verification on this tree (base 63b902f, 2026-11-27)

  • cargo check --workspace --all-targets --locked: pass (Rust 1.98.1, the version pinned in rust-toolchain.toml)
  • cargo check --workspace --all-targets --all-features --locked: pass
  • cargo clippy --workspace --all-targets --locked -- -D warnings (and --all-features): this change adds no clippy finding. The only failures are on unmodified lines of main (clippy::manual_is_multiple_of at crates/victory-gpu/src/shadow.rs:1708 and crates/victory-gpu/src/descriptor.rs:1234, clippy::let_and_return at crates/victory-shader/src/emit/mod.rs:2768); CI run 46104876336 on 63b902f failed on those before this change.
  • cargo test was not run in the author's environment (Windows VM without an MSVC toolchain; test binaries could not be linked there). CI on Windows and a run on the card should confirm.

The text-entry call ignored its input scope. The GDK Password scope (31) must hide what is typed; thread the flag through ask()/dialog::ask and add ES_PASSWORD to the edit box. Other scopes are unchanged.

Regression test: gameui::tests::a_password_entry_asks_for_a_text_box_that_hides_what_is_typed.

Ported from fxceless/victory-fork PR #1467 (head 28755e63e873a15bfe218b3a2aef5e8f1d30fcc5).
Original author: CwWwWwW <66506837+CwWwWwW@users.noreply.github.com>.

@Dukestar69 Dukestar69 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally merged onto main (63b902f).

  • Merge & Policy: Clean merge; cargo xtask policy passed (294 files ok).
  • Tests: cargo test -p victory-hle --lib xgameui passed (4 passed; 0 failed, including the new a_password_entry_asks_for_a_text_box_that_hides_what_is_typed test) with 0 compiler warnings.

Clean UI password-masking handling in xgameui. LGTM.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

MystifiedSky added a commit to MystifiedSky/VIctory-NVIDIA-Improved that referenced this pull request Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants