From 23e94a259b9d18c8fc07c2e89c6558d2eae9452b Mon Sep 17 00:00:00 2001 From: HosRa <58400704+HosRa@users.noreply.github.com> Date: Thu, 5 Aug 2021 12:20:31 +0200 Subject: [PATCH 1/3] Create new option for open method window --- Source/Editor/GUI/Docking/DockWindow.cs | 2 +- Source/Editor/Options/InterfaceOptions.cs | 45 +++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/Source/Editor/GUI/Docking/DockWindow.cs b/Source/Editor/GUI/Docking/DockWindow.cs index 1a28b1307..058e7266c 100644 --- a/Source/Editor/GUI/Docking/DockWindow.cs +++ b/Source/Editor/GUI/Docking/DockWindow.cs @@ -241,7 +241,7 @@ namespace FlaxEditor.GUI.Docking /// public void FocusOrShow() { - FocusOrShow(DockState.Float); + FocusOrShow((DockState)Editor.Instance.Options.Options.Interface.DockNewWindow); } /// diff --git a/Source/Editor/Options/InterfaceOptions.cs b/Source/Editor/Options/InterfaceOptions.cs index 121361a2c..5d7719fd8 100644 --- a/Source/Editor/Options/InterfaceOptions.cs +++ b/Source/Editor/Options/InterfaceOptions.cs @@ -1,6 +1,8 @@ // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved. using System.ComponentModel; +using System.Net.Sockets; +using FlaxEditor.GUI.Docking; using FlaxEngine; namespace FlaxEditor.Options @@ -36,6 +38,42 @@ namespace FlaxEditor.Options /// TimeSinceStartup, } + + /// + /// A proxy DockState for window open method. + /// + public enum DockStateProxy + { + /// + /// The floating window. + /// + Float = DockState.Float, + + /// + /// The dock fill as a tab. + /// + DockFill = DockState.DockFill, + + /// + /// The dock left. + /// + DockLeft = DockState.DockLeft, + + /// + /// The dock right. + /// + DockRight = DockState.DockRight, + + /// + /// The dock top. + /// + DockTop = DockState.DockTop, + + /// + /// The dock bottom. + /// + DockBottom = DockState.DockBottom + } /// /// Gets or sets the Editor User Interface scale. Applied to all UI elements, windows and text. Can be used to scale the interface up on a bigger display. Editor restart required. @@ -69,6 +107,13 @@ namespace FlaxEditor.Options [EditorDisplay("Interface", "Center Mouse On Game Window Focus"), EditorOrder(100), Tooltip("Determines whether center mouse position on window focus in play mode. Helps when working with games that lock mouse cursor.")] public bool CenterMouseOnGameWinFocus { get; set; } = false; + /// + /// Gets or sets the method window opening. + /// + [DefaultValue(DockStateProxy.Float)] + [EditorDisplay("Interface", "Define The Method Window Opening"), EditorOrder(150), Tooltip("Define the opening method for windows, open a in new tab by default.")] + public DockStateProxy DockNewWindow { get; set; } = DockStateProxy.Float; + /// /// Gets or sets the timestamps prefix mode for debug log messages. /// From b4d879960fa35547ba5d9570be34270097e66075 Mon Sep 17 00:00:00 2001 From: thallard Date: Thu, 5 Aug 2021 12:42:46 +0200 Subject: [PATCH 2/3] Remove unused import --- Source/Editor/Options/InterfaceOptions.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/Editor/Options/InterfaceOptions.cs b/Source/Editor/Options/InterfaceOptions.cs index 5d7719fd8..9ed39b3b9 100644 --- a/Source/Editor/Options/InterfaceOptions.cs +++ b/Source/Editor/Options/InterfaceOptions.cs @@ -1,7 +1,6 @@ // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved. using System.ComponentModel; -using System.Net.Sockets; using FlaxEditor.GUI.Docking; using FlaxEngine; From a64d23b8ed34e38df6f4e7b4bec2e46823040190 Mon Sep 17 00:00:00 2001 From: thallard Date: Thu, 5 Aug 2021 12:46:29 +0200 Subject: [PATCH 3/3] Some tweaks --- Source/Editor/GUI/Docking/DockWindow.cs | 2 +- Source/Editor/Options/InterfaceOptions.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Editor/GUI/Docking/DockWindow.cs b/Source/Editor/GUI/Docking/DockWindow.cs index 058e7266c..0d58c00a5 100644 --- a/Source/Editor/GUI/Docking/DockWindow.cs +++ b/Source/Editor/GUI/Docking/DockWindow.cs @@ -241,7 +241,7 @@ namespace FlaxEditor.GUI.Docking /// public void FocusOrShow() { - FocusOrShow((DockState)Editor.Instance.Options.Options.Interface.DockNewWindow); + FocusOrShow((DockState)Editor.Instance.Options.Options.Interface.NewWindowMethod); } /// diff --git a/Source/Editor/Options/InterfaceOptions.cs b/Source/Editor/Options/InterfaceOptions.cs index 9ed39b3b9..eb0e0e762 100644 --- a/Source/Editor/Options/InterfaceOptions.cs +++ b/Source/Editor/Options/InterfaceOptions.cs @@ -110,8 +110,8 @@ namespace FlaxEditor.Options /// Gets or sets the method window opening. /// [DefaultValue(DockStateProxy.Float)] - [EditorDisplay("Interface", "Define The Method Window Opening"), EditorOrder(150), Tooltip("Define the opening method for windows, open a in new tab by default.")] - public DockStateProxy DockNewWindow { get; set; } = DockStateProxy.Float; + [EditorDisplay("Interface", "Define The Opening Window Method"), EditorOrder(150), Tooltip("Define the opening method for new windows, open in a new tab by default.")] + public DockStateProxy NewWindowMethod { get; set; } = DockStateProxy.Float; /// /// Gets or sets the timestamps prefix mode for debug log messages.