mirror of
https://github.com/DrBeef/JKXR.git
synced 2025-02-16 08:51:50 +00:00
Scope Zooming (in and out) (@MuadDib)
This commit is contained in:
parent
dad5ed29f7
commit
7578e39d67
3 changed files with 12 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue