mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-22 02:42:20 +00:00
Change mouse cv vars temporarily alongside control scheme
This commit is contained in:
parent
44b42af22b
commit
acd922886a
6 changed files with 38 additions and 1 deletions
|
@ -739,6 +739,9 @@ void D_StartTitle(void)
|
|||
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);
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -1809,7 +1809,12 @@ static void Command_Map_f(void)
|
|||
fromlevelselect = ((netgame || multiplayer) && ((gametype == newgametype) && (newgametype == GT_COOP)));
|
||||
|
||||
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);
|
||||
}
|
||||
tutorialmode = false; // warping takes us out of tutorial mode
|
||||
|
||||
D_MapChange(newmapnum, newgametype, false, newresetplayers, 0, false, fromlevelselect);
|
||||
|
|
|
@ -132,6 +132,9 @@ extern INT16 bootmap; //bootmap for loading a map on startup
|
|||
extern INT16 tutorialmap; // map to load for tutorial
|
||||
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 boolean looptitle;
|
||||
|
||||
|
|
|
@ -130,6 +130,9 @@ INT16 bootmap; //bootmap for loading a map on startup
|
|||
INT16 tutorialmap = 0; // map to load for tutorial
|
||||
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
|
||||
|
||||
boolean looptitle = false;
|
||||
|
||||
|
|
11
src/m_menu.c
11
src/m_menu.c
|
@ -6139,6 +6139,9 @@ void M_TutorialSaveControlResponse(INT32 ch)
|
|||
if (ch == 'y' || ch == KEY_ENTER)
|
||||
{
|
||||
G_CopyControls(gamecontrol, gamecontroldefault[tutorialgcs], gclist_tutorial, num_gclist_tutorial);
|
||||
CV_SetValue(&cv_usemouse, 1);
|
||||
CV_SetValue(&cv_alwaysfreelook, 0);
|
||||
CV_SetValue(&cv_mousemove, 0);
|
||||
S_StartSound(NULL, sfx_itemup);
|
||||
}
|
||||
else
|
||||
|
@ -6153,7 +6156,15 @@ static void M_TutorialControlResponse(INT32 ch)
|
|||
if (ch == 'y' || ch == KEY_ENTER)
|
||||
{
|
||||
tutorialgcs = gcs_fps;
|
||||
tutorialusemouse = cv_usemouse.value;
|
||||
tutorialfreelook = cv_alwaysfreelook.value;
|
||||
tutorialmousemove = cv_mousemove.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);
|
||||
|
||||
//S_StartSound(NULL, sfx_itemup);
|
||||
}
|
||||
else
|
||||
|
|
14
src/m_misc.c
14
src/m_misc.c
|
@ -539,7 +539,19 @@ void M_SaveConfig(const char *filename)
|
|||
|
||||
// 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_SaveVariables(f);
|
||||
CV_Set(&cv_usemouse, cv_usemouse->defaultvalue);
|
||||
CV_Set(&cv_alwaysfreelook, cv_alwaysfreelook->defaultvalue);
|
||||
CV_Set(&cv_mousemove, cv_mousemove->defaultvalue);
|
||||
}
|
||||
else
|
||||
CV_SaveVariables(f);
|
||||
|
||||
if (!dedicated)
|
||||
{
|
||||
if (tutorialmode && tutorialgcs)
|
||||
|
|
Loading…
Reference in a new issue