mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 22:39:22 +00:00
SmartReticle: made work for VR reticle
This commit is contained in:
parent
dbdf4308c7
commit
e61049462b
2 changed files with 14 additions and 11 deletions
|
@ -65,15 +65,18 @@ public class SmartReticleMod : MelonMod
|
|||
if (!Entry_Enabled.Value)
|
||||
return;
|
||||
|
||||
if (!__instance.isDesktopRay)
|
||||
GameObject pointer;
|
||||
if (__instance.isDesktopRay) // in desktop mode
|
||||
pointer = CohtmlHud.Instance.desktopPointer;
|
||||
else if (__instance.isHeadRay) // in VR mode with no controllers
|
||||
pointer = __instance.backupCrossHair;
|
||||
else
|
||||
return;
|
||||
|
||||
GameObject desktopPointer = CohtmlHud.Instance.desktopPointer;
|
||||
|
||||
if (!desktopPointer.activeSelf)
|
||||
if (!pointer.activeSelf)
|
||||
{
|
||||
_lastDisplayedTime = 0; // reset time
|
||||
return; // pointing at menu or cursor is active
|
||||
return; // pointing at menu or cursor / controllers active
|
||||
}
|
||||
|
||||
bool shouldDisplayPointer = (__instance._interact // pressing mouse1 or mouse2
|
||||
|
@ -93,7 +96,7 @@ public class SmartReticleMod : MelonMod
|
|||
}
|
||||
|
||||
if (Time.time - _lastDisplayedTime > Entry_HideTimeout.Value)
|
||||
desktopPointer.SetActive(false);
|
||||
pointer.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue