Add options to remove the look arrow, camera recentering, and the flashlight gesture (#512)

* Added option to remove look arrow

* Added option to disable moving the camera for preventing clipping

* Added option to disable the flashlight gesture

* Revert solution file versions

Co-authored-by: artum <jacopo.libe@gmail.com>
This commit is contained in:
12090113 2022-06-29 08:23:51 -07:00 committed by GitHub
parent fd45fe1171
commit 556f177969
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 40 additions and 3 deletions

View File

@ -14,6 +14,9 @@ namespace NomaiVR.ModConfig
bool EnableGesturePrompts { get; }
bool EnableHandLaser { get; }
bool EnableFeetMarker { get; }
bool EnableLookArrow { get; }
bool PreventClipping { get; }
bool FlashlightGesture { get; }
bool ControllerOrientedMovement { get; }
bool AutoHideToolbelt { get; }
float ToolbeltHeight { get; }

View File

@ -16,6 +16,9 @@ namespace NomaiVR.ModConfig
public static bool EnableGesturePrompts => settingsProvider.EnableGesturePrompts;
public static bool EnableHandLaser => settingsProvider.EnableHandLaser;
public static bool EnableFeetMarker => settingsProvider.EnableFeetMarker;
public static bool EnableLookArrow => settingsProvider.EnableLookArrow;
public static bool PreventClipping => settingsProvider.PreventClipping;
public static bool FlashlightGesture => settingsProvider.FlashlightGesture;
public static bool ControllerOrientedMovement => settingsProvider.ControllerOrientedMovement;
public static bool AutoHideToolbelt => settingsProvider.AutoHideToolbelt;
public static float ToolbeltHeight => settingsProvider.ToolbeltHeight;

View File

@ -15,6 +15,9 @@ namespace NomaiVR.ModConfig
public bool EnableGesturePrompts { get; private set; }
public bool EnableHandLaser { get; private set; }
public bool EnableFeetMarker { get; private set; }
public bool EnableLookArrow { get; private set; }
public bool PreventClipping { get; private set; }
public bool FlashlightGesture { get; private set; }
public bool ControllerOrientedMovement { get; private set; }
public bool AutoHideToolbelt { get; private set; }
public float ToolbeltHeight { get; private set; }
@ -37,6 +40,9 @@ namespace NomaiVR.ModConfig
EnableGesturePrompts = config.GetSettingsValue<bool>("showGesturePrompts");
EnableHandLaser = config.GetSettingsValue<bool>("showHandLaser");
EnableFeetMarker = config.GetSettingsValue<bool>("showFeetMarker");
EnableLookArrow = config.GetSettingsValue<bool>("showLookArrow");
FlashlightGesture = config.GetSettingsValue<bool>("flashlightGesture");
PreventClipping = config.GetSettingsValue<bool>("preventClipping");
DebugMode = config.GetSettingsValue<bool>("debug");
AutoHideToolbelt = config.GetSettingsValue<bool>("autoHideToolbelt");
HudScale = config.GetSettingsValue<float>("hudScale");

View File

@ -85,6 +85,27 @@
"yes": "Show",
"no": "Hide"
},
"showLookArrow": {
"type": "toggle",
"value": true,
"title": "Look arrow",
"yes": "Show",
"no": "Hide"
},
"preventClipping": {
"type": "toggle",
"value": true,
"title": "Prevent clipping",
"yes": "Enabled",
"no": "Disabled"
},
"flashlightGesture": {
"type": "toggle",
"value": true,
"title": "Flashlight gesture",
"yes": "Enabled",
"no": "Disabled"
},
"disableCursorLock": {
"type": "toggle",
"value": true,

View File

@ -89,7 +89,7 @@ namespace NomaiVR.Player
{
var cameraToHead = Vector3.ProjectOnPlane(PlayerHelper.PlayerHead.position - playerCamera.transform.position, PlayerHelper.PlayerHead.up);
if (cameraToHead.sqrMagnitude > 0.5f)
if ((cameraToHead.sqrMagnitude > 0.5f && ModSettings.PreventClipping) || cameraToHead.sqrMagnitude > 10f)
{
MoveCameraToPlayerHead();
}

View File

@ -4,6 +4,7 @@ using NomaiVR.ReusableBehaviours;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using NomaiVR.ModConfig;
namespace NomaiVR.Tools
{
@ -55,7 +56,9 @@ namespace NomaiVR.Tools
private void HandEnter(Transform hand)
{
ControllerInput.SimulateInput(InputConsts.InputCommandType.FLASHLIGHT);
if (ModSettings.FlashlightGesture) {
ControllerInput.SimulateInput(InputConsts.InputCommandType.FLASHLIGHT);
}
}
}
}

View File

@ -1,6 +1,7 @@
using System.Linq;
using NomaiVR.Assets;
using NomaiVR.Helpers;
using NomaiVR.ModConfig;
using UnityEngine;
namespace NomaiVR.UI
@ -64,7 +65,7 @@ namespace NomaiVR.UI
private void UpdateArrow()
{
if (target == null)
if (target == null || !ModSettings.EnableLookArrow)
{
HideArrow();
return;