Commit graph

147 commits

Author SHA1 Message Date
Sally Coolatta
7dfa597c7d SRB2 -> DRRR copyright in src, acs, android folder
Be consistent with toaster's recent changes to copyright
2024-04-05 02:08:23 -04:00
James R
bea1cccdde Virtual Keyboard: rewrite keyboard-gamepad switching
- Input handling is done straight in G_MapEventsToControls
- If a keyboard event is received, switch off virtual
  keyboard
  - Removed the input lock while virtual keyboard is
    sliding away
- If a gamepad event is received, and it is a change of at
  least half the full range, switch on virtual keyboard
2024-03-05 17:03:05 -08:00
James R
b452232974 Add PF_ANALOGSTICK, tells if this player has bound analog stick to d-pad 2024-02-24 21:29:19 -08:00
James R
5e37aa12a5 Replace memcpy to gamecontrol with G_ApplyControlScheme 2024-02-24 21:29:18 -08:00
AJ Martinez
07a4474d4b Allow gamepad reassignment in vote + from joystick input 2024-01-12 15:48:01 -07:00
Eidolon
02e56a304e Reset all gamekeydown arrays for all devices 2024-01-11 22:04:13 -06:00
AJ Martinez
df73260131 Revert to v1 default keyboard controls 2024-01-09 02:59:15 -07:00
Eidolon
9cc3850c3f Use M_GetCvPlayerColor for pad LED color 2023-11-05 12:23:05 -06:00
toaster
986fbd06b9 Self-review: G_SetPlayerGamepadIndicator - use skincolor's ramp directly instead of cacheing and then indexing an entire colormap 2023-10-20 14:47:28 +01:00
toaster
3e901b312c Catch all unconditional cv_playercolor[] visuals
Resolves #704
Now converts to skin prefcolor in:
- Player menu party
- Challenges menu
    - Why it's done on this branch - want to avoid merge conflicts
- Gamepad indicator
    - Actually fixes a bug at the same time for skins with nonstandard startcolors
2023-09-27 16:02:29 +01:00
James R
6c0b042eed Refactor cvar definitions completely, move everything to cvars.cpp
- No need to call CV_RegisterVar
- Cvar definitions live in only one file, easier to locate
- Organized into sections -- netvars, cheats, etc.
- Use builder pattern to initialize cvars
- Still need to extern if you want to read the cvar value
2023-08-25 17:22:40 -07:00
toaster
3210b7b80c Revert "Revert "Ignore OS key repeats for game controls""
This reverts commit b6b5175bbee451579dc7d364cb40787e29b25a83.
2023-04-12 18:42:16 +01:00
toaster
5349b45a09 Revert "Ignore OS key repeats for game controls"
This reverts commit 2131973ecce45690bb82ddc80a2dee2107f8362f.
2023-04-06 20:02:13 +01:00
James R
e0f999fcd7 Ignore OS key repeats for game controls 2023-04-06 20:02:12 +01:00
James R
d9faef58cb Add game control for lossless video recording, set default keys for gc_screenshot, etc
Renames gc_startgif to gc_startmovie.

Default controls:

- gc_screenshot - F8
- gc_startmovie - F9
- gc_startlossless - F10

Bumps PROFILEVER to 3, safely migrates existing profiles.
2023-04-06 20:02:11 +01:00
toaster
89fc9a618e Rumble toggle attached to profile
- Will silently merge conflict with !1093, make sure to adjust PROFILEVER handling
- (profile_t *)->rumble
- cv_rumble[MAXSPLITSCREENPLAYERS]
- cv_dummyprofilerumble
- Disables all current rumbles when toggling off
- Prevents new rumbles from being set while turned off
2023-04-02 23:16:58 +01:00
toaster
7a9779d242 Remove a bunch of mouse console variables that hold no relevance to us 2023-04-02 23:09:56 +01:00
Eidolon
839f2a6d15 Add G_ResetAllDeviceRumbles 2023-04-02 21:56:40 +01:00
Eidolon
17daf1aeba Add G_ functions to rumble a player's device 2023-04-02 21:56:39 +01:00
AJ Martinez
8f77a1a975 Playable default controls 2023-03-19 16:02:16 -07:00
toaster
6832488117 G_MapEventsToControls: On second thought, only handle reassignment when a trigger axis is activated, to closer match button behaviour. 2023-03-19 18:00:18 +00:00
toaster
22294c2c4d G_MapEventsToControls: Permit automagic controller reassignment for axis events greater than JOYAXISRANGE/2
The author of this commit uses a trigger for A(ccel) and was being misled by the absence of response.
2023-03-19 17:27:23 +00:00
toaster
dc63847e14 G_MapEventsToControls: Fix crash
- If G_GetDeviceGameKeyDownArray returns NULL, bail early.
- Also calls it once for all relevant event types, rather than possibly multiple times.
2023-03-19 17:27:23 +00:00
Sally Coolatta
edd5398373 G_PlayerAnalogInput cleanup
Emergency keyboard keys work again, and the input code is more straight-forward.
2023-03-07 05:01:26 -05:00
Eidolon
7ed5e7a7a5 Change gamepad LED colors on playercolor change 2023-03-07 00:07:47 -06:00
Eidolon
86a9579e16 Handle gamepads from interface dynamically
Fixes numerous issues with hotswapping, gamepad assignment, and menu
responsiveness.
2023-03-07 00:07:47 -06:00
toaster
3f1ba40246 Missing gamecontrolname 2022-11-26 23:24:02 +00:00
toaster
db95e3144d Re-add mid-game rankings
- gc_rankings, bound to TAB by default
- Now a toggle, rather than a hold behaviour
- Rearrange HU_Drawer to have chat (and cecho/music credits) render over everything else (like, say, tab rankings)
- Update PROFILEVER to 2 so we can add the new control to old profiles
2022-11-25 17:59:18 +00:00
X.organic
902fcfa569 Miscellaneous memory bug fixes to make AddressSanitizer happy
# Conflicts:
#	src/d_clisrv.c
#	src/dehacked.c
#	src/hardware/hw_cache.c
#	src/hardware/hw_md2.c
#	src/http-mserv.c
#	src/lua_hudlib_drawlist.c
2022-09-12 16:49:18 +01:00
Eidolon
85a132c149 Port Ediolon's SDL GameController work
Basically instantly solved all of the issues that made this branch completely unusable
2022-08-27 08:20:52 -04:00
SinnamonLat
c8c07aacc8 Add hardcoded keyboard defaults for menu navigation 2022-05-21 12:32:38 +02:00
SinnamonLat
26199dc284 Add enter and esc for menu navigation on default profile 2022-05-20 01:28:09 +02:00
SinnamonLat
1d4ee40758 Remove unecessary button associations in menu. X is now Back 2022-04-12 11:46:50 +02:00
SinnamonLat
6db54f77d8 Force menus to use default controls for now. Update device in realtime in control setup menu 2022-04-11 14:50:51 +02:00
toaster
ff5992e3c4 Rework the entire G_PlayerInputAnalog system.
* Previous control checking flow:
    * Current controller/keyboard (userbound controls).
    * If on a menu:
        * Current controller/keyboard (default controls).
        * All controllers not in use by a player (default controls).
