Merge branch 'gc-menus' into 'next'

Make mappable buttons for System Menu, Screenshot, Movie, and Viewpoint

See merge request STJr/SRB2!358
This commit is contained in:
Digiku 2018-12-03 22:58:43 -05:00
commit 8471c416d7
8 changed files with 27 additions and 8 deletions

View file

@ -1677,7 +1677,8 @@ static INT32 camtoggledelay, camtoggledelay2 = 0;
boolean G_Responder(event_t *ev) boolean G_Responder(event_t *ev)
{ {
// allow spy mode changes even during the demo // allow spy mode changes even during the demo
if (gamestate == GS_LEVEL && ev->type == ev_keydown && ev->data1 == KEY_F12) if (gamestate == GS_LEVEL && ev->type == ev_keydown
&& (ev->data1 == KEY_F12 || ev->data1 == gamecontrol[gc_viewpoint][0] || ev->data1 == gamecontrol[gc_viewpoint][1]))
{ {
if (splitscreen || !netgame) if (splitscreen || !netgame)
displayplayer = consoleplayer; displayplayer = consoleplayer;

View file

@ -990,6 +990,10 @@ static const char *gamecontrolname[num_gamecontrols] =
"jump", "jump",
"console", "console",
"pause", "pause",
"systemmenu",
"screenshot",
"recordgif",
"viewpoint",
"custom1", "custom1",
"custom2", "custom2",
"custom3", "custom3",
@ -1190,6 +1194,10 @@ void G_Controldefault(void)
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] = 'p'; gamecontrol[gc_pause ][0] = 'p';
gamecontrol[gc_screenshot ][0] = KEY_F8;
gamecontrol[gc_recordgif ][0] = KEY_F9;
gamecontrol[gc_viewpoint ][0] = KEY_F12;
gamecontrol[gc_systemmenu ][0] = KEY_JOY1+7; // Start
#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

View file

@ -118,6 +118,10 @@ typedef enum
gc_jump, gc_jump,
gc_console, gc_console,
gc_pause, gc_pause,
gc_systemmenu,
gc_screenshot,
gc_recordgif,
gc_viewpoint,
gc_custom1, // Lua scriptable gc_custom1, // Lua scriptable
gc_custom2, // Lua scriptable gc_custom2, // Lua scriptable
gc_custom3, // Lua scriptable gc_custom3, // Lua scriptable

View file

@ -3629,7 +3629,7 @@ msgid "another castle!"
msgstr "" msgstr ""
#: st_stuff.c:2328 st_stuff.c:2334 st_stuff.c:2356 #: st_stuff.c:2328 st_stuff.c:2334 st_stuff.c:2356
msgid "Press F12 to watch another player." msgid "Press Viewpoint Key to watch a player."
msgstr "" msgstr ""
#: st_stuff.c:2333 #: st_stuff.c:2333

View file

@ -3820,7 +3820,7 @@ msgid "another castle!"
msgstr "" msgstr ""
#: st_stuff.c:2092 st_stuff.c:2098 st_stuff.c:2120 #: st_stuff.c:2092 st_stuff.c:2098 st_stuff.c:2120
msgid "Press F12 to watch another player." msgid "Press Viewpoint Key to watch a player."
msgstr "" msgstr ""
#: st_stuff.c:2097 #: st_stuff.c:2097

View file

@ -1073,6 +1073,10 @@ static menuitem_t OP_MiscControlsMenu[] =
{IT_CALL | IT_STRING2, NULL, "Custom Action 3", M_ChangeControl, gc_custom3 }, {IT_CALL | IT_STRING2, NULL, "Custom Action 3", M_ChangeControl, gc_custom3 },
{IT_CALL | IT_STRING2, NULL, "Pause", M_ChangeControl, gc_pause }, {IT_CALL | IT_STRING2, NULL, "Pause", M_ChangeControl, gc_pause },
{IT_CALL | IT_STRING2, NULL, "Screenshot", M_ChangeControl, gc_screenshot },
{IT_CALL | IT_STRING2, NULL, "Toggle GIF Recording", M_ChangeControl, gc_recordgif },
{IT_CALL | IT_STRING2, NULL, "Open/Close Menu (ESC)", M_ChangeControl, gc_systemmenu },
{IT_CALL | IT_STRING2, NULL, "Change Viewpoint", M_ChangeControl, gc_viewpoint },
{IT_CALL | IT_STRING2, NULL, "Console", M_ChangeControl, gc_console }, {IT_CALL | IT_STRING2, NULL, "Console", M_ChangeControl, gc_console },
}; };
@ -2172,6 +2176,8 @@ boolean M_Responder(event_t *ev)
if (ch == -1) if (ch == -1)
return false; return false;
else if (ch == gamecontrol[gc_systemmenu][0] || ch == gamecontrol[gc_systemmenu][1]) // allow remappable ESC key
ch = KEY_ESCAPE;
// F-Keys // F-Keys
if (!menuactive) if (!menuactive)

View file

@ -1494,9 +1494,9 @@ boolean M_ScreenshotResponder(event_t *ev)
return false; return false;
ch = ev->data1; ch = ev->data1;
if (ch == KEY_F8) if (ch == KEY_F8 || ch == gamecontrol[gc_screenshot][0] || ch == gamecontrol[gc_screenshot][1]) // remappable F8
M_ScreenShot(); M_ScreenShot();
else if (ch == KEY_F9) else if (ch == KEY_F9 || ch == gamecontrol[gc_recordgif][0] || ch == gamecontrol[gc_recordgif][1]) // remappable F9
((moviemode) ? M_StopMovie : M_StartMovie)(); ((moviemode) ? M_StopMovie : M_StartMovie)();
else else
return false; return false;

View file

@ -1871,12 +1871,12 @@ static void ST_overlayDrawer(void)
if (!hu_showscores && !splitscreen && netgame && displayplayer == consoleplayer) if (!hu_showscores && !splitscreen && netgame && displayplayer == consoleplayer)
{ {
if (G_GametypeUsesLives() && stplyr->lives <= 0 && countdown != 1) if (G_GametypeUsesLives() && stplyr->lives <= 0 && countdown != 1)
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), 0, M_GetText("Press F12 to watch another player.")); V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), 0, M_GetText("Press Viewpoint Key to watch a player."));
else if (gametype == GT_HIDEANDSEEK && else if (gametype == GT_HIDEANDSEEK &&
(!stplyr->spectator && !(stplyr->pflags & PF_TAGIT)) && (leveltime > hidetime * TICRATE)) (!stplyr->spectator && !(stplyr->pflags & PF_TAGIT)) && (leveltime > hidetime * TICRATE))
{ {
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(116), 0, M_GetText("You cannot move while hiding.")); V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(116), 0, M_GetText("You cannot move while hiding."));
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), 0, M_GetText("Press F12 to watch another player.")); V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), 0, M_GetText("Press Viewpoint Key to watch a player."));
} }
else if (!G_PlatformGametype() && stplyr->playerstate == PST_DEAD && stplyr->lives) //Death overrides spectator text. else if (!G_PlatformGametype() && stplyr->playerstate == PST_DEAD && stplyr->lives) //Death overrides spectator text.
{ {
@ -1899,7 +1899,7 @@ static void ST_overlayDrawer(void)
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), V_HUDTRANSHALF, M_GetText("You cannot join the game until the stage has ended.")); V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), V_HUDTRANSHALF, M_GetText("You cannot join the game until the stage has ended."));
else else
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), V_HUDTRANSHALF, M_GetText("Press Fire to enter the game.")); V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), V_HUDTRANSHALF, M_GetText("Press Fire to enter the game."));
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(148), V_HUDTRANSHALF, M_GetText("Press F12 to watch another player.")); V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(148), V_HUDTRANSHALF, M_GetText("Press Viewpoint Key to watch a player."));
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(164), V_HUDTRANSHALF, M_GetText("Press Jump to float and Spin to sink.")); V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(164), V_HUDTRANSHALF, M_GetText("Press Jump to float and Spin to sink."));
} }
} }