Skip to content

Commit

Permalink
Add small cursor patches
Browse files Browse the repository at this point in the history
  • Loading branch information
DaXcess committed Sep 2, 2024
1 parent a462d01 commit 65f166d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Docs/Thunderstore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Here is a list of LCVR versions and which version(s) of Lethal Company it suppor

| LCVR | Lethal Company |
|-------------------|-------------------|
| v1.3.2 *(LATEST)* | V62 |
| v1.3.2 *(LATEST)* | V64 |
| v1.3.1 | V62 |
| v1.3.0 | V56 |
| v1.2.5 | V50 |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Here is a list of LCVR versions and which version(s) of Lethal Company it suppor

| LCVR | Lethal Company |
|-------------------|-------------------|
| v1.3.2 *(BETA)* | V62 |
| v1.3.2 *(BETA)* | V64 *(BETA)* |
| v1.3.1 *(LATEST)* | V62 |
| v1.3.0 | V56 |
| v1.2.5 | V50 |
Expand Down
29 changes: 29 additions & 0 deletions Source/Patches/CursorPatches.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using HarmonyLib;
using UnityEngine;

namespace LCVR.Patches;

[LCVRPatch]
[HarmonyPatch]
internal static class CursorPatches
{
/// <summary>
/// Prevent the cursor from showing up when playing in VR
/// </summary>
[HarmonyPatch(typeof(Cursor), nameof(Cursor.visible), MethodType.Setter)]
[HarmonyPrefix]
private static void PatchCursorVisibility(ref bool value)
{
value = false;
}

/// <summary>
/// Prevent the cursor from getting locked when playing in VR
/// </summary>
[HarmonyPatch(typeof(Cursor), nameof(Cursor.lockState), MethodType.Setter)]
[HarmonyPrefix]
private static void PatchCursorLockState(ref CursorLockMode value)
{
value = CursorLockMode.None;
}
}

0 comments on commit 65f166d

Please sign in to comment.