1. Do not interrupt mouse mode on virtual clicks.
2. Handle virtual clicks directly instead of sending an SDL event.
3. Fix D-Pad mouse emulation state handling.
4. Hides the modifier hints during D-Pad mouse emulation.
Introduces a `ControlDevice` global which is distinct from `ControlMode`
in that it is set to `Gamepad` even when simulating a mouse.
This allows us to avoid a number of edge cases related to mode changes.
Fixes#4242
Previously this was handle as part of `game_logic`, reducing
responsiveness and making it impossible to run where `game_logic`
isn't running, e.g. stores.
* Fixes Right Stick cursor movement
* Fixes cursor flicker when moving the cursor while moving the character
* Fixes START + SELECT menu
* Makes SELECT act as Escape in the in-game menu
Fixes#930
This also fixes
- UI navigation being unresponsive when quickly tabing the direction
pad.
- Speed book not starting out highlighting the current selected item
- Diagonal in the speed book
- Being able to select non spells in the speedbook
- Fix double events
- Fix ignored events
- Allow moving diagonal in the inventory
- Fix mouse wobbling in inventory when scalling
- Make controler actions cursor independants
- Make sure secoundery and primery key doesn't fire each others events
- Highlight both primary and secondary target
- Automatic switch between controller and keyboard+mouse
- Allow the user to change facing direction when blocked
- Make code event based instead of relying on time outs
Initial game controller support.
Actions are based on the Switch branch but the controller code itself is
implemented differently, allowing for easy remapping and minimizing
changes to the Source/ directory.
Many subtle and not so subtle controller bugs have been fixed
in this implementation, including:
1. Smoother & more responsive movement with the joysticks.
2. Consistent controls for all the menus in the game (stores, quest log,
etc).
3. Cursor appearance / disappearance at appropriate times.
Low-level controls are abstracted and 3 SDL interfaces are supported:
game controller, joystick, and keyboard. See SourceX/controls/ for more
details on this.
Wishlist for the future:
1. Primary button and use button should attack continously.
This is hard as it requires checking the cooldowns / attack speed.
2. Quick spell menu navigation is very buggy. It is also buggy in the
switch branch. I haven't had a change to investigate.
- Hide cursor on joystick move, show cursor on mouse move.
- Auto aim at closest monsters, objs or items.
- Inventory grid snap navigation
- Speed spell grid snap navigation
- Char stat snaps navigation
- Town portal auto casts if using a controller
- Can now identify and repair items via controller
- Can dropping items in inventory via controller