[pr-feature] Display PlayStation buttons when a PlayStation pad is connected automatically #24

Manually merged
TrustNo1 merged 0 commits from xrobau/Darner:auto-controller-icons into main 2026-12-03 18:36:19 +00:00
Contributor

This changes the default DARNER_PROMPTS to auto. Setting DARNER_PROMPTS=xbox
keeps the Xbox icons, whatever controller is connected and with mouse and
keyboard on.

Very small and simple patch.

Contributor role (optional)

  • Fluxer ID: 1574607295432630275

What it changes

Instead of the (poorly documented) DARNER_PROMPTS param, try to figure out which controller is
connected to the machine, and display those buttons.

  • With nothing set (or DARNER_PROMPTS=auto), a DualSense, DualSense Edge or DualShock 4 connected at the start gives PlayStation buttons, found the same way auto already did (Windows' HID device list, nothing opened); otherwise the Xbox pictures.
  • Keyboard prompts (CONTROLS KEYBOARD, MOUSE AND KEYBOARD) still come first, and DARNER_PROMPTS=playstation and CONTROLS DUALSENSE still force PlayStation buttons.
  • DARNER_PROMPTS=xbox: main added it while this was open (3940e26d9: the Xbox pictures with mouse and keyboard on), and this branch had added it too (the Xbox pictures with a PlayStation pad connected). Here they are one switch that does both. main's xbox_pictures_when_asked read playstation_selected_by as a bool, which no longer compiled once it returns PadPrompts; it now expects PadPrompts::Xbox. README and docs/playstation-prompts.md name both halves.

How it was tested

  • Tested revision: 6f16801e6 (one commit on 4a92569fb, today's main on git.gtahub.st)
  • cargo test --locked -p darner prompt: 4 passed (keys_only_when_keyboard_is_selected, playstation_buttons_with_dualsense_or_when_asked, the_connected_pad_decides_unless_xbox_is_asked, main's xbox_pictures_when_asked)
  • cargo clippy --locked -p darner -p darner-hle --all-targets -- -D warnings: passed
  • In the game (an earlier revision of this change, 383a343fc, fast build, Series S, 2560x1440): with a DualSense connected and nothing set, the game showed PlayStation buttons (screenshot below).
  • Not tested in the game since the merge: an Xbox pad alone, DARNER_PROMPTS=xbox with a DualSense, and DARNER_PROMPTS=xbox with mouse and keyboard on.

Checklist

  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: none change the prompts. Of the open pull requests on git.gtahub.st, #5 and #6 change crates/darner-hle/src/modules/gameinput.rs (other parts; both merge with this branch without conflicts there), and #6 and #8 add a README.md row each in other sections. (This replaces CodeFloe PR #333, lost when the repository moved.)

Change

With an attached PS controller, the icons are now what the end user would expect.

🤖 Generated with Claude Code

This changes the default DARNER_PROMPTS to auto. Setting DARNER_PROMPTS=xbox keeps the Xbox icons, whatever controller is connected and with mouse and keyboard on. Very small and simple patch. <!-- Thanks for the pull request. Please label it (pr-fix, pr-feature, pr-performance, pr-diagnostics, pr-refactor, pr-docs or pr-tests, plus the area labels), or put the label in the title, like [pr-fix]. --> <!-- Use Fixes #N for a complete fix or Refs #N for a partial change. --> ## Contributor role (optional) - Fluxer ID: 1574607295432630275 ## What it changes Instead of the (poorly documented) DARNER_PROMPTS param, try to figure out which controller is connected to the machine, and display those buttons. - With nothing set (or `DARNER_PROMPTS=auto`), a DualSense, DualSense Edge or DualShock 4 connected at the start gives PlayStation buttons, found the same way `auto` already did (Windows' HID device list, nothing opened); otherwise the Xbox pictures. - Keyboard prompts (CONTROLS KEYBOARD, MOUSE AND KEYBOARD) still come first, and `DARNER_PROMPTS=playstation` and CONTROLS DUALSENSE still force PlayStation buttons. - `DARNER_PROMPTS=xbox`: main added it while this was open (3940e26d9: the Xbox pictures with mouse and keyboard on), and this branch had added it too (the Xbox pictures with a PlayStation pad connected). Here they are one switch that does both. main's `xbox_pictures_when_asked` read `playstation_selected_by` as a bool, which no longer compiled once it returns `PadPrompts`; it now expects `PadPrompts::Xbox`. README and `docs/playstation-prompts.md` name both halves. ## How it was tested - Tested revision: 6f16801e6 (one commit on 4a92569fb, today's `main` on git.gtahub.st) - `cargo test --locked -p darner prompt`: 4 passed (`keys_only_when_keyboard_is_selected`, `playstation_buttons_with_dualsense_or_when_asked`, `the_connected_pad_decides_unless_xbox_is_asked`, main's `xbox_pictures_when_asked`) - `cargo clippy --locked -p darner -p darner-hle --all-targets -- -D warnings`: passed - In the game (an earlier revision of this change, 383a343fc, fast build, Series S, 2560x1440): with a DualSense connected and nothing set, the game showed PlayStation buttons (screenshot below). - Not tested in the game since the merge: an Xbox pad alone, `DARNER_PROMPTS=xbox` with a DualSense, and `DARNER_PROMPTS=xbox` with mouse and keyboard on. ## Checklist - [X] This PR contains one change based on `main`. - [X] The diff follows `docs/asset-policy.md`. - [X] I recorded this PR's dependencies below. - Depends on: none <!-- Replace the indented item above with one item per prerequisite using "- Depends on #N (reason)". Keep this PR in draft while any prerequisite is unmerged. Add the same PRs in the Dependencies panel if you can edit it. --> <!-- Address review feedback in this PR. Open a new PR for follow-up work. --> ## Checked for overlap - [X] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: none change the prompts. Of the open pull requests on git.gtahub.st, #5 and #6 change `crates/darner-hle/src/modules/gameinput.rs` (other parts; both merge with this branch without conflicts there), and #6 and #8 add a `README.md` row each in other sections. (This replaces CodeFloe PR #333, lost when the repository moved.) ## Change With an attached PS controller, the icons are now what the end user would expect. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This changes the default DARNER_PROMPTS to auto. Setting DARNER_PROMPTS=xbox
keeps the Xbox pictures, whatever pad is connected and with mouse and keyboard
on (main's DARNER_PROMPTS=xbox, and this branch's, are one switch).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
TrustNo1 manually merged commit 84215982c8 into main 2026-12-03 18:36:19 +00:00
xrobau deleted branch auto-controller-icons 2026-12-03 18:38:22 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
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.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!24
No description provided.