Add mouse sensitivity cvar, devconfig.cfg

This commit is contained in:
2025-03-20 22:09:08 +02:00
parent e6270ff541
commit 28b73be6c1
6 changed files with 74 additions and 12 deletions

View File

@@ -50,6 +50,9 @@ public class PlayerInput2 : IPlayerInput
/// </summary>
private PlayerInputState2 _recordState;
[ConsoleVariable("sensitivity")]
public static float Sensitivity;
public void SetFrame(ulong frame)
{
}
@@ -60,11 +63,11 @@ public class PlayerInput2 : IPlayerInput
// or taken with the peak values (axis direction),
// binary values should be OR'ed so triggered action is not lost if button debounces mid-frame.
float sensitivity = 1.0f / 8.0f;
sensitivity = 1.0f;
//float sensitivity = 1.0f / 8.0f;
//sensitivity = 1.0f;
float turnSpeed = 100.0f;
_recordState.ViewDelta += new Float2(Input.GetAxisRaw("Mouse X"), Input.GetAxisRaw("Mouse Y")) * sensitivity;
_recordState.ViewDelta += new Float2(Input.GetAxisRaw("Mouse X"), Input.GetAxisRaw("Mouse Y")) * Sensitivity;
_recordState.ViewDelta += new Float2(Input.GetAxisRaw("LookRight"), Input.GetAxisRaw("LookUp")) * Time.DeltaTime * turnSpeed;
_recordState.MoveForward = MathF.MaxMagnitude(_recordState.MoveForward, Input.GetAxis("Vertical"));