prompts: render vector mouse button icons and 2:1 wide spacebar caps #522

Open
aowu wants to merge 1 commit from aowu/Darner:pr/vector-prompt-icons into Main
First-time contributor

Motivation

When mouse buttons (Mouse1–Mouse5) or Space are bound to single controls, prompts::key_caps currently renders them as crowded text (LMB, RMB, MMB, Space) squeezed inside a square keycap.

Changes

  • Added crisp vector shapes (mouse_icon_shapes) in crates/darner-game/src/prompts.rs for:
    • Left mouse button (0x01), right mouse button (0x02), middle mouse button (0x04), and side buttons (0x05 / 0x06): white-outlined dark mouse silhouette with the active button highlighted solid white.
    • Spacebar (0x20): 2:1 horizontal rounded keycap with a classic ␣ bracket.
  • Added Caps label mapping for VK_CAPITAL (0x14) in key_label.
  • Added unit test mouse_buttons_render_distinct_valid_vector_shapes verifying coordinate bounds, valid gfx::shape encoding, and visual distinctness across all icons.
  • Completely backwards-compatible: multi-control prompts and all other keys keep their existing text keycap rendering.

Verification

  • cargo test -p darner-game --lib prompts passes (61/61).
  • Verified in-game on-foot, aiming, and in-vehicle prompts.
### Motivation When mouse buttons (`Mouse1`–`Mouse5`) or `Space` are bound to single controls, `prompts::key_caps` currently renders them as crowded text (`LMB`, `RMB`, `MMB`, `Space`) squeezed inside a square keycap. ### Changes - Added crisp vector shapes (`mouse_icon_shapes`) in `crates/darner-game/src/prompts.rs` for: - Left mouse button (`0x01`), right mouse button (`0x02`), middle mouse button (`0x04`), and side buttons (`0x05` / `0x06`): white-outlined dark mouse silhouette with the active button highlighted solid white. - Spacebar (`0x20`): 2:1 horizontal rounded keycap with a classic `␣` bracket. - Added `Caps` label mapping for `VK_CAPITAL` (`0x14`) in `key_label`. - Added unit test `mouse_buttons_render_distinct_valid_vector_shapes` verifying coordinate bounds, valid `gfx::shape` encoding, and visual distinctness across all icons. - Completely backwards-compatible: multi-control prompts and all other keys keep their existing text keycap rendering. ### Verification - `cargo test -p darner-game --lib prompts` passes (61/61). - Verified in-game on-foot, aiming, and in-vehicle prompts.
Author
First-time contributor

In-game preview of the new vector icons (RMB, LMB, MMB scroll wheel, and the 2:1 wide Spacebar cap):

In-game preview of the new vector icons (RMB, LMB, MMB scroll wheel, and the 2:1 wide Spacebar cap):
Owner

Test needed — commit c79dc0c4; what to check: the change described above

Evidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture.

Reply testing to take this run; it's free again after 24 h with no results.

**Test needed** — commit `c79dc0c4`; what to check: the change described above Evidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture. Reply `testing` to take this run; it's free again after 24 h with no results.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'pr/vector-prompt-icons:aowu-pr/vector-prompt-icons'
git switch 'aowu-pr/vector-prompt-icons'

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 'aowu-pr/vector-prompt-icons'
git switch 'aowu-pr/vector-prompt-icons'
git rebase 'Main'
git switch 'Main'
git merge --ff-only 'aowu-pr/vector-prompt-icons'
git switch 'aowu-pr/vector-prompt-icons'
git rebase 'Main'
git switch 'Main'
git merge --no-ff 'aowu-pr/vector-prompt-icons'
git switch 'Main'
git merge --squash 'aowu-pr/vector-prompt-icons'
git switch 'Main'
git merge --ff-only 'aowu-pr/vector-prompt-icons'
git switch 'Main'
git merge 'aowu-pr/vector-prompt-icons'
git push origin 'Main'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!522
No description provided.