Commit graph

88 commits

Author SHA1 Message Date
Antonio Martinez
cad7273ff4 Controller type refactor 2024-09-27 03:28:40 -07:00
Antonio Martinez
5563a06827 Lua ABC -> Lua 123, move dpad to generic to make room for lua gamecontrol translation 2024-09-27 03:28:39 -07:00
Antonio Martinez
9edeaaf0ba Keyboard label fuckapalooza 2024-09-27 03:28:37 -07:00
Antonio Martinez
dbd43859fe Descriptive input: K_DrawGameControl rich text wrapper (WIP) 2024-09-27 03:28:36 -07:00
Antonio Martinez
0b9c5c7415 Move bind-search logic to g_input 2024-09-27 03:28:36 -07:00
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
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
Eidolon
02e56a304e Reset all gamekeydown arrays for all devices 2024-01-11 22:04:13 -06:00
Sally Coolatta
668d832ca1 Delete respawn command, put Ring shooter on Y 2023-04-17 00:23:06 -04: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
toaster
1acf00daa6 G_PlayerInputAnalog: Only attempt default binds for menu if no binds are reachable by GetValueFromControlTable for that button
- GetValueFromControlTable: Return 0 only if a single G_KeyIsAvailable returns true for any bind
    - Otherwise returns NO_BINDS_REACHABLE -- #define'd as (-1)
    - Does not cover the `menucontrolreserved` check, which could maybe be moved to the opposite end of the function if it causes problems.
2023-03-19 17:48:24 +00:00
toaster
5a7f7b58f0 HandleGamepadDeviceEvents: Call at all junctures where event_t are digested
Permits controllers to actually be added when starting with -server
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
Eidolon
be021baa02 Add extern "C" in C++ to all headers 2022-12-30 19:26:16 -06: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
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
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
James R
2d509f40eb Remap game controls 2022-02-19 17:05:51 -08: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
f0a3dc74bb Fix control saving 2021-12-28 06:48:53 -05:00
Sally Coolatta
c49a5dd0cf Properly only accept menu controls when its active 2021-12-28 05:19:04 -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
Sally Coolatta
0a10396c84 Spindash shortcut button 2021-03-09 17:28:20 -05:00
Sally Coolatta
6ef0af4ba5 g_game and g_input now compile 2020-08-13 00:05:44 -04:00
Sally Coolatta
135e9b9797 f_finale now compiles 2020-08-11 23:13:25 -04:00
Sally Coolatta
8731c6b7a4 Another round of fixing up
- gametyperules are now fitting for kart, not applied to the whole codebase though
- a few more files compile
2020-08-11 16:13:17 -04:00
Sally Coolatta
8071ec92e8 InputDown -> PlayerInputDown, JoyAxis -> PlayerJoyAxis 2020-08-10 17:00:45 -04:00
Sally Coolatta
b546f7d188 Merge g_input.c/h 2020-08-04 01:41:00 -04:00
Sally Coolatta
63917ffccc The start of the scary 2.2 merge
All conflicts are left in-tact. We should be collaborating on solving these files one at a time.
2020-05-29 13:43:38 -04:00
James R
2274129f57 Update copyright year to 2020 2020-02-19 14:08:45 -08:00
fickleheart
4c41bc1478 Consolidate G_BuildTiccmd 2019-12-08 13:27:11 -06:00
Steel Titanium
a5cdb0a4b3 Update copyright date on source files 2019-12-06 13:49:42 -05:00
SeventhSentinel
1d58c6b8c2 merge srb2 next 2019-01-05 15:59:23 -05:00
mazmazz
81352aece1 WIP 20190101 merge
d_netcmd.c
filesrch.c
m_menu.c
p_setup.c
p_spec.c
r_data.c
r_main.c
r_things.c
w_wad.c
w_wad.h
2019-01-02 01:09:15 -05:00
mazmazz
c82cd78bb7 Merge remote-tracking branch 'public-gl/2122-version' into 2122-version 2018-12-23 18:09:54 -05:00
mazmazz
ff2ec801bc Clear all control keys before loading defaults in LoadConfig 2018-12-23 14:59:26 -05:00
mazmazz
2cd851652a Add G_FilterKeyByVersion() to setcontrol 2018-12-20 16:30:37 -05:00
mazmazz
8aa4575bc1 Add gc_viewpoint from Kart 2018-12-03 11:50:57 -05:00
mazmazz
ec361ee6ac Add gc_screenshot and gc_recordgif from Kart 2018-12-03 11:31:48 -05:00
mazmazz
0e52208384 Add gc_systemmenu from Kart 2018-12-03 11:21:25 -05:00