mirror of
https://github.com/Raicuparta/nomai-vr.git
synced 2025-12-11 20:15:08 +01:00
* Added Snap Turning - Disabled by default, can be enabled in settings - Amount per input can be defined in settings (current range is 15 - 90 degrees) - Default input action is the right thumb stick (same as smooth turn) * Moved snap turn from slider to selector for settings * Fixed snap turning with smooth HUD/Helmet - Previously, the smooth HUD/Helmet would uncomfortably move a long distance after you snap turn - Now, if smooth HUD and snap turning are both enabled, the helmet snap turns for a frame, then resumes it's previous behavior * Disable snap turning while in zero-g --------- Co-authored-by: Raicuparta <Raicuparta@users.noreply.github.com>
54 lines
2.4 KiB
C#
54 lines
2.4 KiB
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace NomaiVR.ModConfig
|
|
{
|
|
public static class ModSettings
|
|
{
|
|
public static event Action OnConfigChange;
|
|
private static IModSettingProvider settingsProvider;
|
|
|
|
public static bool LeftHandDominant => settingsProvider.LeftHandDominant;
|
|
public static bool DebugMode => settingsProvider.DebugMode;
|
|
public static bool PreventCursorLock => settingsProvider.PreventCursorLock;
|
|
public static bool ShowHelmet => settingsProvider.ShowHelmet;
|
|
public static float VibrationStrength => settingsProvider.VibrationStrength;
|
|
public static bool EnableGesturePrompts => settingsProvider.EnableGesturePrompts;
|
|
public static bool EnableHandLaser => settingsProvider.EnableHandLaser;
|
|
public static bool EnableFeetMarker => settingsProvider.EnableFeetMarker;
|
|
public static bool PreventClipping => settingsProvider.PreventClipping;
|
|
public static bool FlashlightGesture => settingsProvider.FlashlightGesture;
|
|
public static bool ControllerOrientedMovement => settingsProvider.ControllerOrientedMovement;
|
|
public static bool SnapTurning => settingsProvider.SnapTurning;
|
|
public static string SnapTurnIncrement => settingsProvider.SnapTurnIncrement;
|
|
public static bool AutoHideToolbelt => settingsProvider.AutoHideToolbelt;
|
|
public static float ToolbeltHeight => settingsProvider.ToolbeltHeight;
|
|
public static float HudScale => settingsProvider.HudScale;
|
|
public static float HudOpacity => settingsProvider.HudOpacity;
|
|
public static float MarkersOpacity => settingsProvider.MarkersOpacity;
|
|
public static float LookArrowOpacity => settingsProvider.LookArrowOpacity;
|
|
public static bool HudSmoothFollow => settingsProvider.HudSmoothFollow;
|
|
|
|
public static void SetProvider(IModSettingProvider provider)
|
|
{
|
|
if (settingsProvider != null) settingsProvider.OnConfigChange -= OnConfigChanged;
|
|
|
|
settingsProvider = provider;
|
|
|
|
provider.OnConfigChange += OnConfigChanged;
|
|
provider.Configure();
|
|
|
|
if (PreventCursorLock)
|
|
{
|
|
Cursor.lockState = CursorLockMode.None;
|
|
Cursor.visible = true;
|
|
}
|
|
}
|
|
|
|
private static void OnConfigChanged()
|
|
{
|
|
OnConfigChange?.Invoke();
|
|
}
|
|
}
|
|
}
|