Пример #1
0
        public override void BuildInput(ClientInput input)
        {
            if (thirdperson_orbit && input.Down(InputButton.Walk))
            {
                if (input.Down(InputButton.Attack1))
                {
                    orbitDistance += input.AnalogLook.pitch;
                    orbitDistance  = orbitDistance.Clamp(0, 1000);
                }
                else
                {
                    orbitAngles.yaw   += input.AnalogLook.yaw;
                    orbitAngles.pitch += input.AnalogLook.pitch;
                    orbitAngles        = orbitAngles.Normal;
                    orbitAngles.pitch  = orbitAngles.pitch.Clamp(-89, 89);
                }

                input.AnalogLook = Angles.Zero;

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

            base.BuildInput(input);
        }
Пример #2
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;
        }