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

Open
Razdva122 wants to merge 5 commits from upstream-pr/1179 into main
Razdva122 commented 2026-11-24 16:21:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Razdva122 on 2026-11-24T16:21:13Z.


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 controller diagram changes 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. The runner resolves a relative profile directory at configuration time, so the same pack stays selected if the guest changes its working directory. 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.

At 8a485ee, the full Windows workspace suite and both Clippy configurations passed. A separate diagnostics build ran the diagram and DirectStorage tests. Workspace CI · Diagnostics tests

<!-- greyfinch-sync:Marvisak/VIctory:issue:5476057623 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1179). Originally posted by [Razdva122](https://github.com/Razdva122) on 2026-11-24T16:21:13Z. --- 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 controller diagram changes on top of main and #312](https://github.com/Razdva122/VIctory/compare/6bb46d14c76dcfd35413b1fbb3f4d00671a6e099...8a485ee441c087f2ba1fe6fddb9be40e9f7662b8) 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. The runner resolves a relative profile directory at configuration time, so the same pack stays selected if the guest changes its working directory. 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://github.com/Marvisak/VIctory/issues/187#issuecomment-7149969165) AI-assisted with Codex. At `8a485ee`, the full Windows workspace suite and both Clippy configurations passed. A separate diagnostics build ran the diagram and DirectStorage tests. [Workspace CI](https://github.com/Marvisak/VIctory/actions/runs/46117019842/job/140893007775) · [Diagnostics tests](https://github.com/Razdva122/VIctory/actions/runs/46117015738/job/140892995793)
Kabosune commented 2026-11-24 17:04:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Kabosune on 2026-11-24T16:29:04Z.


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.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7137736876 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1179#issuecomment-7137736876). Originally posted by [Kabosune](https://github.com/Kabosune) on 2026-11-24T16:29:04Z. --- 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 commented 2026-11-24 17:04:35 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Kabosune on 2026-11-24T16:35:33Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7137906382 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1179#issuecomment-7137906382). Originally posted by [Kabosune](https://github.com/Kabosune) on 2026-11-24T16:35:33Z. --- 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.
Marvisak commented 2026-11-25 02:05:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:18:04Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149407468 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1179#issuecomment-7149407468). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:18:04Z. --- <!-- 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)_
Razdva122 commented 2026-11-28 06:37:32 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Razdva122 on 2026-11-28T06:37:32Z.


@Marvisak, could you re-review the controller diagram change at 8a485ee and remove triage: needs rebase? GitHub reports a clean merge with main at 63bcca4. The latest commit keeps a relative glyph directory pointing to the configured pack when the guest changes its working directory. All three diagram tests and all 17 DirectStorage tests passed in the Windows diagnostics build. The PR remains a draft pending #312 and an in-game controller-switch check. Diagnostics tests · Workspace CI

<!-- greyfinch-sync:Marvisak/VIctory:comment:7235415633 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1179#issuecomment-7235415633). Originally posted by [Razdva122](https://github.com/Razdva122) on 2026-11-28T06:37:32Z. --- @Marvisak, could you re-review the controller diagram change at `8a485ee` and remove `triage: needs rebase`? GitHub reports a clean merge with `main` at `63bcca4`. The latest commit keeps a relative glyph directory pointing to the configured pack when the guest changes its working directory. All three diagram tests and all 17 DirectStorage tests passed in the Windows diagnostics build. The PR remains a draft pending #312 and an in-game controller-switch check. [Diagnostics tests](https://github.com/Razdva122/VIctory/actions/runs/46117015738/job/140892995793) · [Workspace CI](https://github.com/Marvisak/VIctory/actions/runs/46117019842/job/140893007775)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1179:upstream-pr/1179'
git switch 'upstream-pr/1179'

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 'upstream-pr/1179'
git switch 'upstream-pr/1179'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1179'
git switch 'upstream-pr/1179'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1179'
git switch 'main'
git merge --squash 'upstream-pr/1179'
git switch 'main'
git merge --ff-only 'upstream-pr/1179'
git switch 'main'
git merge 'upstream-pr/1179'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!1179
No description provided.