From eac553a992da6953b73fcb83c350f993ba72be76 Mon Sep 17 00:00:00 2001 From: rkrahn Date: Sun, 10 Mar 2024 13:49:14 -0700 Subject: [PATCH] Add toggle orthographic view hotkey Adds the Toggle Orthographic hotkey to the editor. Bound to 'NumpadDecimal' by default. --- Source/Editor/Options/InputOptions.cs | 4 ++++ Source/Editor/Viewport/EditorViewport.cs | 1 + 2 files changed, 5 insertions(+) diff --git a/Source/Editor/Options/InputOptions.cs b/Source/Editor/Options/InputOptions.cs index 9bd556f20..211e8e54f 100644 --- a/Source/Editor/Options/InputOptions.cs +++ b/Source/Editor/Options/InputOptions.cs @@ -320,6 +320,10 @@ namespace FlaxEditor.Options [EditorDisplay("Viewport"), EditorOrder(1750)] public InputBinding ViewpointBottom = new InputBinding(KeyboardKeys.Numpad2); + [DefaultValue(typeof(InputBinding), "NumpadDecimal")] + [EditorDisplay("Viewport"), EditorOrder(1760)] + public InputBinding ToggleOrthographic = new InputBinding(KeyboardKeys.NumpadDecimal); + #endregion #region Interface diff --git a/Source/Editor/Viewport/EditorViewport.cs b/Source/Editor/Viewport/EditorViewport.cs index 785f0e651..fd7a83164 100644 --- a/Source/Editor/Viewport/EditorViewport.cs +++ b/Source/Editor/Viewport/EditorViewport.cs @@ -998,6 +998,7 @@ namespace FlaxEditor.Viewport InputActions.Add(options => options.CameraToggleRotation, () => _isVirtualMouseRightDown = !_isVirtualMouseRightDown); InputActions.Add(options => options.CameraIncreaseMoveSpeed, () => AdjustCameraMoveSpeed(1)); InputActions.Add(options => options.CameraDecreaseMoveSpeed, () => AdjustCameraMoveSpeed(-1)); + InputActions.Add(options => options.ToggleOrthographic, () => OnOrthographicModeToggled(null)); // Link for task event task.Begin += OnRenderBegin;