mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-28 05:11:34 +00:00
Hardcode Pause/Break key and change Pause default; show prompt in menu about Pause key
This commit is contained in:
parent
4b5246d5b7
commit
f926774ee1
3 changed files with 28 additions and 5 deletions
|
@ -1814,7 +1814,8 @@ boolean G_Responder(event_t *ev)
|
||||||
{
|
{
|
||||||
case ev_keydown:
|
case ev_keydown:
|
||||||
if (ev->data1 == gamecontrol[gc_pause][0]
|
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)
|
if (!pausedelay)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1189,7 +1189,7 @@ void G_Controldefault(void)
|
||||||
gamecontrol[gc_scores ][0] = KEY_TAB;
|
gamecontrol[gc_scores ][0] = KEY_TAB;
|
||||||
gamecontrol[gc_jump ][0] = KEY_SPACE;
|
gamecontrol[gc_jump ][0] = KEY_SPACE;
|
||||||
gamecontrol[gc_console ][0] = KEY_CONSOLE;
|
gamecontrol[gc_console ][0] = KEY_CONSOLE;
|
||||||
gamecontrol[gc_pause ][0] = KEY_PAUSE;
|
gamecontrol[gc_pause ][0] = 'p';
|
||||||
#ifdef WMINPUT
|
#ifdef WMINPUT
|
||||||
gamecontrol[gc_forward ][0] = KEY_JOY1+02; //UP
|
gamecontrol[gc_forward ][0] = KEY_JOY1+02; //UP
|
||||||
gamecontrol[gc_backward ][0] = KEY_JOY1+03; //DOWN
|
gamecontrol[gc_backward ][0] = KEY_JOY1+03; //DOWN
|
||||||
|
|
28
src/m_menu.c
28
src/m_menu.c
|
@ -6856,6 +6856,7 @@ static void M_DrawControl(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static INT32 controltochange;
|
static INT32 controltochange;
|
||||||
|
static char controltochangetext[55];
|
||||||
|
|
||||||
static void M_ChangecontrolResponse(event_t *ev)
|
static void M_ChangecontrolResponse(event_t *ev)
|
||||||
{
|
{
|
||||||
|
@ -6863,8 +6864,8 @@ static void M_ChangecontrolResponse(event_t *ev)
|
||||||
INT32 found;
|
INT32 found;
|
||||||
INT32 ch = ev->data1;
|
INT32 ch = ev->data1;
|
||||||
|
|
||||||
// ESCAPE cancels
|
// ESCAPE cancels; dummy out PAUSE
|
||||||
if (ch != KEY_ESCAPE)
|
if (ch != KEY_ESCAPE && ch != KEY_PAUSE)
|
||||||
{
|
{
|
||||||
|
|
||||||
switch (ev->type)
|
switch (ev->type)
|
||||||
|
@ -6923,8 +6924,28 @@ static void M_ChangecontrolResponse(event_t *ev)
|
||||||
G_CheckDoubleUsage(ch);
|
G_CheckDoubleUsage(ch);
|
||||||
setupcontrols[control][found] = 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);
|
M_StopMessage(0);
|
||||||
}
|
}
|
||||||
|
@ -6936,6 +6957,7 @@ static void M_ChangeControl(INT32 choice)
|
||||||
controltochange = currentMenu->menuitems[choice].alphaKey;
|
controltochange = currentMenu->menuitems[choice].alphaKey;
|
||||||
sprintf(tmp, M_GetText("Hit the new key for\n%s\nESC for Cancel"),
|
sprintf(tmp, M_GetText("Hit the new key for\n%s\nESC for Cancel"),
|
||||||
currentMenu->menuitems[choice].text);
|
currentMenu->menuitems[choice].text);
|
||||||
|
strncpy(controltochangetext, currentMenu->menuitems[choice].text, 55);
|
||||||
|
|
||||||
M_StartMessage(tmp, M_ChangecontrolResponse, MM_EVENTHANDLER);
|
M_StartMessage(tmp, M_ChangecontrolResponse, MM_EVENTHANDLER);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue