TeamREPENTOGON / TeamREPENTOGON/REPENTOGON
Suggestions for more input/controller stuff
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 345
- Forks
- 51
- Avg merge
- 11h 2m
- Merged PRs (30d)
- 4
Description
I'm in the process of creating a new menu on the main menu and ran into a small couple issues in relation to input, as I want to be able to differentiate keyboard and controller inputs for different actions and different graphics. Here's some suggestions I thought of that could be handy
- Input.GetDeviceNameByIdx() currently doesn't appear to return anything useful. Keyboard will always be "Keyboard" but I connected both an Xbox and Switch Pro controller and the only result I got was "XInput Controller 1", 2, 3, etc. In gfx/ui, there's buttons.anm2, which has different animations depending on the type of identified controller. I'd like to be able to get the proper name of the controller if possible to point to the right set of buttons...though its possible that this is just how the game sees the controllers and these are meant for the other consoles? Regardless, the main menu seemed to use the XboxOne buttons despite PS4 being the literal "default" animation, so there surely must be some kind of default identification
- The main menu clearly tracks whichever device had an input of any kind last and updates its graphics accordingly. Maybe an "Input.GetLastActiveDeviceIdx()"? I currently have to loop through index 0 - 4 just to guess the number of indexes present and check every single ButtonAction to update a local variable that stores the last used idx
- Controller enum/enum per controller type for IsButtonTriggered/Pressed. I'm assuming this would line up with the controls_buttons.anm2, as gfx/backdrops/controls_buttons.anm2 has a Keyboard animation and it certainly matches up with the Keyboard enum
tl;dr:
- Input.GetDeviceNameByIdx() except the actual names like XboxOne, PS4, Switch_Pro, etc. On PC its currently returning XInput Controller 1, 2, 3, etc
- Input.GetLastActiveDeviceIdx() for the menu
- Generic Controller or per-controller-type enum for Input.IsButtonTriggered/Pressed
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing Input.GetDeviceNameByIdx(), ButtonAction checks, and controller-related graphics in gfx/ui/buttons.anm2 and gfx/backdrops/controls_buttons.anm2. Clarify the intended behavior for device naming, last-active-device tracking, and controller-specific button enums; done requires agreed API behavior and validation for all three requests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100