mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'tutorial-time' into tutorial-time-firstprompt
This commit is contained in:
commit
8b1624576f
9 changed files with 115 additions and 45 deletions
24
src/d_main.c
24
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,18 @@ 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
|
||||||
|
CV_SetValue(&cv_usemouse, tutorialusemouse);
|
||||||
|
CV_SetValue(&cv_alwaysfreelook, tutorialfreelook);
|
||||||
|
CV_SetValue(&cv_mousemove, tutorialmousemove);
|
||||||
|
CV_SetValue(&cv_analog, tutorialanalog);
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -1809,8 +1809,14 @@ 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
|
||||||
|
CV_SetValue(&cv_usemouse, tutorialusemouse);
|
||||||
|
CV_SetValue(&cv_alwaysfreelook, tutorialfreelook);
|
||||||
|
CV_SetValue(&cv_mousemove, tutorialmousemove);
|
||||||
|
CV_SetValue(&cv_analog, tutorialanalog);
|
||||||
|
}
|
||||||
tutorialmode = false; // warping takes us out of tutorial mode
|
tutorialmode = false; // warping takes us out of tutorial mode
|
||||||
|
|
||||||
D_MapChange(newmapnum, newgametype, false, newresetplayers, 0, false, fromlevelselect);
|
D_MapChange(newmapnum, newgametype, false, newresetplayers, 0, false, fromlevelselect);
|
||||||
|
|
|
||||||
|
|
@ -131,6 +131,11 @@ extern INT16 bootmap; //bootmap for loading a map on startup
|
||||||
|
|
||||||
extern INT16 tutorialmap; // map to load for tutorial
|
extern INT16 tutorialmap; // map to load for tutorial
|
||||||
extern boolean tutorialmode; // are we in a tutorial right now?
|
extern boolean tutorialmode; // are we in a tutorial right now?
|
||||||
|
extern INT32 tutorialgcs; // which control scheme is loaded?
|
||||||
|
extern INT32 tutorialusemouse; // store cv_usemouse user value
|
||||||
|
extern INT32 tutorialfreelook; // store cv_alwaysfreelook user value
|
||||||
|
extern INT32 tutorialmousemove; // store cv_mousemove user value
|
||||||
|
extern INT32 tutorialanalog; // store cv_analog user value
|
||||||
|
|
||||||
extern boolean looptitle;
|
extern boolean looptitle;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,11 @@ INT16 bootmap; //bootmap for loading a map on startup
|
||||||
|
|
||||||
INT16 tutorialmap = 0; // map to load for tutorial
|
INT16 tutorialmap = 0; // map to load for tutorial
|
||||||
boolean tutorialmode = false; // are we in a tutorial right now?
|
boolean tutorialmode = false; // are we in a tutorial right now?
|
||||||
|
INT32 tutorialgcs = gcs_custom; // which control scheme is loaded?
|
||||||
|
INT32 tutorialusemouse = 0; // store cv_usemouse user value
|
||||||
|
INT32 tutorialfreelook = 0; // store cv_alwaysfreelook user value
|
||||||
|
INT32 tutorialmousemove = 0; // store cv_mousemove user value
|
||||||
|
INT32 tutorialanalog = 0; // store cv_analog user value
|
||||||
|
|
||||||
boolean looptitle = false;
|
boolean looptitle = false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -659,20 +659,20 @@ void G_DefineDefaultControls(void)
|
||||||
gamecontroldefault[gcs_fps][gc_firenormal ][0] = 'c';
|
gamecontroldefault[gcs_fps][gc_firenormal ][0] = 'c';
|
||||||
|
|
||||||
// Platform game controls (arrow keys)
|
// Platform game controls (arrow keys)
|
||||||
// gamecontroldefault[gcs_platform][gc_forward ][0] = KEY_UPARROW;
|
gamecontroldefault[gcs_platform][gc_forward ][0] = KEY_UPARROW;
|
||||||
// gamecontroldefault[gcs_platform][gc_backward ][0] = KEY_DOWNARROW;
|
gamecontroldefault[gcs_platform][gc_backward ][0] = KEY_DOWNARROW;
|
||||||
// gamecontroldefault[gcs_platform][gc_strafeleft ][0] = 'a';
|
gamecontroldefault[gcs_platform][gc_strafeleft ][0] = 'a';
|
||||||
// gamecontroldefault[gcs_platform][gc_straferight][0] = 'd';
|
gamecontroldefault[gcs_platform][gc_straferight][0] = 'd';
|
||||||
// gamecontroldefault[gcs_platform][gc_lookup ][0] = KEY_PGUP;
|
gamecontroldefault[gcs_platform][gc_lookup ][0] = KEY_PGUP;
|
||||||
// gamecontroldefault[gcs_platform][gc_lookdown ][0] = KEY_PGDN;
|
gamecontroldefault[gcs_platform][gc_lookdown ][0] = KEY_PGDN;
|
||||||
// gamecontroldefault[gcs_platform][gc_turnleft ][0] = KEY_LEFTARROW;
|
gamecontroldefault[gcs_platform][gc_turnleft ][0] = KEY_LEFTARROW;
|
||||||
// gamecontroldefault[gcs_platform][gc_turnright ][0] = KEY_RIGHTARROW;
|
gamecontroldefault[gcs_platform][gc_turnright ][0] = KEY_RIGHTARROW;
|
||||||
// gamecontroldefault[gcs_platform][gc_centerview ][0] = KEY_END;
|
gamecontroldefault[gcs_platform][gc_centerview ][0] = KEY_END;
|
||||||
// gamecontroldefault[gcs_platform][gc_jump ][0] = KEY_SPACE;
|
gamecontroldefault[gcs_platform][gc_jump ][0] = KEY_SPACE;
|
||||||
// gamecontroldefault[gcs_platform][gc_use ][0] = KEY_LSHIFT;
|
gamecontroldefault[gcs_platform][gc_use ][0] = KEY_LSHIFT;
|
||||||
// gamecontroldefault[gcs_platform][gc_fire ][0] = 's';
|
gamecontroldefault[gcs_platform][gc_fire ][0] = 's';
|
||||||
// gamecontroldefault[gcs_platform][gc_fire ][1] = KEY_MOUSE1+0;
|
gamecontroldefault[gcs_platform][gc_fire ][1] = KEY_MOUSE1+0;
|
||||||
// gamecontroldefault[gcs_platform][gc_firenormal ][0] = 'w';
|
gamecontroldefault[gcs_platform][gc_firenormal ][0] = 'w';
|
||||||
|
|
||||||
for (i = 1; i < num_gamecontrolschemes; i++) // skip gcs_custom (0)
|
for (i = 1; i < num_gamecontrolschemes; i++) // skip gcs_custom (0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ typedef enum
|
||||||
{
|
{
|
||||||
gcs_custom,
|
gcs_custom,
|
||||||
gcs_fps,
|
gcs_fps,
|
||||||
//gcs_platform,
|
gcs_platform,
|
||||||
num_gamecontrolschemes
|
num_gamecontrolschemes
|
||||||
} gamecontrolschemes_e;
|
} gamecontrolschemes_e;
|
||||||
|
|
||||||
|
|
|
||||||
59
src/m_menu.c
59
src/m_menu.c
|
|
@ -6141,7 +6141,11 @@ 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);
|
||||||
|
CV_Set(&cv_usemouse, cv_usemouse.defaultvalue);
|
||||||
|
CV_Set(&cv_alwaysfreelook, cv_alwaysfreelook.defaultvalue);
|
||||||
|
CV_Set(&cv_mousemove, cv_mousemove.defaultvalue);
|
||||||
|
CV_Set(&cv_analog, cv_analog.defaultvalue);
|
||||||
S_StartSound(NULL, sfx_itemup);
|
S_StartSound(NULL, sfx_itemup);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -6150,17 +6154,35 @@ void M_TutorialSaveControlResponse(INT32 ch)
|
||||||
|
|
||||||
static void M_TutorialControlResponse(INT32 ch)
|
static void M_TutorialControlResponse(INT32 ch)
|
||||||
{
|
{
|
||||||
if (ch == 'y' || ch == KEY_ENTER)
|
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
|
||||||
G_CopyControls(gamecontrol, gamecontroldefault[gcs_fps], gclist_tutorial, num_gclist_tutorial);
|
if (ch == 'y' || ch == KEY_ENTER)
|
||||||
//S_StartSound(NULL, sfx_itemup);
|
{
|
||||||
|
tutorialgcs = gcs_fps;
|
||||||
|
tutorialusemouse = cv_usemouse.value;
|
||||||
|
tutorialfreelook = cv_alwaysfreelook.value;
|
||||||
|
tutorialmousemove = cv_mousemove.value;
|
||||||
|
tutorialanalog = cv_analog.value;
|
||||||
|
|
||||||
|
G_CopyControls(gamecontrol, gamecontroldefault[tutorialgcs], gclist_tutorial, num_gclist_tutorial);
|
||||||
|
CV_Set(&cv_usemouse, cv_usemouse.defaultvalue);
|
||||||
|
CV_Set(&cv_alwaysfreelook, cv_alwaysfreelook.defaultvalue);
|
||||||
|
CV_Set(&cv_mousemove, cv_mousemove.defaultvalue);
|
||||||
|
CV_Set(&cv_analog, cv_analog.defaultvalue);
|
||||||
|
|
||||||
|
//S_StartSound(NULL, sfx_itemup);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tutorialgcs = gcs_custom;
|
||||||
|
S_StartSound(NULL, sfx_menu1);
|
||||||
|
}
|
||||||
|
|
||||||
|
M_StartTutorial(INT32_MAX);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
S_StartSound(NULL, sfx_menu1);
|
S_StartSound(NULL, sfx_menu1);
|
||||||
|
|
||||||
if (ch != KEY_ESCAPE)
|
|
||||||
M_StartTutorial(INT32_MAX);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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)
|
||||||
|
|
@ -6171,11 +6193,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;
|
||||||
|
|
||||||
CV_SetValue(&cv_postfirsttime, 1);
|
CV_SetValue(&cv_postfirsttime, 1);
|
||||||
|
|
||||||
|
|
@ -9288,9 +9310,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
|
||||||
|
|
@ -9425,6 +9455,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);
|
||||||
|
|
|
||||||
18
src/m_misc.c
18
src/m_misc.c
|
|
@ -539,10 +539,24 @@ void M_SaveConfig(const char *filename)
|
||||||
|
|
||||||
// FIXME: save key aliases if ever implemented..
|
// FIXME: save key aliases if ever implemented..
|
||||||
|
|
||||||
CV_SaveVariables(f);
|
if (tutorialmode && tutorialgcs)
|
||||||
|
{
|
||||||
|
CV_SetValue(&cv_usemouse, tutorialusemouse);
|
||||||
|
CV_SetValue(&cv_alwaysfreelook, tutorialfreelook);
|
||||||
|
CV_SetValue(&cv_mousemove, tutorialmousemove);
|
||||||
|
CV_SetValue(&cv_analog, tutorialanalog);
|
||||||
|
CV_SaveVariables(f);
|
||||||
|
CV_Set(&cv_usemouse, cv_usemouse.defaultvalue);
|
||||||
|
CV_Set(&cv_alwaysfreelook, cv_alwaysfreelook.defaultvalue);
|
||||||
|
CV_Set(&cv_mousemove, cv_mousemove.defaultvalue);
|
||||||
|
CV_Set(&cv_analog, cv_analog.defaultvalue);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
CV_SaveVariables(f);
|
||||||
|
|
||||||
if (!dedicated)
|
if (!dedicated)
|
||||||
{
|
{
|
||||||
if (tutorialmode)
|
if (tutorialmode && tutorialgcs)
|
||||||
G_SaveKeySetting(f, gamecontroldefault[gcs_custom], gamecontrolbis); // using gcs_custom as temp storage
|
G_SaveKeySetting(f, gamecontroldefault[gcs_custom], gamecontrolbis); // using gcs_custom as temp storage
|
||||||
else
|
else
|
||||||
G_SaveKeySetting(f, gamecontrol, gamecontrolbis);
|
G_SaveKeySetting(f, gamecontrol, gamecontrolbis);
|
||||||
|
|
|
||||||
11
src/p_user.c
11
src/p_user.c
|
|
@ -8848,7 +8848,16 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
if (P_CameraThinker(player, thiscam, resetcalled))
|
if (P_CameraThinker(player, thiscam, resetcalled))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (thiscam == &camera)
|
if (tutorialmode)
|
||||||
|
{
|
||||||
|
// force defaults because we have a camera look section
|
||||||
|
camspeed = (INT32)(atof(cv_cam_speed.defaultvalue) * FRACUNIT);
|
||||||
|
camstill = (!stricmp(cv_cam_still.defaultvalue, "off")) ? false : true;
|
||||||
|
camrotate = atoi(cv_cam_rotate.defaultvalue);
|
||||||
|
camdist = FixedMul((INT32)(atof(cv_cam_dist.defaultvalue) * FRACUNIT), mo->scale);
|
||||||
|
camheight = FixedMul((INT32)(atof(cv_cam_height.defaultvalue) * FRACUNIT), FixedMul(player->camerascale, mo->scale));
|
||||||
|
}
|
||||||
|
else if (thiscam == &camera)
|
||||||
{
|
{
|
||||||
camspeed = cv_cam_speed.value;
|
camspeed = cv_cam_speed.value;
|
||||||
camstill = cv_cam_still.value;
|
camstill = cv_cam_still.value;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue