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] 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. ///