Scope Zooming (in and out) (@MuadDib)

This commit is contained in:
Simon 2023-01-19 21:16:20 +00:00
parent dad5ed29f7
commit 7578e39d67
3 changed files with 12 additions and 3 deletions

View file

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

View file

@ -248,7 +248,15 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
if (between(-0.2f, primaryJoystickX, 0.2f)) {
if (cl.frame.ps.weapon == WP_DISRUPTOR)
{
sendButtonAction("+altattack", pPrimaryJoystick->y > 0.8f);
if (pPrimaryJoystick->y > 0.8f) {
vr.cgzoomdir = -1; // zooming in
sendButtonAction("+altattack", true);
} else if (pPrimaryJoystick->y < -0.8f) {
vr.cgzoomdir = 1; // zooming out
sendButtonAction("+altattack", true);
} else {
sendButtonAction("+altattack", false);
}
}
else
{

View file

@ -1423,8 +1423,8 @@ static qboolean CG_CalcFov( void ) {
}
else
{
// disruptor zooming in faster
cg_zoomFov -= cg.frametime * 0.075f;
// disruptor zooming in faster (and also either in or out)
cg_zoomFov += vr->cgzoomdir * cg.frametime * 0.075f;
}
// Clamp zoomFov