mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-22 02:42:20 +00:00
Hardcode Pause/Break key and change Pause default; show prompt in menu about Pause key
This commit is contained in:
parent
74da082c75
commit
8a9c10e633
3 changed files with 25 additions and 4 deletions
|
@ -1800,7 +1800,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 (modeattacking && !demoplayback && (gamestate == GS_LEVEL))
|
||||
{
|
||||
|
|
|
@ -709,7 +709,7 @@ void G_DefineDefaultControls(void)
|
|||
gamecontroldefault[i][gc_teamkey ][0] = 'y';
|
||||
gamecontroldefault[i][gc_scores ][0] = KEY_TAB;
|
||||
gamecontroldefault[i][gc_console ][0] = KEY_CONSOLE;
|
||||
gamecontroldefault[i][gc_pause ][0] = KEY_PAUSE;
|
||||
gamecontroldefault[i][gc_pause ][0] = 'p';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
24
src/m_menu.c
24
src/m_menu.c
|
@ -9380,6 +9380,7 @@ static void M_DrawControl(void)
|
|||
#undef controlbuffer
|
||||
|
||||
static INT32 controltochange;
|
||||
static char controltochangetext[55];
|
||||
|
||||
static void M_ChangecontrolResponse(event_t *ev)
|
||||
{
|
||||
|
@ -9387,8 +9388,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)
|
||||
|
@ -9449,6 +9450,24 @@ static void M_ChangecontrolResponse(event_t *ev)
|
|||
}
|
||||
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 \nit cannot be used to retry runs \nduring Record Attack. \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);
|
||||
|
||||
|
@ -9465,6 +9484,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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue