Input: choose the loose controls diagram by active gamepad (stacked on #312) #1179

Open
github-bot wants to merge 4 commits from github-bot/gh-1179 into main AGit
Owner

@⁠Razdva122 on GitHub · 2026-11-24 16:21 UTC · original
Razdva122:input/controller-prompts → main · +771 −69 · 7 files · 4 commits · draft

Draft for the active-controller and loose controls-diagram portion of #187. This branch includes DaviTostes’s SDL3 backend from #312 with its original authorship. The input hub selects an Xbox, PlayStation, Nintendo or Steam profile when a physical controller produces deliberate input. Review the two commits on top of main and #312

The tester supplies the package-relative path in VICTORY_GLYPH_FILE and an external directory in VICTORY_GLYPH_DIR. For example, with the synthetic path ui/controls.bin, the PlayStation replacement is playstation/controls.bin under that directory. A matching DirectStorage open uses the active profile’s file if available. Other paths use the usual package lookup. Each already-open handle keeps its contents. The README documents the two settings in one table row.

Synthetic tests cover controller selection, invalid or unrelated paths, fallback to the package file and reads across profile changes. The game-specific path has been removed from both commits. Maintainer review of #312 and the asset-replacement scope in #187 is still pending. A title run with a real pack is needed to confirm that opening the settings page reads the configured loose file and displays the expected diagram after switching controllers. The archived HUD and live refresh of already-loaded UI remain open in #187. Scope discussion

AI-assisted with Codex.

Windows CI passed both workspace Clippy configurations, the full workspace suite and the diagnostics-mode DirectStorage tests at ccd207f. Windows job

**@⁠Razdva122** on GitHub · 2026-11-24 16:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/1179) `Razdva122:input/controller-prompts` → `main` · +771 −69 · 7 files · 4 commits · draft Draft for the active-controller and loose controls-diagram portion of #187. This branch includes DaviTostes’s SDL3 backend from #312 with its original authorship. The input hub selects an Xbox, PlayStation, Nintendo or Steam profile when a physical controller produces deliberate input. [Review the two commits on top of main and #312](https://github.com/Razdva122/VIctory/compare/6bb46d14c76dcfd35413b1fbb3f4d00671a6e099...ccd207f7d1b4680bd9f4ac0d57157c64ba3ef704) The tester supplies the package-relative path in `VICTORY_GLYPH_FILE` and an external directory in `VICTORY_GLYPH_DIR`. For example, with the synthetic path `ui/controls.bin`, the PlayStation replacement is `playstation/controls.bin` under that directory. A matching DirectStorage open uses the active profile’s file if available. Other paths use the usual package lookup. Each already-open handle keeps its contents. The README documents the two settings in one table row. Synthetic tests cover controller selection, invalid or unrelated paths, fallback to the package file and reads across profile changes. The game-specific path has been removed from both commits. Maintainer review of #312 and the asset-replacement scope in #187 is still pending. A title run with a real pack is needed to confirm that opening the settings page reads the configured loose file and displays the expected diagram after switching controllers. The archived HUD and live refresh of already-loaded UI remain open in #187. [Scope discussion](https://git.gtahub.st/github/Marvisak--VIctory/issues/187) AI-assisted with Codex. Windows CI passed both workspace Clippy configurations, the full workspace suite and the diagnostics-mode DirectStorage tests at `ccd207f`. [Windows job](https://github.com/Razdva122/VIctory/actions/runs/45818274261/job/139903548973)
Load SDL3.dll at run time (no build dependency) and read up to four pads through it: buttons, sticks and both triggers, hotplug, and rumble including the trigger motors. XInput remains the fallback when the DLL or SDL's gamepad subsystem is missing, and VICTORY_INPUT forces a backend.

Part of #187 (sensors and glyph profiles are follow-ups).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:22:34 +00:00
Author
Owner

@⁠Kabosune on GitHub · 2026-11-24 16:29 UTC · original

Nice work on the active-controller tracking. The hysteresis and ignoring the Steam virtual pad are good touches. Two small things:

  • sdl_profile matches raw SDL_GamepadType values (4..=6, 7..=11, 12). SDL has added types between releases, so it might be safer to use named constants or check the loaded SDL version, so a newer or older SDL3.dll can't pick the wrong profile.
  • Pads that don't come through SDL3 (XInput, or the HID DualSense reader in #150 if that lands) always report xbox. It might be worth having the HID path report playstation too.
**@⁠Kabosune** on GitHub · 2026-11-24 16:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/1179#issuecomment-7137736876) Nice work on the active-controller tracking. The hysteresis and ignoring the Steam virtual pad are good touches. Two small things: - `sdl_profile` matches raw `SDL_GamepadType` values (`4..=6`, `7..=11`, `12`). SDL has added types between releases, so it might be safer to use named constants or check the loaded SDL version, so a newer or older `SDL3.dll` can't pick the wrong profile. - Pads that don't come through SDL3 (XInput, or the HID DualSense reader in #150 if that lands) always report `xbox`. It might be worth having the HID path report `playstation` too.
Author
Owner

@⁠Kabosune on GitHub · 2026-11-24 16:35 UTC · original

Correction on my first point: SDL3's SDL_GamepadType only grows at the end and the 3.x ABI is stable, so the literals can't map to the wrong type, and checking the version wouldn't help. Named constants would just be a readability nicety, so feel free to ignore it. The HID point is really a note for #150, not this PR.

**@⁠Kabosune** on GitHub · 2026-11-24 16:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/1179#issuecomment-7137906382) Correction on my first point: SDL3's `SDL_GamepadType` only grows at the end and the 3.x ABI is stable, so the literals can't map to the wrong type, and checking the version wouldn't help. Named constants would just be a readability nicety, so feel free to ignore it. The HID point is really a note for #150, not this PR.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:18 UTC · original · edited 2026-11-26 00:15 UTC

Automated triage for the maintainers.

This pull request conflicts with main (conflicting files: crates/victory-hle/src/modules/gameinput.rs). It will be reviewed once it is rebased onto main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/1179#issuecomment-7149407468) · edited 2026-11-26 00:15 UTC <!-- victory-triage v1 head=351a9fd7391f1b4fa4126287b1e006c9a2aab492 verdict=needs-rebase at=2026-11-26T00:15:40Z --> Automated triage for the maintainers. This pull request conflicts with `main` (conflicting files: `crates/victory-hle/src/modules/gameinput.rs`). It will be reviewed once it is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
github-bot force-pushed github-bot/gh-1179 from 351a9fd739 to ccd207f7d1 2026-11-26 12:19:33 +00:00 Compare
This pull request can be merged automatically.
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 origin '+refs/pull/1179/head:github-bot/gh-1179'
git switch 'github-bot/gh-1179'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1179'
git switch 'github-bot/gh-1179'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1179'
git switch 'github-bot/gh-1179'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1179'
git switch 'main'
git merge --squash 'github-bot/gh-1179'
git switch 'main'
git merge --ff-only 'github-bot/gh-1179'
git switch 'main'
git merge 'github-bot/gh-1179'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1179
No description provided.