Exemple #1
0
        public override void BuildInput(ClientInput input)
        {
            MoveInput = input.AnalogMove;

            MoveSpeed = 1;
            if (input.Down(InputButton.Run))
            {
                MoveSpeed = 5;
            }
            if (input.Down(InputButton.Duck))
            {
                MoveSpeed = 0.2f;
            }

            if (input.Pressed(InputButton.Walk))
            {
                var tr = Trace.Ray(Pos, Pos + Rot.Forward * 4096).Run();
                PivotPos  = tr.EndPos;
                PivotDist = Vector3.DistanceBetween(tr.EndPos, Pos);
            }

            if (input.Down(InputButton.Use))
            {
                DoFBlurSize = Math.Clamp(DoFBlurSize + (Time.Delta * 3.0f), 0.0f, 100.0f);
            }

            if (input.Down(InputButton.Menu))
            {
                DoFBlurSize = Math.Clamp(DoFBlurSize - (Time.Delta * 3.0f), 0.0f, 100.0f);
            }


            if (input.Down(InputButton.Attack2))
            {
                FovOverride     += input.AnalogLook.pitch * (FovOverride / 30.0f);
                FovOverride      = FovOverride.Clamp(5, 150);
                input.AnalogLook = default;
            }

            LookAngles     += input.AnalogLook * (FovOverride / 80.0f);
            LookAngles.roll = 0;

            PivotEnabled = input.Down(InputButton.Walk);

            if (input.Pressed(InputButton.Reload))
            {
                Overlays = !Overlays;
            }

            input.Clear();
            input.StopProcessing = true;
        }