allow gamepad dpad to hold scroll shit in menu aaa

absolute arsepain cant wait to see this breaking kek
This commit is contained in:
Alug committed 2024-05-23 19:11:11 +02:00
1 parent 0c9dc33ff0
commit ecd6ef40ef
3 files changed
+83 -1

No files matched your search

+39
View File
@@ -612,6 +612,7 @@ static void D_Display(void)
// =========================================================================
tic_t rendergametic;
static int menuInputDelayTimer = 0;
void D_SRB2Loop(void)
{
@@ -774,6 +775,44 @@ void D_SRB2Loop(void)
}
#endif
// this is absolutely awful and i hate it lmao
if (menuactive && (UPKEY || DOWNKEY || LEFTKEY || RIGHTKEY))
{
event_t myev;
myev.type = ev_keydown;
if (renderisnewtic)
{
menuInputDelayTimer++;
if (menuInputDelayTimer >= 19)
{
if (UPKEY)
{
myev.data1 = KEY_UPARROW;
M_Responder(&myev);
}
else if (DOWNKEY)
{
myev.data1 = KEY_DOWNARROW;
M_Responder(&myev);
}
else if (LEFTKEY)
{
myev.data1 = KEY_LEFTARROW;
M_Responder(&myev);
}
else if (RIGHTKEY)
{
myev.data1 = KEY_RIGHTARROW;
M_Responder(&myev);
}
}
}
}
else
menuInputDelayTimer = 0;
// Fully completed frame made.
finishprecise = I_GetPreciseTime();
if (!singletics)
+39 -1
View File
@@ -3433,6 +3433,11 @@ static void Command_Manual_f(void)
itemOn = 0;
}
boolean UPKEY = false;
boolean DOWNKEY = false;
boolean LEFTKEY = false;
boolean RIGHTKEY = false;
//
// M_Responder
//
@@ -3464,7 +3469,6 @@ boolean M_Responder(event_t *ev)
{
ch = ev->data1;
// added 5-2-98 remap virtual keys (mouse & joystick buttons)
switch (ch)
{
case KEY_MOUSE1:
@@ -3492,6 +3496,40 @@ boolean M_Responder(event_t *ev)
ch = KEY_RIGHTARROW;
break;
}
switch (ev->data1)
{
case KEY_HAT1:
UPKEY = true;
break;
case KEY_HAT1 + 1:
DOWNKEY = true;
break;
case KEY_HAT1 + 2:
LEFTKEY = true;
break;
case KEY_HAT1 + 3:
RIGHTKEY = true;
break;
}
}
else if (ev->type == ev_keyup)
{
switch (ev->data1)
{
case KEY_HAT1:
UPKEY = false;
break;
case KEY_HAT1 + 1:
DOWNKEY = false;
break;
case KEY_HAT1 + 2:
LEFTKEY = false;
break;
case KEY_HAT1 + 3:
RIGHTKEY = false;
break;
}
}
else if (menuactive)
{
+5
View File
@@ -74,6 +74,11 @@ typedef enum
} menumessagetype_t;
void M_StartMessage(const char *string, void *routine, menumessagetype_t itemtype);
extern boolean UPKEY;
extern boolean DOWNKEY;
extern boolean LEFTKEY;
extern boolean RIGHTKEY;
typedef enum
{
M_NOT_WAITING,