Skip to content

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

Draft
Razdva122 wants to merge 4 commits into
Marvisak:mainfrom
Razdva122:input/controller-prompts
Draft

Razdva122 wants to merge 4 commits into
Marvisak:mainfrom
Razdva122:input/controller-prompts

Conversation

@Razdva122

@Razdva122 Razdva122 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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

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 Marvisak#187 (sensors and glyph profiles are follow-ups).
@Kabosune

Copy link
Copy Markdown

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 Input: read DualSense pads over HID when XInput has none #150 if that lands) always report xbox. It might be worth having the HID path report playstation too.

@Kabosune

Copy link
Copy Markdown

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 Nov 25, 2026 •

Copy link
Copy Markdown
Owner

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

@Razdva122
Razdva122 force-pushed the input/controller-prompts branch from 351a9fd to ccd207f Compare November 26, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants