Add saving and loading of cached values for camera settings

* remove "Default" from all settings in ViewportOptions as they are shown in the "Defaults" group anyway
This commit is contained in:
Christopher Rothert
2023-10-04 22:19:48 +02:00
parent a280ce3dc7
commit ccf37e9d68
2 changed files with 69 additions and 26 deletions

View File

@@ -24,83 +24,83 @@ namespace FlaxEditor.Options
[DefaultValue(1.0f), Limit(0.01f, 100.0f)]
[EditorDisplay("General"), EditorOrder(101), Tooltip("The mouse wheel sensitivity applied to zoom in orthographic mode.")]
public float MouseWheelSensitivity { get; set; } = 1.0f;
/// <summary>
/// Gets or sets the default movement speed for the viewport camera (must be in range between minimum and maximum movement speed values).
/// </summary>
[DefaultValue(1.0f), Limit(0.05f, 64.0f)]
[EditorDisplay("Defaults"), EditorOrder(110), Tooltip("The default movement speed for the viewport camera (must be in range between minimum and maximum movement speed values).")]
public float DefaultMovementSpeed { get; set; } = 1.0f;
public float MovementSpeed { get; set; } = 1.0f;
/// <summary>
/// Gets or sets the default minimum camera movement speed.
/// </summary>
[DefaultValue(0.05f), Limit(0.05f, 64.0f)]
[EditorDisplay("Defaults"), EditorOrder(111), Tooltip("The default minimum movement speed for the viewport camera.")]
public float DefaultMinMovementSpeed { get; set; } = 0.05f;
public float MinMovementSpeed { get; set; } = 0.05f;
/// <summary>
/// Gets or sets the default maximum camera movement speed.
/// </summary>
[DefaultValue(64.0f), Limit(32.0f, 1000.0f)]
[EditorDisplay("Defaults"), EditorOrder(112), Tooltip("The default maximum movement speed for the viewport camera.")]
public float DefaultMaxMovementSpeed { get; set; } = 64f;
public float MaxMovementSpeed { get; set; } = 64f;
/// <summary>
/// Gets or sets the default near clipping plane distance for the viewport camera.
/// </summary>
[DefaultValue(10.0f), Limit(0.001f, 1000.0f)]
[EditorDisplay("Defaults"), EditorOrder(130), Tooltip("The default near clipping plane distance for the viewport camera.")]
public float DefaultNearPlane { get; set; } = 10.0f;
public float NearPlane { get; set; } = 10.0f;
/// <summary>
/// Gets or sets the default far clipping plane distance for the viewport camera.
/// </summary>
[DefaultValue(40000.0f), Limit(10.0f)]
[EditorDisplay("Defaults"), EditorOrder(140), Tooltip("The default far clipping plane distance for the viewport camera.")]
public float DefaultFarPlane { get; set; } = 40000.0f;
public float FarPlane { get; set; } = 40000.0f;
/// <summary>
/// Gets or sets the default field of view angle (in degrees) for the viewport camera.
/// </summary>
[DefaultValue(60.0f), Limit(35.0f, 160.0f, 0.1f)]
[EditorDisplay("Defaults"), EditorOrder(150), Tooltip("The default field of view angle (in degrees) for the viewport camera.")]
public float DefaultFieldOfView { get; set; } = 60.0f;
public float FieldOfView { get; set; } = 60.0f;
/// <summary>
/// Gets or sets the default camera orthographic mode.
/// </summary>
[DefaultValue(false)]
[EditorDisplay("Defaults"), EditorOrder(160), Tooltip("The default camera orthographic mode.")]
public bool DefaultOrthographicProjection { get; set; } = false;
public bool OrthographicProjection { get; set; } = false;
/// <summary>
/// Gets or sets the default camera orthographic scale (if camera uses orthographic mode).
/// </summary>
[DefaultValue(5.0f), Limit(0.001f, 100000.0f, 0.1f)]
[EditorDisplay("Defaults"), EditorOrder(170), Tooltip("The default camera orthographic scale (if camera uses orthographic mode).")]
public float DefaultOrthographicScale { get; set; } = 5.0f;
public float OrthographicScale { get; set; } = 5.0f;
/// <summary>
/// Gets or sets the default panning direction for the viewport camera.
/// </summary>
[DefaultValue(false)]
[EditorDisplay("Defaults"), EditorOrder(180), Tooltip("The default panning direction for the viewport camera.")]
public bool DefaultInvertPanning { get; set; } = false;
public bool InvertPanning { get; set; } = false;
/// <summary>
/// Gets or sets the default relative panning mode.
/// </summary>
[DefaultValue(true)]
[EditorDisplay("Defaults"), EditorOrder(190), Tooltip("The default relative panning mode. Uses distance between camera and target to determine panning speed.")]
public bool DefaultRelativePanning { get; set; } = true;
public bool RelativePanning { get; set; } = true;
/// <summary>
/// Gets or sets the default panning speed (ignored if relative panning is speed enabled).
/// </summary>
[DefaultValue(0.8f), Limit(0.01f, 128.0f, 0.1f)]
[EditorDisplay("Defaults"), EditorOrder(200), Tooltip("The default camera panning speed (ignored if relative panning is enabled).")]
public float DefaultPanningSpeed { get; set; } = 0.8f;
public float PanningSpeed { get; set; } = 0.8f;
/// <summary>
/// Gets or sets the default editor viewport grid scale.