mirror of
https://github.com/DrBeef/JKXR.git
synced 2024-11-10 14:52:00 +00:00
vr_always_run cvar so player doesn't cycle move speeds on thumbstick
This commit is contained in:
parent
83bee3bbff
commit
11f6204ba5
4 changed files with 25 additions and 6 deletions
|
@ -18,6 +18,7 @@ extern cvar_t *vr_force_motion_controlled;
|
|||
extern cvar_t *vr_force_motion_push;
|
||||
extern cvar_t *vr_force_motion_pull;
|
||||
extern cvar_t *vr_motion_enable_saber;
|
||||
extern cvar_t *vr_always_run;
|
||||
extern cvar_t *vr_crouch_toggle;
|
||||
extern cvar_t *vr_irl_crouch_enabled;
|
||||
extern cvar_t *vr_irl_crouch_to_stand_ratio;
|
||||
|
|
|
@ -31,6 +31,7 @@ cvar_t *vr_force_motion_controlled;
|
|||
cvar_t *vr_force_motion_push;
|
||||
cvar_t *vr_force_motion_pull;
|
||||
cvar_t *vr_motion_enable_saber;
|
||||
cvar_t * vr_always_run;
|
||||
cvar_t *vr_crouch_toggle;
|
||||
cvar_t *vr_irl_crouch_enabled;
|
||||
cvar_t *vr_irl_crouch_to_stand_ratio;
|
||||
|
|
|
@ -496,7 +496,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
|||
}
|
||||
|
||||
//Switch movement speed
|
||||
if (!vr.cgzoommode)
|
||||
if (!vr.cgzoommode && !vr_always_run->integer)
|
||||
{
|
||||
static bool switched = false;
|
||||
if (between(-0.2f, primaryJoystickX, 0.2f) &&
|
||||
|
@ -892,11 +892,27 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
|||
vec2_t v;
|
||||
rotateAboutOrigin(x, y, controllerYawHeading, v);
|
||||
|
||||
//Move a lot slower if scope is engaged
|
||||
remote_movementSideways =
|
||||
v[0] * (vr.move_speed == 0 ? 0.75f : (vr.move_speed == 1 ? 1.0f : 0.5f));
|
||||
remote_movementForward =
|
||||
v[1] * (vr.move_speed == 0 ? 0.75f : (vr.move_speed == 1 ? 1.0f : 0.5f));
|
||||
float move_speed_multiplier = 1.0f;
|
||||
switch (vr.move_speed)
|
||||
{
|
||||
case 0:
|
||||
move_speed_multiplier = 0.75f;
|
||||
break;
|
||||
case 1:
|
||||
move_speed_multiplier = 1.0f;
|
||||
break;
|
||||
case 2:
|
||||
move_speed_multiplier = 0.5f;
|
||||
break;
|
||||
}
|
||||
|
||||
if (vr_always_run->integer)
|
||||
{
|
||||
move_speed_multiplier = 1.0f;
|
||||
}
|
||||
|
||||
remote_movementSideways = move_speed_multiplier * v[0];
|
||||
remote_movementForward = move_speed_multiplier * v[1];
|
||||
|
||||
|
||||
//X button invokes menu now
|
||||
|
|
|
@ -259,6 +259,7 @@ void VR_Init()
|
|||
vr_force_motion_push = Cvar_Get ("vr_force_motion_push", "3", CVAR_ARCHIVE);
|
||||
vr_force_motion_pull = Cvar_Get ("vr_force_motion_pull", "4", CVAR_ARCHIVE);
|
||||
vr_motion_enable_saber = Cvar_Get ("vr_motion_enable_saber", "0", CVAR_ARCHIVE);
|
||||
vr_always_run = Cvar_Get ("vr_always_run", "0", CVAR_ARCHIVE);
|
||||
vr_crouch_toggle = Cvar_Get ("vr_crouch_toggle", "0", CVAR_ARCHIVE);
|
||||
vr_irl_crouch_enabled = Cvar_Get ("vr_irl_crouch_enabled", "0", CVAR_ARCHIVE);
|
||||
vr_irl_crouch_to_stand_ratio = Cvar_Get ("vr_irl_crouch_to_stand_ratio", "0.65", CVAR_ARCHIVE);
|
||||
|
|
Loading…
Reference in a new issue