mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
[ThirdPerson] Prevent scrolling when holding CTRL
This commit is contained in:
parent
84a096bc8e
commit
1025c5667c
3 changed files with 13 additions and 10 deletions
|
@ -18,14 +18,17 @@ public class ThirdPerson : MelonMod
|
|||
|
||||
public override void OnUpdate()
|
||||
{
|
||||
// Prevents scrolling while in Menus or UnityExplorer
|
||||
if (State && Cursor.lockState == CursorLockMode.Locked)
|
||||
// Prevents scrolling while using Effector/BetterInteractDesktop
|
||||
if (!Input.GetKey(KeyCode.LeftControl))
|
||||
{
|
||||
float scroll = Input.GetAxis("Mouse ScrollWheel");
|
||||
if (scroll != 0f) ScrollDist(Mathf.Sign(scroll));
|
||||
// Prevents scrolling while in Menus or UnityExplorer
|
||||
if (State && Cursor.lockState == CursorLockMode.Locked)
|
||||
{
|
||||
float scroll = Input.GetAxis("Mouse ScrollWheel");
|
||||
if (scroll != 0f) ScrollDist(Mathf.Sign(scroll));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Input.GetKey(KeyCode.LeftControl)) return;
|
||||
if (Input.GetKeyDown(KeyCode.T)) State = !State;
|
||||
if (!State || !Input.GetKeyDown(KeyCode.Y)) return;
|
||||
RelocateCam((CameraLocation)(((int)CurrentLocation + (Input.GetKey(KeyCode.LeftShift) ? -1 : 1) + Enum.GetValues(typeof(CameraLocation)).Length) % Enum.GetValues(typeof(CameraLocation)).Length), true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue