#define SIMPLE_KEYBOARD_LAYER using SharpPluginLoader.Core.Configuration; using SharpPluginLoader.Core.IO; namespace NewCamera { internal class Config : IConfig { public String Name => "NewCamera"; public String Version => "4.0"; public const float DEFAULT_FOV = 60.0f; public const float DEFAULT_NEAR_CLIP = 16.0f; public struct Settings { public const float DEFAULT_SPEED = 5.35f; public const float DEFAULT_SPEED_MODIFIER = 0.40f; public const float DEFAULT_SENSITIVITY = 0.0425f; public const float DEFAULT_ZOOM_SPEED = 0.02f; public const float DEFAULT_PITCH_LIMIT = -1.0f; public const float MAX_PITCH_LIMIT = 89.95f; public const int DEFAULT_DEADZONE = 4750; public const float DEFAULT_ALT_NEAR_CLIP = 0.3f; public Settings() { Speed = DEFAULT_SPEED; SpeedModifier = DEFAULT_SPEED_MODIFIER; Sensitivity = DEFAULT_SENSITIVITY; ZoomSpeed = DEFAULT_ZOOM_SPEED; PitchLimit = DEFAULT_PITCH_LIMIT; StickDeadzone = DEFAULT_DEADZONE; AlternateNearClip = DEFAULT_ALT_NEAR_CLIP; } public float Speed { get; set; } public float SpeedModifier { get; set; } public float Sensitivity { get; set; } public float ZoomSpeed { get; set; } public float PitchLimit { get; set; } public int StickDeadzone { get; set; } public float AlternateNearClip { get; set; } public struct Binds { public Binds() { EnableCombo = true; FreeCameraCombo = "RStick,LT"; DisableComboButton1UnlessButton2Held = false; #if SIMPLE_KEYBOARD_LAYER EnableMouse = true; MouseSensitivity = 0.0225f; EnableKeyboard = true; KeyboardLookSensitivity = 19750; #endif } public bool EnableCombo { get; set; } public String FreeCameraCombo { get; set; } public bool DisableComboButton1UnlessButton2Held { get; set; } #if SIMPLE_KEYBOARD_LAYER public bool EnableMouse { get; set; } public float MouseSensitivity { get; set; } public bool EnableKeyboard { get; set; } public int KeyboardLookSensitivity { get; set; } #endif } } public struct Preset { public float FieldOfView { get; set; } public float Roll { get; set; } public float Forward { get; set; } public float Right { get; set; } public float Up { get; set; } public bool DisableFading { get; set; } } public static Preset DefaultPreset = new Preset() { FieldOfView = DEFAULT_FOV, Roll = 0.0f, Forward = 0.0f, Right = 0.0f, Up = 0.0f, DisableFading = false }; public struct Position { public float FieldOfView { get; set; } public float Roll { get; set; } public float PosX { get; set; } public float PosY { get; set; } public float PosZ { get; set; } public float TargetX { get; set; } public float TargetY { get; set; } public float TargetZ { get; set; } } private static Dictionary buttonMap = new Dictionary { { "r1", Button.R1 }, { "rb", Button.R1 }, { "r2", Button.R2 }, { "rt", Button.R2 }, { "r3", Button.R3 }, { "rstick", Button.R3 }, { "l1", Button.L1 }, { "lb", Button.L1 }, { "l2", Button.L2 }, { "lt", Button.L2 }, { "l3", Button.L3 }, { "lstick", Button.L3 }, { "a", Button.Cross }, { "cross", Button.Cross }, { "b", Button.Circle }, { "circle", Button.Circle }, { "x", Button.Square }, { "square", Button.Square }, { "y", Button.Triangle }, { "triangle", Button.Triangle }, { "start", Button.Options }, { "options", Button.Options }, { "select", Button.Share }, { "share", Button.Share }, { "up", Button.Up }, { "down", Button.Down }, { "left", Button.Left }, { "right", Button.Right } }; public static Button[]? ParseCombo(String comboString) { string[] buttonStrings = comboString.Split(","); if (buttonStrings.Length == 2) { string b1 = buttonStrings[0].ToLower(); string b2 = buttonStrings[1].ToLower(); if (buttonMap.ContainsKey(b1) && buttonMap.ContainsKey(b2)) { return [ buttonMap[b1], buttonMap[b2] ]; } } return null; } public bool DisableMod { get; set; } = false; public bool TuningToolInterop { get; set; } = true; public bool OverrideViewMode { get; set; } = false; public Settings Camera { get; set; } = new Settings(); public Settings.Binds Binds { get; set; } = new Settings.Binds(); public bool PerspectiveCameraEnabled { get; set; } = false; public Dictionary Presets { get; set; } = new Dictionary(); public String Selected { get; set; } = ""; public Dictionary Positions { get; set; } = new Dictionary(); } }