Fix camera reset button

This commit is contained in:
fickleheart 2019-12-30 15:34:43 -06:00
parent a51f2500e0
commit 2c45ecbaa5
3 changed files with 15 additions and 12 deletions

View file

@ -1508,9 +1508,9 @@ void SendWeaponPref(void)
buf[0] = 0;
if (cv_flipcam.value)
buf[0] |= 1;
if (cv_analog[0].value)
if (cv_analog[0].value && cv_directionchar[0].value != 2)
buf[0] |= 2;
if (cv_directionchar[0].value)
if (cv_directionchar[0].value == 1)
buf[0] |= 4;
if (cv_autobrake.value)
buf[0] |= 8;
@ -1524,9 +1524,9 @@ void SendWeaponPref2(void)
buf[0] = 0;
if (cv_flipcam2.value)
buf[0] |= 1;
if (cv_analog[1].value)
if (cv_analog[1].value && cv_directionchar[1].value != 2)
buf[0] |= 2;
if (cv_directionchar[1].value)
if (cv_directionchar[1].value == 1)
buf[0] |= 4;
if (cv_autobrake2.value)
buf[0] |= 8;

View file

@ -398,7 +398,7 @@ consvar_t cv_useranalog[2] = {
};
// deez New User eXperiences
static CV_PossibleValue_t directionchar_cons_t[] = {{0, "Camera"}, {1, "Movement"}, {0, NULL}};
static CV_PossibleValue_t directionchar_cons_t[] = {{0, "Camera"}, {1, "Movement"}, {2, "Simple Locked"}, {0, NULL}};
consvar_t cv_directionchar[2] = {
{"directionchar", "Movement", CV_SAVE|CV_CALL, directionchar_cons_t, DirectionChar_OnChange, 0, NULL, NULL, 0, 0, NULL},
{"directionchar2", "Movement", CV_SAVE|CV_CALL, directionchar_cons_t, DirectionChar2_OnChange, 0, NULL, NULL, 0, 0, NULL}
@ -1412,7 +1412,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
{
if (controlstyle == CS_SIMPLE && !ticcmd_centerviewdown[forplayer] && !G_RingSlingerGametype())
{
CV_SetValue(&cv_directionchar[forplayer], 0); ///@TODO will break things
CV_SetValue(&cv_directionchar[forplayer], 2);
*myangle = player->mo->angle;
*myaiming = 0;
@ -1487,6 +1487,9 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
}
}
if (ticcmd_centerviewdown[forplayer] && controlstyle == CS_SIMPLE)
controlstyle = CS_LEGACY;
if (PLAYERINPUTDOWN(ssplayer, gc_camreset))
{
if (camera.chase && !resetdown[forplayer])

View file

@ -4306,6 +4306,8 @@ const char *PlaystyleDesc[4] = {
"instead!"
};
static UINT8 playstyle_activeplayer = 0, playstyle_currentchoice = 0;
static void M_DrawControlsDefMenu(void)
{
UINT8 opt = 0;
@ -4314,7 +4316,8 @@ static void M_DrawControlsDefMenu(void)
if (currentMenu == &OP_P1ControlsDef)
{
opt = cv_useranalog[0].value ? 3 - cv_directionchar[0].value : cv_directionchar[0].value;
opt = cv_directionchar[0].value ? 1 : 0;
opt = playstyle_currentchoice = cv_useranalog[0].value ? 3 - opt : opt;
if (opt == 2)
{
@ -4329,7 +4332,8 @@ static void M_DrawControlsDefMenu(void)
}
else
{
opt = cv_useranalog[1].value ? 3 - cv_directionchar[1].value : cv_directionchar[1].value;
opt = cv_directionchar[1].value ? 1 : 0;
opt = playstyle_currentchoice = cv_useranalog[1].value ? 3 - opt : opt;
if (opt == 2)
{
@ -11608,14 +11612,11 @@ static void M_ChangeControl(INT32 choice)
M_StartMessage(tmp, M_ChangecontrolResponse, MM_EVENTHANDLER);
}
static UINT8 playstyle_activeplayer = 0, playstyle_currentchoice = 0;
static void M_Setup1PPlaystyleMenu(INT32 choice)
{
(void)choice;
playstyle_activeplayer = 0;
playstyle_currentchoice = cv_useranalog[0].value ? 3 - cv_directionchar[0].value : cv_directionchar[0].value;
OP_PlaystyleDef.prevMenu = &OP_P1ControlsDef;
M_SetupNextMenu(&OP_PlaystyleDef);
}
@ -11625,7 +11626,6 @@ static void M_Setup2PPlaystyleMenu(INT32 choice)
(void)choice;
playstyle_activeplayer = 1;
playstyle_currentchoice = cv_useranalog[1].value ? 3 - cv_directionchar[1].value : cv_directionchar[1].value;
OP_PlaystyleDef.prevMenu = &OP_P2ControlsDef;
M_SetupNextMenu(&OP_PlaystyleDef);
}