Restrict control changes if tutorialgcs is active
This commit is contained in:
parent
45381058b3
commit
4986d5945b
20
src/d_main.c
20
src/d_main.c
|
@ -668,7 +668,6 @@ void D_AdvanceDemo(void)
|
||||||
void D_StartTitle(void)
|
void D_StartTitle(void)
|
||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i;
|
||||||
boolean tutorialpostprompt = false;
|
|
||||||
|
|
||||||
S_StopMusic();
|
S_StopMusic();
|
||||||
|
|
||||||
|
@ -713,16 +712,6 @@ void D_StartTitle(void)
|
||||||
// reset modeattacking
|
// reset modeattacking
|
||||||
modeattacking = ATTACKING_NONE;
|
modeattacking = ATTACKING_NONE;
|
||||||
|
|
||||||
// The title screen is obviously not a tutorial! (Unless I'm mistaken)
|
|
||||||
if (tutorialmode)
|
|
||||||
{
|
|
||||||
// check if retained controls are custom
|
|
||||||
tutorialpostprompt = (G_GetControlScheme(gamecontroldefault[gcs_custom], gclist_tutorial, num_gclist_tutorial) == gcs_custom
|
|
||||||
&& G_GetControlScheme(gamecontrol, gclist_tutorial, num_gclist_tutorial) != gcs_custom);
|
|
||||||
G_CopyControls(gamecontrol, gamecontroldefault[gcs_custom], gclist_tutorial, num_gclist_tutorial); // using gcs_custom as temp storage
|
|
||||||
}
|
|
||||||
tutorialmode = false;
|
|
||||||
|
|
||||||
// empty maptol so mario/etc sounds don't play in sound test when they shouldn't
|
// empty maptol so mario/etc sounds don't play in sound test when they shouldn't
|
||||||
maptol = 0;
|
maptol = 0;
|
||||||
|
|
||||||
|
@ -746,9 +735,14 @@ void D_StartTitle(void)
|
||||||
if (rendermode != render_none)
|
if (rendermode != render_none)
|
||||||
V_SetPaletteLump("PLAYPAL");
|
V_SetPaletteLump("PLAYPAL");
|
||||||
|
|
||||||
if (tutorialpostprompt)
|
// The title screen is obviously not a tutorial! (Unless I'm mistaken)
|
||||||
M_StartMessage("Do you want to \x82save the recommended \x82movement controls?\x80\n\nPress 'Y' or 'Enter' to confirm, \nor any key to keep \nyour current controls.",
|
if (tutorialmode && tutorialgcs)
|
||||||
|
{
|
||||||
|
G_CopyControls(gamecontrol, gamecontroldefault[gcs_custom], gclist_tutorial, num_gclist_tutorial); // using gcs_custom as temp storage
|
||||||
|
M_StartMessage("Do you want to \x82save the recommended \x82movement controls?\x80\n\nPress 'Y' or 'Enter' to confirm\nPress 'N' or any key to keep \nyour current controls",
|
||||||
M_TutorialSaveControlResponse, MM_YESNO);
|
M_TutorialSaveControlResponse, MM_YESNO);
|
||||||
|
}
|
||||||
|
tutorialmode = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -1808,7 +1808,7 @@ static void Command_Map_f(void)
|
||||||
else
|
else
|
||||||
fromlevelselect = ((netgame || multiplayer) && ((gametype == newgametype) && (newgametype == GT_COOP)));
|
fromlevelselect = ((netgame || multiplayer) && ((gametype == newgametype) && (newgametype == GT_COOP)));
|
||||||
|
|
||||||
if (tutorialmode)
|
if (tutorialmode && tutorialgcs)
|
||||||
G_CopyControls(gamecontrol, gamecontroldefault[gcs_custom], gclist_tutorial, num_gclist_tutorial); // using gcs_custom as temp storage
|
G_CopyControls(gamecontrol, gamecontroldefault[gcs_custom], gclist_tutorial, num_gclist_tutorial); // using gcs_custom as temp storage
|
||||||
tutorialmode = false; // warping takes us out of tutorial mode
|
tutorialmode = false; // warping takes us out of tutorial mode
|
||||||
|
|
||||||
|
|
31
src/m_menu.c
31
src/m_menu.c
|
@ -6138,7 +6138,7 @@ void M_TutorialSaveControlResponse(INT32 ch)
|
||||||
{
|
{
|
||||||
if (ch == 'y' || ch == KEY_ENTER)
|
if (ch == 'y' || ch == KEY_ENTER)
|
||||||
{
|
{
|
||||||
G_CopyControls(gamecontrol, gamecontroldefault[gcs_fps], gclist_tutorial, num_gclist_tutorial);
|
G_CopyControls(gamecontrol, gamecontroldefault[tutorialgcs], gclist_tutorial, num_gclist_tutorial);
|
||||||
S_StartSound(NULL, sfx_itemup);
|
S_StartSound(NULL, sfx_itemup);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -6149,14 +6149,18 @@ static void M_TutorialControlResponse(INT32 ch)
|
||||||
{
|
{
|
||||||
if (ch != KEY_ESCAPE)
|
if (ch != KEY_ESCAPE)
|
||||||
{
|
{
|
||||||
G_CopyControls(gamecontroldefault[gcs_custom], gamecontrol, NULL, 0);
|
G_CopyControls(gamecontroldefault[gcs_custom], gamecontrol, NULL, 0); // using gcs_custom as temp storage for old controls
|
||||||
if (ch == 'y' || ch == KEY_ENTER)
|
if (ch == 'y' || ch == KEY_ENTER)
|
||||||
{
|
{
|
||||||
G_CopyControls(gamecontrol, gamecontroldefault[gcs_fps], gclist_tutorial, num_gclist_tutorial);
|
tutorialgcs = gcs_fps;
|
||||||
|
G_CopyControls(gamecontrol, gamecontroldefault[tutorialgcs], gclist_tutorial, num_gclist_tutorial);
|
||||||
//S_StartSound(NULL, sfx_itemup);
|
//S_StartSound(NULL, sfx_itemup);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
tutorialgcs = gcs_custom;
|
||||||
S_StartSound(NULL, sfx_menu1);
|
S_StartSound(NULL, sfx_menu1);
|
||||||
|
}
|
||||||
|
|
||||||
M_StartTutorial(INT32_MAX);
|
M_StartTutorial(INT32_MAX);
|
||||||
}
|
}
|
||||||
|
@ -6172,11 +6176,11 @@ static void M_StartTutorial(INT32 choice)
|
||||||
|
|
||||||
if (choice != INT32_MAX && G_GetControlScheme(gamecontrol, gclist_tutorial_check, num_gclist_tutorial_check) == gcs_custom)
|
if (choice != INT32_MAX && G_GetControlScheme(gamecontrol, gclist_tutorial_check, num_gclist_tutorial_check) == gcs_custom)
|
||||||
{
|
{
|
||||||
M_StartMessage("Do you want to try the \202recommended \202movement controls\x80?\n\nWe will set them just for this tutorial.\n\nPress 'Y' or 'Enter' to confirm, \nor any key to keep \nyour current controls.\n",M_TutorialControlResponse,MM_YESNO);
|
M_StartMessage("Do you want to try the \202recommended \202movement controls\x80?\n\nWe will set them just for this tutorial.\n\nPress 'Y' or 'Enter' to confirm\nPress 'N' or any key to keep \nyour current controls.\n",M_TutorialControlResponse,MM_YESNO);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (choice != INT32_MAX)
|
else if (choice != INT32_MAX)
|
||||||
G_CopyControls(gamecontroldefault[gcs_custom], gamecontrol, NULL, 0);
|
tutorialgcs = gcs_custom;
|
||||||
|
|
||||||
tutorialmode = true; // turn on tutorial mode
|
tutorialmode = true; // turn on tutorial mode
|
||||||
|
|
||||||
|
@ -9267,9 +9271,17 @@ static void M_DrawControl(void)
|
||||||
// draw title (or big pic)
|
// draw title (or big pic)
|
||||||
M_DrawMenuTitle();
|
M_DrawMenuTitle();
|
||||||
|
|
||||||
M_CentreText(30,
|
if (tutorialmode && tutorialgcs)
|
||||||
(setupcontrols_secondaryplayer ? "SET CONTROLS FOR SECONDARY PLAYER" :
|
{
|
||||||
"PRESS ENTER TO CHANGE, BACKSPACE TO CLEAR"));
|
if ((gametic / TICRATE) % 2)
|
||||||
|
M_CentreText(30, "\202EXIT THE TUTORIAL TO CHANGE THE CONTROLS");
|
||||||
|
else
|
||||||
|
M_CentreText(30, "EXIT THE TUTORIAL TO CHANGE THE CONTROLS");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
M_CentreText(30,
|
||||||
|
(setupcontrols_secondaryplayer ? "SET CONTROLS FOR SECONDARY PLAYER" :
|
||||||
|
"PRESS ENTER TO CHANGE, BACKSPACE TO CLEAR"));
|
||||||
|
|
||||||
if (i)
|
if (i)
|
||||||
V_DrawString(currentMenu->x - 16, y-(skullAnimCounter/5), V_YELLOWMAP, "\x1A"); // up arrow
|
V_DrawString(currentMenu->x - 16, y-(skullAnimCounter/5), V_YELLOWMAP, "\x1A"); // up arrow
|
||||||
|
@ -9404,6 +9416,9 @@ static void M_ChangeControl(INT32 choice)
|
||||||
{
|
{
|
||||||
static char tmp[55];
|
static char tmp[55];
|
||||||
|
|
||||||
|
if (tutorialmode && tutorialgcs) // don't allow control changes if temp control override is active
|
||||||
|
return;
|
||||||
|
|
||||||
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);
|
||||||
|
|
Loading…
Reference in a new issue