From dbcbcf5da3af1f6e8cb6b46102613b3cb0818780 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 25 Mar 2017 03:13:02 -0400 Subject: [PATCH] Changed defaults, camera settings save Camera settings: distance from 128 to 160, height from 20 to 32, speed from 0.25 to 0.3 Mouse sensitivity from 35 to 12 Default control setup is Mystic's proposed scheme from the New Player Experiences topic (https://mb.srb2.org/showthread.php?t=42095) Also, camera settings now save to config, and they no longer try to reset back to the default at every chance it gets (you can die, start a new game, or exit, all while still keeping your preferred setting) --- src/g_game.c | 12 +++++++----- src/g_input.c | 23 ++++++++++------------- src/p_setup.c | 11 ++++++----- src/p_user.c | 16 ++++++++-------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 1eef85ada..f3ccbce99 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1565,11 +1565,12 @@ static void Analog_OnChange(void) return; // cameras are not initialized at this point + // Salt: Grooooaaan... I know that cameras aren't initalized yet and that analog needs a farther camera, but directly overwriting someone's settings should not be the way to do it! - if (leveltime > 1) + /*if (leveltime > 1) CV_SetValue(&cv_cam_dist, 128); if (cv_analog.value || demoplayback) - CV_SetValue(&cv_cam_dist, 192); + CV_SetValue(&cv_cam_dist, 192);*/ if (!cv_chasecam.value && cv_analog.value) { CV_SetValue(&cv_analog, 0); @@ -1590,11 +1591,12 @@ static void Analog2_OnChange(void) return; // cameras are not initialized at this point - - if (leveltime > 1) + // Salt: Grooooaaan... I know that cameras aren't initalized yet and that analog needs a farther camera, but directly overwriting someone's settings should not be the way to do it! + + /*if (leveltime > 1) CV_SetValue(&cv_cam2_dist, 128); if (cv_analog2.value) - CV_SetValue(&cv_cam2_dist, 192); + CV_SetValue(&cv_cam2_dist, 192);*/ if (!cv_chasecam2.value && cv_analog2.value) { CV_SetValue(&cv_analog2, 0); diff --git a/src/g_input.c b/src/g_input.c index b004384c0..a538df06c 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -25,10 +25,10 @@ static CV_PossibleValue_t mousesens_cons_t[] = {{1, "MIN"}, {MAXMOUSESENSITIVITY static CV_PossibleValue_t onecontrolperkey_cons_t[] = {{1, "One"}, {2, "Several"}, {0, NULL}}; // mouse values are used once -consvar_t cv_mousesens = {"mousesens", "35", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_mousesens2 = {"mousesens2", "35", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_mouseysens = {"mouseysens", "35", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_mouseysens2 = {"mouseysens2", "35", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_mousesens = {"mousesens", "12", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_mousesens2 = {"mousesens2", "12", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_mouseysens = {"mouseysens", "12", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_mouseysens2 = {"mouseysens2", "12", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_controlperkey = {"controlperkey", "One", CV_SAVE, onecontrolperkey_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; INT32 mousex, mousey; @@ -1154,10 +1154,8 @@ void G_Controldefault(void) #else void G_Controldefault(void) { - gamecontrol[gc_forward ][0] = KEY_UPARROW; - gamecontrol[gc_forward ][1] = 'w'; - gamecontrol[gc_backward ][0] = KEY_DOWNARROW; - gamecontrol[gc_backward ][1] = 's'; + gamecontrol[gc_forward ][0] = 'w'; + gamecontrol[gc_backward ][0] = 's'; gamecontrol[gc_strafeleft ][0] = 'a'; gamecontrol[gc_straferight][0] = 'd'; gamecontrol[gc_turnleft ][0] = KEY_LEFTARROW; @@ -1178,19 +1176,18 @@ void G_Controldefault(void) gamecontrol[gc_fire ][1] = KEY_MOUSE1+0; gamecontrol[gc_firenormal ][0] = 'c'; gamecontrol[gc_tossflag ][0] = '\''; - gamecontrol[gc_use ][0] = 'x'; + gamecontrol[gc_use ][0] = KEY_LSHIFT; gamecontrol[gc_camtoggle ][0] = 'v'; gamecontrol[gc_camleft ][0] = '['; gamecontrol[gc_camright ][0] = ']'; gamecontrol[gc_camreset ][0] = 'r'; - gamecontrol[gc_lookup ][0] = KEY_PGUP; - gamecontrol[gc_lookdown ][0] = KEY_PGDN; + gamecontrol[gc_lookup ][0] = KEY_UPARROW; + gamecontrol[gc_lookdown ][0] = KEY_DOWNARROW; gamecontrol[gc_centerview ][0] = KEY_END; gamecontrol[gc_talkkey ][0] = 't'; gamecontrol[gc_teamkey ][0] = 'y'; gamecontrol[gc_scores ][0] = KEY_TAB; - gamecontrol[gc_jump ][0] = 'z'; - gamecontrol[gc_jump ][1] = KEY_MOUSE1+1; + gamecontrol[gc_jump ][0] = KEY_SPACE; gamecontrol[gc_console ][0] = KEY_CONSOLE; gamecontrol[gc_pause ][0] = KEY_PAUSE; #ifdef WMINPUT diff --git a/src/p_setup.c b/src/p_setup.c index 6df103255..97bcb61f1 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2583,8 +2583,8 @@ boolean P_SetupLevel(boolean skipprecip) if (!dedicated) { - if (!cv_cam_speed.changed) - CV_Set(&cv_cam_speed, cv_cam_speed.defaultvalue); + //if (!cv_cam_speed.changed) + //CV_Set(&cv_cam_speed, cv_cam_speed.defaultvalue); if (!cv_chasecam.changed) CV_SetValue(&cv_chasecam, chase); @@ -2880,8 +2880,9 @@ boolean P_SetupLevel(boolean skipprecip) camera.angle = FixedAngle((fixed_t)thing->angle << FRACBITS); } } - - if (!cv_cam_height.changed) + + // Salt: I don't understand *why* it does this, but this overwrites the player's setting, even though it looks like it shouldn't do that unless if it's already the default + /*if (!cv_cam_height.changed) CV_Set(&cv_cam_height, cv_cam_height.defaultvalue); if (!cv_cam_dist.changed) @@ -2897,7 +2898,7 @@ boolean P_SetupLevel(boolean skipprecip) CV_Set(&cv_cam2_dist, cv_cam2_dist.defaultvalue); if (!cv_cam2_rotate.changed) - CV_Set(&cv_cam2_rotate, cv_cam2_rotate.defaultvalue); + CV_Set(&cv_cam2_rotate, cv_cam2_rotate.defaultvalue);*/ if (!cv_analog.changed) CV_SetValue(&cv_analog, 0); diff --git a/src/p_user.c b/src/p_user.c index 905c3be62..8b1589c42 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8020,18 +8020,18 @@ static CV_PossibleValue_t CV_CamSpeed[] = {{0, "MIN"}, {1*FRACUNIT, "MAX"}, {0, static CV_PossibleValue_t rotation_cons_t[] = {{1, "MIN"}, {45, "MAX"}, {0, NULL}}; static CV_PossibleValue_t CV_CamRotate[] = {{-720, "MIN"}, {720, "MAX"}, {0, NULL}}; -consvar_t cv_cam_dist = {"cam_dist", "128", CV_FLOAT, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_cam_height = {"cam_height", "20", CV_FLOAT, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam_dist = {"cam_dist", "160", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam_height = {"cam_height", "32", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam_still = {"cam_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_cam_speed = {"cam_speed", "0.25", CV_FLOAT, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam_speed = {"cam_speed", "0.3", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam_rotate = {"cam_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate_OnChange, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_cam_rotspeed = {"cam_rotspeed", "10", 0, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_cam2_dist = {"cam2_dist", "128", CV_FLOAT, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_cam2_height = {"cam2_height", "20", CV_FLOAT, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam_rotspeed = {"cam_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam2_dist = {"cam2_dist", "160", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam2_height = {"cam2_height", "32", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam2_still = {"cam2_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_cam2_speed = {"cam2_speed", "0.25", CV_FLOAT, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam2_speed = {"cam2_speed", "0.3", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam2_rotate = {"cam2_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate2_OnChange, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_cam2_rotspeed = {"cam2_rotspeed", "10", 0, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam2_rotspeed = {"cam2_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; fixed_t t_cam_dist = -42; fixed_t t_cam_height = -42;