diff --git a/src/d_ticcmd.h b/src/d_ticcmd.h index 226c8f4d8..c806f2642 100644 --- a/src/d_ticcmd.h +++ b/src/d_ticcmd.h @@ -26,22 +26,23 @@ // Button/action code definitions. typedef enum { - BT_ACCELERATE = 1, // Accelerate - BT_DRIFT = 1<<2, // Drift (direction is cmd->turning) - BT_BRAKE = 1<<3, // Brake - BT_ATTACK = 1<<4, // Use Item - BT_FORWARD = 1<<5, // Aim Item Forward - BT_BACKWARD = 1<<6, // Aim Item Backward - BT_LOOKBACK = 1<<7, // Look Backward + BT_ACCELERATE = 1, // Accelerate + BT_DRIFT = 1<<2, // Drift (direction is cmd->turning) + BT_BRAKE = 1<<3, // Brake + BT_ATTACK = 1<<4, // Use Item + BT_FORWARD = 1<<5, // Aim Item Forward + BT_BACKWARD = 1<<6, // Aim Item Backward + BT_LOOKBACK = 1<<7, // Look Backward BT_EBRAKEMASK = (BT_ACCELERATE|BT_BRAKE), + BT_SPINDASHMASK = (BT_ACCELERATE|BT_BRAKE|BT_DRIFT), // free: 1<<9 to 1<<12 // Lua garbage - BT_CUSTOM1 = 1<<13, - BT_CUSTOM2 = 1<<14, - BT_CUSTOM3 = 1<<15, + BT_LUAA = 1<<13, + BT_LUAB = 1<<14, + BT_LUAC = 1<<15, } buttoncode_t; // The data sampled per tick (single player) diff --git a/src/deh_tables.c b/src/deh_tables.c index 33854d522..f2e0dc966 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -6661,9 +6661,9 @@ struct int_const_s const INT_CONST[] = { {"BT_ATTACK",BT_ATTACK}, {"BT_FORWARD",BT_FORWARD}, {"BT_BACKWARD",BT_BACKWARD}, - {"BT_CUSTOM1",BT_CUSTOM1}, // Lua customizable - {"BT_CUSTOM2",BT_CUSTOM2}, // Lua customizable - {"BT_CUSTOM3",BT_CUSTOM3}, // Lua customizable + {"BT_LUAA",BT_LUAA}, // Lua customizable + {"BT_LUAB",BT_LUAB}, // Lua customizable + {"BT_LUAC",BT_LUAC}, // Lua customizable // Lua command registration flags {"COM_ADMIN",COM_ADMIN}, diff --git a/src/g_game.c b/src/g_game.c index ab2307b9f..ae0c2036b 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -956,7 +956,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) else { // forward with key or button // SRB2kart - we use an accel/brake instead of forward/backward. - fixed_t value = G_PlayerInputAnalog(forplayer, gc_a, 0); + INT32 value = G_PlayerInputAnalog(forplayer, gc_a, 0); if (value != 0) { cmd->buttons |= BT_ACCELERATE; @@ -982,24 +982,36 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) } } - // fire with any button/key + // drift if (G_PlayerInputDown(forplayer, gc_c, 0)) - { - cmd->buttons |= BT_ATTACK; - } - - // drift with any button/key - if (G_PlayerInputDown(forplayer, gc_x, 0)) { cmd->buttons |= BT_DRIFT; } - // rear view with any button/key + // A + B + C shortcut + if (G_PlayerInputDown(forplayer, gc_abc, 0)) + { + forward = 0; + cmd->buttons |= BT_SPINDASHMASK; + } + + // fire + if (G_PlayerInputDown(forplayer, gc_x, 0)) + { + cmd->buttons |= BT_ATTACK; + } + + // rear view if (G_PlayerInputDown(forplayer, gc_y, 0)) { cmd->buttons |= BT_LOOKBACK; } + // lua buttons a thru c + if (G_PlayerInputDown(forplayer, gc_luaa, 0)) { cmd->buttons |= BT_LUAA; } + if (G_PlayerInputDown(forplayer, gc_luab, 0)) { cmd->buttons |= BT_LUAB; } + if (G_PlayerInputDown(forplayer, gc_luac, 0)) { cmd->buttons |= BT_LUAC; } + // spectator aiming shit, ahhhh... /* { diff --git a/src/g_input.c b/src/g_input.c index 3ecc35724..35e5f7da9 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -18,6 +18,7 @@ #include "hu_stuff.h" // need HUFONT start & end #include "d_net.h" #include "console.h" +#include "i_joy.h" // JOYAXISRANGE #define MAXMOUSESENSITIVITY 100 // sensitivity steps @@ -118,7 +119,7 @@ void G_MapEventsToControls(event_t *ev) case ev_keydown: if (ev->data1 < NUMINPUTS) { - gamekeydown[ev->device][ev->data1] = FRACUNIT; + gamekeydown[ev->device][ev->data1] = JOYAXISRANGE; } #ifdef PARANOIA else @@ -404,6 +405,9 @@ static const char *gamecontrolname[num_gamecontrols] = "r", "start", "abc", + "luaa", + "luab", + "luac", "console", "talk", "teamtalk", diff --git a/src/g_input.h b/src/g_input.h index 38f0f4af3..d699a528c 100644 --- a/src/g_input.h +++ b/src/g_input.h @@ -67,12 +67,14 @@ typedef enum // special keys gc_abc, + gc_luaa, + gc_luab, + gc_luac, gc_console, gc_talk, gc_teamtalk, gc_screenshot, gc_recordgif, - num_gamecontrols } gamecontrols_e;