Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
108 changes: 102 additions & 6 deletions engine/Sandbox.Tools/EditorPreferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public static NotificationLevel CompileNotifications
set => EditorCookie.Set( "CompileNotifications", value );
}


/// <summary>
/// The amount of seconds to keep a notification open if it's an error
/// </summary>
Expand Down Expand Up @@ -148,12 +149,13 @@ public static bool InvertOrbitZoom
/// <summary>
/// How fast should the orbit camera zoom?
/// </summary>
[Title( "Orbit Zoom Speed" )]
[Range( 0.0f, 10.0f )]
public static float OrbitZoomSpeed
[Title( "Zoom Speed" )]
[Description( "Scroll Wheel Zoom" )]
[Range( 0.1f, 2.0f )]
public static float ScrollZoomSpeed
{
get => EditorCookie.Get( "SceneView.OrbitZoomSpeed", 1.0f );
set => EditorCookie.Set( "SceneView.OrbitZoomSpeed", value );
get => EditorCookie.Get( "SceneView.ScrollZoomSpeed", 1.0f );
set => EditorCookie.Set( "SceneView.ScrollZoomSpeed", value );
}

/// <summary>
Expand Down Expand Up @@ -236,6 +238,96 @@ public static bool UndoSounds
set => EditorCookie.Set( "UndoSounds", value );
}

//GENERAL -----------------
public enum NavigationStyleList
{
[Description( "Orbit: Middle Click\nPan: Shift + Middle Click\nZoom: Cntrl + Middle Click" )]
Blender,
[Description( "Orbit: Alt + Left Click\nPan: Alt + Middle Click\nZoom: Alt + Right Click" )]
Maya,
[Description( "Orbit: Alt + Left Click\nPan: Alt + Middle Click\nZoom: Alt + Right Click" )]
Cinema4D
}

public static NavigationStyleList NavigationStyle
{
get => EditorCookie.Get( "NavigationStyle", NavigationStyleList.Blender );
set => EditorCookie.Set( "NavigationStyle", value );
}

[Title( "Hide Cursor" )]
public static bool CameraCursor
{
get => EditorCookie.Get( "CameraCursor", false );
set => EditorCookie.Set( "CameraCursor", value );
}

//ORBIT -------------------
//Invert
[Title( "Invert Orbit X" )]
public static bool OrbitInvertHorizontal
{
get => EditorCookie.Get( "OrbitInvertHorizontal", true );
set => EditorCookie.Set( "OrbitInvertHorizontal", value );
}

[Title( "Invert Orbit Y" )]
public static bool OrbitInvertVertical
{
get => EditorCookie.Get( "OrbitInvertVertical", true );
set => EditorCookie.Set( "OrbitInvertVertical", value );
}

//Sensitivity
[Title( "Orbit sensitivity" )]
[Range( 0.1f, 2.0f )]
public static float OrbitSensitivity
{
get => EditorCookie.Get( "OrbitSensitivity", 1.0f );
set => EditorCookie.Set( "OrbitSensitivity", value );
}

//PAN ---------------------
[Title( "Invert Pan X" )]
public static bool PanInvertHorizontal
{
get => EditorCookie.Get( "PanInvertHorizontal", false );
set => EditorCookie.Set( "PanInvertHorizontal", value );
}

[Title( "Invert Pan Y" )]
public static bool PanInvertVertical
{
get => EditorCookie.Get( "PanInvertVertical", false );
set => EditorCookie.Set( "PanInvertVertical", value );
}

//Sensitivity
[Title( "Pan sensitivity" )]
[Range( 0.1f, 2.0f )]
public static float PanSensitivity
{
get => EditorCookie.Get( "PanSensitivity", 1f );
set => EditorCookie.Set( "PanSensitivity", value );
}

//ZOOM --------------------
[Title( "Invert Zoom" )]
public static bool ZoomInvert
{
get => EditorCookie.Get( "ZoomInvert", false );
set => EditorCookie.Set( "ZoomInvert", value );
}

//Sensitivity
[Title( "Zoom sensitivity" )]
[Range( 0.1f, 2.0f )]
public static float ZoomSensitivity
{
get => EditorCookie.Get( "ZoomSensitivity", 1.0f );
set => EditorCookie.Set( "ZoomSensitivity", value );
}

/// <summary>
/// Overrides for any Editor shortcuts.
/// </summary>
Expand All @@ -247,12 +339,16 @@ public static Dictionary<string, string> ShortcutOverrides
{
var json = EditorCookie.GetString( "KeybindOverrides", null );
if ( string.IsNullOrEmpty( json ) )
{
_shortcutOverrides = new Dictionary<string, string>();
}
else
{
_shortcutOverrides = Json.Deserialize<Dictionary<string, string>>( json );
if ( _shortcutOverrides is null )
{
_shortcutOverrides = new Dictionary<string, string>();
}
}
}
return _shortcutOverrides;
Expand All @@ -264,7 +360,7 @@ public static Dictionary<string, string> ShortcutOverrides
}
}

static Dictionary<string, string> _shortcutOverrides;
private static Dictionary<string, string> _shortcutOverrides;

/// <summary>
/// Whether new game instances spawned by the editor are in windowed mode.
Expand Down
Loading
Loading