First time tutorial prompt fixes

This commit is contained in:
mazmazz 2018-11-12 19:10:41 -05:00
parent 8b1624576f
commit 14199fd516
3 changed files with 19 additions and 11 deletions

View file

@ -712,7 +712,7 @@ void D_RegisterClientCommands(void)
CV_RegisterVar(&cv_crosshair2); CV_RegisterVar(&cv_crosshair2);
CV_RegisterVar(&cv_alwaysfreelook); CV_RegisterVar(&cv_alwaysfreelook);
CV_RegisterVar(&cv_alwaysfreelook2); CV_RegisterVar(&cv_alwaysfreelook2);
CV_RegisterVar(&cv_postfirsttime); CV_RegisterVar(&cv_tutorialprompt);
// g_input.c // g_input.c
CV_RegisterVar(&cv_sideaxis); CV_RegisterVar(&cv_sideaxis);

View file

@ -55,7 +55,7 @@ extern tic_t timeinmap; // Ticker for time spent in level (used for levelcard di
extern INT16 rw_maximums[NUM_WEAPONS]; extern INT16 rw_maximums[NUM_WEAPONS];
// used in game menu // used in game menu
extern consvar_t cv_postfirsttime; extern consvar_t cv_tutorialprompt;
extern consvar_t cv_crosshair, cv_crosshair2; extern consvar_t cv_crosshair, cv_crosshair2;
extern consvar_t cv_invertmouse, cv_alwaysfreelook, cv_mousemove; extern consvar_t cv_invertmouse, cv_alwaysfreelook, cv_mousemove;
extern consvar_t cv_invertmouse2, cv_alwaysfreelook2, cv_mousemove2; extern consvar_t cv_invertmouse2, cv_alwaysfreelook2, cv_mousemove2;

View file

@ -442,7 +442,7 @@ static CV_PossibleValue_t serversort_cons_t[] = {
consvar_t cv_serversort = {"serversort", "Ping", CV_HIDEN | CV_CALL, serversort_cons_t, M_SortServerList, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_serversort = {"serversort", "Ping", CV_HIDEN | CV_CALL, serversort_cons_t, M_SortServerList, 0, NULL, NULL, 0, 0, NULL};
// first time memory // first time memory
consvar_t cv_postfirsttime = {"postfirsttime", "No", CV_HIDEN | CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_tutorialprompt = {"tutorialprompt", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
// autorecord demos for time attack // autorecord demos for time attack
static consvar_t cv_autorecord = {"autorecord", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_autorecord = {"autorecord", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -6178,11 +6178,12 @@ static void M_TutorialControlResponse(INT32 ch)
tutorialgcs = gcs_custom; tutorialgcs = gcs_custom;
S_StartSound(NULL, sfx_menu1); S_StartSound(NULL, sfx_menu1);
} }
M_StartTutorial(INT32_MAX); M_StartTutorial(INT32_MAX);
} }
else else
S_StartSound(NULL, sfx_menu1); S_StartSound(NULL, sfx_menu1);
MessageDef.prevMenu = &SP_MainDef; // if FirstPrompt -> ControlsPrompt -> ESC, we would go to the main menu unless we force this
} }
// Starts up the tutorial immediately (tbh I wasn't sure where else to put this) // Starts up the tutorial immediately (tbh I wasn't sure where else to put this)
@ -6199,7 +6200,7 @@ static void M_StartTutorial(INT32 choice)
else if (choice != INT32_MAX) else if (choice != INT32_MAX)
tutorialgcs = gcs_custom; tutorialgcs = gcs_custom;
CV_SetValue(&cv_postfirsttime, 1); CV_SetValue(&cv_tutorialprompt, 0); // first-time prompt
tutorialmode = true; // turn on tutorial mode tutorialmode = true; // turn on tutorial mode
@ -6819,16 +6820,22 @@ static void M_HandleLoadSave(INT32 choice)
static void M_FirstTimeResponse(INT32 ch) static void M_FirstTimeResponse(INT32 ch)
{ {
CV_SetValue(&cv_postfirsttime, 1); S_StartSound(NULL, sfx_menu1);
if (ch == KEY_ESCAPE)
return;
if (ch != 'y' && ch != KEY_ENTER) if (ch != 'y' && ch != KEY_ENTER)
{ {
return; CV_SetValue(&cv_tutorialprompt, 0);
// copypasta from M_LoadGame
M_ReadSaveStrings(); M_ReadSaveStrings();
M_SetupNextMenu(&SP_LoadDef); MessageDef.prevMenu = &SP_LoadDef; // calls M_SetupNextMenu
} }
else else
{
M_StartTutorial(0); M_StartTutorial(0);
MessageDef.prevMenu = &MessageDef; // otherwise, the controls prompt won't fire
}
} }
// //
@ -6838,9 +6845,10 @@ static void M_LoadGame(INT32 choice)
{ {
(void)choice; (void)choice;
if (tutorialmap && !cv_postfirsttime.value) if (tutorialmap && cv_tutorialprompt.value)
{ {
M_StartMessage("Do you want to play a brief Tutorial?\n(Press 'Y' to go, or 'N' to skip)", M_FirstTimeResponse, MM_YESNO); M_StartMessage("Do you want to \x82play a brief Tutorial\x80?\n\nWe highly recommend this because \nthe controls are slightly different \nfrom other games.\n\nPress 'Y' or 'Enter' to go\nPress 'N' or any key to skip\n",
M_FirstTimeResponse, MM_YESNO);
return; return;
} }