using OWML.Common; using System; namespace NomaiVR.ModConfig { public class OwmlSettingsProvider : IModSettingProvider { public event Action OnConfigChange; public bool LeftHandDominant { get; private set; } public bool DebugMode { get; private set; } = true; public bool PreventCursorLock { get; private set; } public bool ShowHelmet { get; private set; } public float VibrationStrength { get; private set; } public bool EnableGesturePrompts { get; private set; } public bool EnableHandLaser { get; private set; } public bool EnableFeetMarker { get; private set; } public bool PreventClipping { get; private set; } public bool FlashlightGesture { get; private set; } public bool ControllerOrientedMovement { get; private set; } public bool SnapTurning { get; private set; } public string SnapTurnIncrement { get; private set; } public bool AutoHideToolbelt { get; private set; } public float ToolbeltHeight { get; private set; } public float HudScale { get; private set; } public float HudOpacity { get; private set; } public float MarkersOpacity { get; private set; } public float LookArrowOpacity { get; private set; } public bool HudSmoothFollow { get; private set; } = true; private readonly IModConfig config; public OwmlSettingsProvider(IModConfig config) { this.config = config; } public void Configure() { LeftHandDominant = config.GetSettingsValue("leftHandDominant"); VibrationStrength = config.GetSettingsValue("vibrationIntensity"); ShowHelmet = config.GetSettingsValue("helmetVisibility"); ControllerOrientedMovement = config.GetSettingsValue("movementControllerOriented"); SnapTurning = config.GetSettingsValue("snapTurning"); SnapTurnIncrement = config.GetSettingsValue("snapTurnIncrement"); EnableGesturePrompts = config.GetSettingsValue("showGesturePrompts"); EnableHandLaser = config.GetSettingsValue("showHandLaser"); EnableFeetMarker = config.GetSettingsValue("showFeetMarker"); FlashlightGesture = config.GetSettingsValue("flashlightGesture"); PreventClipping = config.GetSettingsValue("preventClipping"); DebugMode = config.GetSettingsValue("debug"); AutoHideToolbelt = config.GetSettingsValue("autoHideToolbelt"); HudScale = config.GetSettingsValue("hudScale"); HudSmoothFollow = config.GetSettingsValue("hudSmoothFollow"); PreventCursorLock = config.GetSettingsValue("disableCursorLock"); HudOpacity = config.GetSettingsValue("hudOpacity"); MarkersOpacity = config.GetSettingsValue("markersOpacity"); LookArrowOpacity = config.GetSettingsValue("lookArrowOpacity"); // OWML doesn't support negative slider values so I subtract it here. ToolbeltHeight = config.GetSettingsValue("toolbeltHeight") - 1f; OnConfigChange?.Invoke(); } } }