* New control checking flow:
    * Current controller/keyboard (userbound controls).
    * If player 0 and just checked a controller, check keyboard (userbound controls).
    * If on a menu:
        * Check all controllers not in use by a player (userbound controls).
        * If keys are inaccessible/unbound and keybind is necessary to navigate menus, repeat eveyrhting with default controls.
* Instead of duplicated code, control the flow in a finer fashion.
* Now able to detect if gamepad inputs are possible to recieve (via checking deviceID), instead of assuming they are.
* If a keybind is set but inaccessible by the above metric, make it flash on the Profile Controls screen.
* Fix out-of-order key mappings for a given bind being invisible on the Profile Controls menu.
2022-04-01 20:51:37 +01:00
Sally Coolatta
d3f8e61591 In-game control shenanigans
- Fix gamekeydown using FRACUNIT instead of JOYAXISRANGE
- Re-add spindash button functionality
- I put custom buttons back ... but they're now called "Lua" buttons A thru C because Custom was a dumb misleading name
2021-12-28 12:49:33 -05:00
Sally Coolatta
0f218b285e Fix menu multiplayer breaking again 2021-12-28 09:02:46 -05:00
Sally Coolatta
b1d36496b2 Properly implement joystick axes
NOW it's fully navigable with controller
2021-12-28 08:44:20 -05:00
Sally Coolatta
f0a3dc74bb Fix control saving 2021-12-28 06:48:53 -05:00
Sally Coolatta
746f112bf7 Fix gamepad joystick handling 2021-12-28 05:31:14 -05:00
Sally Coolatta
7684f5980a Almost multiplayer char select
For some reason gamepads have not been registering buttons for a while, which makes this pretty hard to continue. Not sure if it's to do with how the menu cmd is generated, or something deeper in the SDL code.
2021-12-25 08:58:21 -05:00
Sally Coolatta
d067c1ddef First pass on character select device select
Ultra mega hacked in, by saving all "discarded" joysticks to an array so they don't get totally closed & we can still poll them. Events now properly send the device number instead of the player number, which means we can store all controllers pressing buttons, and thus, can detect when ANY controller is pressing anything, and THUS we can make the character select work like we wanted to :V

Did not bother fixing any of the bugs, however. First of all, the opening menus do not properly fallback to default controls. Yet again, we may need a more robust system -- storing all keys from gamekeydown separately? Additionally it seems like when I input gamepad it makes me use keyboard anyway, so I think something fishy is up.
2021-12-06 17:43:52 -05:00
Sally Coolatta
f17b948491 Update how input is handled in menus to use key bindings
VERY broken right now, it lost the delay between key presses. Kinda already sick of the reorganization needed though
2021-11-29 12:02:56 -05:00
Sally Coolatta
cd8862f0bc New input handling
Events have a player ID instead of adding billions of keys for separate gamepads. Axis movement (mouse movement, analog sticks) now are counted as keys, so axes don't need to be separately implemented for all controls. Game controls emulate a Saturn controller (some of the external functions like screenshot / gif should be readded, but I got lazy)

This will allow later us to save a config for a controller that can be reused for any player slot, which is one of the main goals for profiles.

Only just enough was made to use the new input system to make it compile. Menus in this branch should aim to move to using PlayerInputDown entirely, instead of using hardcoded keys & simply remapping to those
2021-11-26 14:56:25 -05:00
James R
d6dc33e024 Add spindash to gamecontrolname 2021-04-04 22:47:57 -07:00
Sally Coolatta
0a10396c84 Spindash shortcut button 2021-03-09 17:28:20 -05:00
Sally Coolatta
7c2bd0d1c2 Merge remote-tracking branch 'srb2/next' into the-scary-22-merge 2020-10-24 20:50:58 -04:00
Sally Coolatta
9b6aa946ea Merge remote-tracking branch 'srb2/master' into the-scary-22-merge 2020-10-24 19:28:06 -04:00
James R
b7c4a82a0f Replace C90's junk with a modest macro 2020-10-06 23:04:23 -07:00
Sally Coolatta
6ef0af4ba5 g_game and g_input now compile 2020-08-13 00:05:44 -04:00