Hardcode Pause/Break key and change Pause default; show prompt in menu about Pause key

This commit is contained in:
mazmazz 2018-11-20 23:43:05 -05:00
parent 4b5246d5b7
commit f926774ee1
3 changed files with 28 additions and 5 deletions

View file

@ -1814,7 +1814,8 @@ boolean G_Responder(event_t *ev)
{
case ev_keydown:
if (ev->data1 == gamecontrol[gc_pause][0]
|| ev->data1 == gamecontrol[gc_pause][1])
|| ev->data1 == gamecontrol[gc_pause][1]
|| ev->data1 == KEY_PAUSE)
{
if (!pausedelay)
{

View file

@ -1189,7 +1189,7 @@ void G_Controldefault(void)
gamecontrol[gc_scores ][0] = KEY_TAB;
gamecontrol[gc_jump ][0] = KEY_SPACE;
gamecontrol[gc_console ][0] = KEY_CONSOLE;
gamecontrol[gc_pause ][0] = KEY_PAUSE;
gamecontrol[gc_pause ][0] = 'p';
#ifdef WMINPUT
gamecontrol[gc_forward ][0] = KEY_JOY1+02; //UP
gamecontrol[gc_backward ][0] = KEY_JOY1+03; //DOWN

View file

@ -6856,6 +6856,7 @@ static void M_DrawControl(void)
}
static INT32 controltochange;
static char controltochangetext[55];
static void M_ChangecontrolResponse(event_t *ev)
{
@ -6863,8 +6864,8 @@ static void M_ChangecontrolResponse(event_t *ev)
INT32 found;
INT32 ch = ev->data1;
// ESCAPE cancels
if (ch != KEY_ESCAPE)
// ESCAPE cancels; dummy out PAUSE
if (ch != KEY_ESCAPE && ch != KEY_PAUSE)
{
switch (ev->type)
@ -6923,8 +6924,28 @@ static void M_ChangecontrolResponse(event_t *ev)
G_CheckDoubleUsage(ch);
setupcontrols[control][found] = ch;
}
S_StartSound(NULL, sfx_strpst);
}
else if (ch == KEY_PAUSE)
{
static char tmp[155];
menu_t *prev = currentMenu->prevMenu;
if (controltochange == gc_pause)
sprintf(tmp, M_GetText("The \x82Pause Key \x80is enabled, but \nyou may select another key. \n\nHit another key for\n%s\nESC for Cancel"),
controltochangetext);
else
sprintf(tmp, M_GetText("The \x82Pause Key \x80is enabled, but \nit is not configurable. \n\nHit another key for\n%s\nESC for Cancel"),
controltochangetext);
M_StartMessage(tmp, M_ChangecontrolResponse, MM_EVENTHANDLER);
currentMenu->prevMenu = prev;
S_StartSound(NULL, sfx_s3k42);
return;
}
else
S_StartSound(NULL, sfx_skid);
M_StopMessage(0);
}
@ -6936,6 +6957,7 @@ static void M_ChangeControl(INT32 choice)
controltochange = currentMenu->menuitems[choice].alphaKey;
sprintf(tmp, M_GetText("Hit the new key for\n%s\nESC for Cancel"),
currentMenu->menuitems[choice].text);
strncpy(controltochangetext, currentMenu->menuitems[choice].text, 55);
M_StartMessage(tmp, M_ChangecontrolResponse, MM_EVENTHANDLER);
}