summaryrefslogtreecommitdiff
path: root/Config.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Config.cs')
-rwxr-xr-xConfig.cs69
1 files changed, 57 insertions, 12 deletions
diff --git a/Config.cs b/Config.cs
index 59eb76a..f40a76c 100755
--- a/Config.cs
+++ b/Config.cs
@@ -5,21 +5,14 @@ namespace MHWNewCamera
{
internal class Config : IConfig
{
- public struct Binds
- {
- public Binds()
- {
- }
- }
-
public struct Settings
{
public const float DEFAULT_SPEED = 3.00f;
public const float DEFAULT_ZOOM_SPEED = 1.0f;
public const float DEFAULT_SPEED_MODIFIER = 0.25f;
public const float DEFAULT_SENSITIVITY = 1.95f;
+ public const double DEFAULT_PITCH_LIMIT = -1.0;
public const int DEFAULT_DEADZONE = 4750;
- public const double DEFAULT_PITCH_LIMIT = 88.25;
public Settings()
{
@@ -27,33 +20,85 @@ namespace MHWNewCamera
CameraZoomSpeed = DEFAULT_ZOOM_SPEED;
CameraSpeedModifier = DEFAULT_SPEED_MODIFIER;
CameraSensitivity = DEFAULT_SENSITIVITY;
- StickDeadzone = DEFAULT_DEADZONE;
CameraPitchLimit = DEFAULT_PITCH_LIMIT;
+ StickDeadzone = DEFAULT_DEADZONE;
}
public float CameraSpeed { get; set; }
public float CameraZoomSpeed { get; set; }
public float CameraSpeedModifier { get; set; }
public float CameraSensitivity { get; set; }
- public int StickDeadzone { get; set; }
public double CameraPitchLimit { get; set; }
+ public int StickDeadzone { get; set; }
}
public struct Preset
{
public double FOV { get; set; }
public float Forward { get; set; }
- public float Left { get; set; }
+ public float Right { get; set; }
public float Up { get; set; }
public double Roll { get; set; }
}
+ public struct SavedPosition
+ {
+ 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; }
+ public double Roll { get; set; }
+ }
+
public String Name => "MHWNewCamera";
- public String Version => "1.1";
+ public String Version => "1.2";
+
+ private static Dictionary<string, Button> buttonMap = new Dictionary<string, Button>
+ {
+ { "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 EnableCombo { get; set; } = true;
+ public String FreeCameraCombo { get; set; } = "RStick,LT";
public Settings CameraSettings { get; set; } = new Settings();
public bool PerspectiveCameraEnabled { get; set; } = false;
public Dictionary<String, Preset> Presets { get; set; } = new Dictionary<String, Preset>();
public String Selected { get; set; } = "";
+ public Dictionary<String, SavedPosition> Positions { get; set; } = new Dictionary<String, SavedPosition>();
}
}