Commit graph

67 commits

Author SHA1 Message Date
GenericHeroGuy
e669ca6edb Restore turn smoothing in the most horrific way possible 2025-03-11 01:44:25 +01:00
GenericHeroGuy
ef1489aa04 Cleanup, fix menu controls and keyboard 2025-03-10 15:06:52 +01:00
toaster
144e967ee5 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.
2025-03-10 11:04:00 +01:00
Sally Coolatta
9b3067a7a2 Fix control saving 2025-03-08 00:56:53 +01:00
Sally Coolatta
11bd4c453e 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.
2025-03-08 00:21:37 +01:00
Sally Coolatta
0a98ca63ab 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.

(G: finally, a commit that mostly survived... deviceResponding is useless
    for us right now but might as well keep it. maybe easier assignment on
    the multiplayer setup menu in the future?)
2025-03-07 23:44:59 +01:00
GenericHeroGuy
84850ba8a3 Update input handling in menus to use key bindings (port-ish of f17b9484)
G_GetControlForKey -> G_ControlBoundToKey, to make it usable everywhere
2025-03-07 18:12:59 +01:00
GenericHeroGuy
f419ccee57 New input handling (port of cd8862f0)
More or less a port with gamecontrols left untouched.

Some notable differences:
* ev_joystick now has a separate data1 for each axis, rather than having you
  check which of data2/3 is INT32_MAX and which one isn't
  (pissed me off when updating menu code...)
* Gutted the 1.6 upgrade code, since we're not upgrading from anything :P
* G_GetControlForKey, a helper for menu code
* Turn smoothing code left unused as a reminder to fix it
* Various small fixes so this commit is playable and doesn't segfault

Menu changes:
* Max 4 binds, joystick axes are now bindable like any other button
* The gamepad options submenu has been replaced by its two remaining options
  after the removal of axis cvars (gamepad select and deadzone)

See cd8862f0's message for more details
2025-03-07 00:05:35 +01:00
Eidolon
d08b923f06 Merge branch 'extern-c-everything' into 'master'
Add extern "C" in C++ to all headers

See merge request KartKrew/Kart!842
2024-10-15 14:14:43 -04:00
NepDisk
92bda9519a Reimplement turn smoothing plus toggle 2024-09-18 10:17:35 -04:00
NepDisk
dea5d0c897 remove more spindash leftovers 2024-08-04 13:47:37 -04: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
TehRealSalt
4507ee18fd Merge remote-tracking branch 'srb2public/next' into merge-next 2018-11-29 08:49:50 -05:00
mazmazz
c91b2b4456 Update source copyrights to 2018 2018-11-25 07:35:38 -05:00
TehRealSalt
ea655ba27a Reset to defaults option in controls 2018-11-22 22:50:40 -05:00
mazmazz
f0dbe3900c Refactor gclists 2018-11-12 23:23:39 -05:00
mazmazz
d52f91ff7b Uncomment gcs_platform 2018-11-12 17:16:54 -05:00
mazmazz
36d1088d20 Split gclist_tutorial_check from gclist_tutorial 2018-11-11 09:35:15 -05:00
mazmazz
81b470a57e num_gclist_tutorial adjustment 2018-11-11 09:21:54 -05:00
mazmazz
c4244802e2 gclist adjustments 2018-11-11 08:52:21 -05:00
mazmazz
7bd7c001d5 New gclists and const modifier; added tutorialmode declarations to this branch 2018-11-11 08:44:08 -05:00
mazmazz
880a1d4681 G_CopyControls and G_GetControlScheme adjustment (take input list of gc's to check) 2018-11-11 08:21:11 -05:00
mazmazz
762944d0a7 Made gamecontrol tables more portable
* G_DefineDefaultControls
* G_GetControlScheme
* G_CopyControls
* G_SaveKeySetting
* gamecontrolschemes_e
2018-11-10 17:26:30 -05:00
mazmazz
67bff00e9b Branch G_Controldefault into FPS and PLATFORM 2018-11-10 13:28:10 -05:00
TehRealSalt
c7b0df8172 Merge remote-tracking branch 'srb2public/next'
(Huge change: NO_MIDI is now a define, simply because that makes it easier for me to resolve merge conflicts if I can see the original code and the new code. Also means that people who REALLY miss MIDI can compile & fix it themselves :P)
2018-11-07 16:15:14 -05:00
Monster Iestyn
865da5f351 cv_controlperkey probably belongs in g_input.h too 2018-10-11 19:37:48 +01:00
Monster Iestyn
940b393aae Moved most of d_netcmd.h's 2P mouse consvar externs to the files with their 1P counterparts 2018-10-11 19:37:24 +01:00
TehRealSalt
771367c5d7 New bindable keys
You can now remap Change Viewpoint, Screenshot, and Toggle GIF Recording to other keys, mainly for gamepads

They also pushed me to my breaking point and I couldn't tolerate the control menu anymore, thanks to toaster for the scrolling backport
2018-09-27 16:55:21 -04:00
wolfy852
56e615d595 Merge commit 'c92926bfb6e080e39e658086fbc6f44b605348d3' into sonicitems 2018-09-09 17:57:23 -05:00
TehRealSalt
714992a152 Restore gc_camrotate
Sorry if this breaks everyone's configs again :V
2018-05-30 16:54:59 -04:00
TehRealSalt
30c84057dd Restructured some ticcmd stuff, temporary keyboard defaults, commented out mouse options menu
No more weapon number buttons, button constants reordered, and BT_JUMP
renamed to BT_DRIFT, and removed a lot of commented out stuff or stuff
we didn't need. Spectator-only support for looking up/down soon.
Keyboard defaults are just what I use, plan on adjusting it further
after more feedback
2018-01-24 02:45:06 -05:00
Matthew Marsalko
c92926bfb6 Add support for overriding the ESC key 2017-12-24 23:09:06 -08:00
TehRealSalt
60675ec101 Fixed joysticks 3 & 4
fun typos
2017-12-24 15:02:41 -05:00