Movement Speed toggle

Using X you can toggle between Full (100%), Comfortable (75%) and Walk (50%), small icon on screen to show you
This commit is contained in:
Simon 2022-11-25 23:25:37 +00:00
parent fe1216e84d
commit 6ee8dcd2bc
15 changed files with 46 additions and 8 deletions

View file

@ -1331,7 +1331,6 @@ void JKVR_Init()
vr_turn_angle = Cvar_Get( "vr_turn_angle", "45", CVAR_ARCHIVE);
vr_positional_factor = Cvar_Get( "vr_positional_factor", "12", CVAR_ARCHIVE);
vr_walkdirection = Cvar_Get( "vr_walkdirection", "1", CVAR_ARCHIVE);
vr_movement_multiplier = Cvar_Get( "vr_movement_multiplier", "0.8", CVAR_ARCHIVE);
vr_weapon_pitchadjust = Cvar_Get( "vr_weapon_pitchadjust", "-20.0", CVAR_ARCHIVE);
vr_virtual_stock = Cvar_Get( "vr_virtual_stock", "0", CVAR_ARCHIVE);

View file

@ -18,6 +18,7 @@ typedef struct {
bool weapon_stabilised;
bool right_handed;
bool player_moving;
int move_speed; // 0 (default) = Comfortable (75%) , 1 = Full (100%), 2 = Walk (50%)
bool crouched;
int cgzoommode;
int saberBlockDebounce; // Amount of time after player is blocked that the saber position is fixed

View file

@ -2,7 +2,6 @@ extern cvar_t *vr_turn_mode;
extern cvar_t *vr_turn_angle;
extern cvar_t *vr_positional_factor;
extern cvar_t *vr_walkdirection;
extern cvar_t *vr_movement_multiplier;
extern cvar_t *vr_weapon_pitchadjust;
extern cvar_t *vr_control_scheme;
extern cvar_t *vr_virtual_stock;

View file

@ -22,7 +22,6 @@ cvar_t *vr_turn_mode;
cvar_t *vr_turn_angle;
cvar_t *vr_positional_factor;
cvar_t *vr_walkdirection;
cvar_t *vr_movement_multiplier;
cvar_t *vr_weapon_pitchadjust;
cvar_t *vr_control_scheme;
cvar_t *vr_virtual_stock;

View file

@ -704,18 +704,20 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG
//Move a lot slower if scope is engaged
remote_movementSideways =
v[0] * vr_movement_multiplier->value;
v[0] * (vr.move_speed == 0 ? 0.75f : (vr.move_speed == 1 ? 1.0f : 0.5f));
remote_movementForward =
v[1] * vr_movement_multiplier->value;
v[1] * (vr.move_speed == 0 ? 0.75f : (vr.move_speed == 1 ? 1.0f : 0.5f));
ALOGV(" remote_movementSideways: %f, remote_movementForward: %f",
remote_movementSideways,
remote_movementForward);
if (!canUseQuickSave) {
if ((secondaryButtonsNew & secondaryButton1) !=
(secondaryButtonsOld & secondaryButton1)) {
if (((secondaryButtonsNew & secondaryButton1) !=
(secondaryButtonsOld & secondaryButton1)) &&
(secondaryButtonsNew & secondaryButton1)) {
//Toggle walk/run somehow?!
vr.move_speed = (++vr.move_speed) % 3;
}
}

View file

@ -34,6 +34,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
#include "FxUtil.h"
void CG_DrawIconBackground(void);
void CG_DrawMoveSpeedIcon(void);
void CG_DrawMissionInformation( void );
void CG_DrawInventorySelect( void );
void CG_DrawForceSelect( void );
@ -2745,6 +2746,8 @@ static void CG_Draw2D( void )
CG_DrawIconBackground();
}
CG_DrawMoveSpeedIcon();
CG_DrawWeaponSelect();
if ( cg.zoomMode == 0 )

View file

@ -457,6 +457,9 @@ typedef struct {
vec3_t itemSelectorOrigin;
vec3_t itemSelectorOffset;
int moveSpeedSelect;
int moveSpeedSelectTime;
int inventorySelect; // Current inventory item chosen
int inventorySelectTime;

View file

@ -1315,6 +1315,10 @@ static void CG_RegisterGraphics( void ) {
cgs.media.vignetteShader = cgi_R_RegisterShaderNoMip( "gfx/vignette" );
cgs.media.iconMoveSpeed[0] = cgi_R_RegisterShaderNoMip( "gfx/icon_comfortable" );
cgs.media.iconMoveSpeed[1] = cgi_R_RegisterShaderNoMip( "gfx/icon_full" );
cgs.media.iconMoveSpeed[2] = cgi_R_RegisterShaderNoMip( "gfx/icon_walk" );
// FIXME: do these conditionally
cgi_R_RegisterShader( "gfx/2d/workingCamera" );

View file

@ -103,6 +103,8 @@ typedef struct {
qhandle_t turretComputerOverlayShader;
qhandle_t turretCrossHairShader;
qhandle_t iconMoveSpeed[3];
int currentDataPadIconBackground;
//Chunks

View file

@ -1426,6 +1426,33 @@ int CG_WeaponCheck( int weaponIndex )
return value;
}
/*
===================
CG_DrawMoveSpeedIcon
===================
*/
void CG_DrawMoveSpeedIcon(void) {
if ((cg.zoomMode != 0) || !(cg_drawHUD.integer)) {
return;
}
if ((cg.snap->ps.viewEntity > 0 && cg.snap->ps.viewEntity < ENTITYNUM_WORLD)) {
return;
}
if (cg.moveSpeedSelect != vr->move_speed)
{
cg.moveSpeedSelect = vr->move_speed;
cg.moveSpeedSelectTime = cg.time;
}
if (((cg.moveSpeedSelectTime+WEAPON_SELECT_TIME)>cg.time)) {
cgi_R_SetColor(colorTable[CT_WHITE]);
CG_DrawPic(96, 64, 48, 64, cgs.media.iconMoveSpeed[cg.moveSpeedSelect]);
}
}
/*
===================
CG_DrawIconBackground

View file

@ -160,7 +160,6 @@ seta ui_r_glCustom "4"
seta ui_screenshotType "jpg"
seta vr_control_scheme "0"
seta vr_immersive_cinematics "1"
seta vr_movement_multiplier "0.85"
seta vr_positional_factor "12"
seta vr_screen_dist "3.500000"
seta vr_switch_sticks "0"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.