From eb6e3a7e8eba962223ebddb960749fe87ff1e009 Mon Sep 17 00:00:00 2001 From: W2Wizard <63303990+W2Wizard@users.noreply.github.com> Date: Sun, 13 Jun 2021 14:49:10 +0200 Subject: [PATCH 1/6] Replace clickable images with actual buttons With the new icons the clickable images for adding functions for the Visject surface got too small and unreadable. Instead using more visible buttons should counteract this. --- Source/Editor/EditorIcons.cs | 8 ++ .../Windows/Assets/VisualScriptWindow.cs | 77 ++++++++----------- 2 files changed, 38 insertions(+), 47 deletions(-) diff --git a/Source/Editor/EditorIcons.cs b/Source/Editor/EditorIcons.cs index d4b89b8d3..ff3164dcc 100644 --- a/Source/Editor/EditorIcons.cs +++ b/Source/Editor/EditorIcons.cs @@ -46,6 +46,10 @@ namespace FlaxEditor public SpriteHandle Down32; public SpriteHandle FolderClosed32; public SpriteHandle FolderOpen32; + public SpriteHandle FolderFill32; + public SpriteHandle Info32; + public SpriteHandle Warning32; + public SpriteHandle Error32; // Visject public SpriteHandle VisjectBoxOpen32; @@ -128,6 +132,10 @@ namespace FlaxEditor public SpriteHandle AndroidIcon128; public SpriteHandle PS4Icon128; public SpriteHandle FlaxLogo128; + public SpriteHandle SwitchIcon128; + public SpriteHandle SwitchSettings128; + public SpriteHandle Json128; + public SpriteHandle LocalizationSettings128; internal void LoadIcons() { diff --git a/Source/Editor/Windows/Assets/VisualScriptWindow.cs b/Source/Editor/Windows/Assets/VisualScriptWindow.cs index b9ddafa87..545f15867 100644 --- a/Source/Editor/Windows/Assets/VisualScriptWindow.cs +++ b/Source/Editor/Windows/Assets/VisualScriptWindow.cs @@ -167,6 +167,8 @@ namespace FlaxEditor.Windows.Assets /// public override DisplayStyle Style => DisplayStyle.InlineIntoParent; + private Control _overrideButton; + /// public override void Initialize(LayoutElementsContainer layout) { @@ -178,6 +180,21 @@ namespace FlaxEditor.Windows.Assets var group = layout.Group("Functions"); var nodes = window.VisjectSurface.Nodes; + var grid = group.CustomContainer(); + var gridControl = grid.CustomControl; + gridControl.ClipChildren = false; + gridControl.Height = Button.DefaultHeight; + gridControl.SlotsHorizontally = 2; + gridControl.SlotsVertically = 1; + + var addOverride = grid.Button("Add Override"); + addOverride.Button.Clicked += OnOverrideMethodClicked; + // TODO: Add sender arg to button clicked action? + _overrideButton = addOverride.Control; + + var addFuncction = grid.Button("Add Function"); + addFuncction.Button.Clicked += OnAddNewFunctionClicked; + // List of functions in the graph for (int i = 0; i < nodes.Count; i++) { @@ -192,60 +209,20 @@ namespace FlaxEditor.Windows.Assets } else if (node is Surface.Archetypes.Function.MethodOverrideNode overrideNode) { - var label = group.ClickableLabel(overrideNode.Title + " (override)").CustomControl; + var label = group.ClickableLabel($"{overrideNode.Title} (override)").CustomControl; label.TextColorHighlighted = Color.FromBgra(0xFFA0A0A0); label.TooltipText = overrideNode.TooltipText; label.DoubleClick += () => ((VisualScriptWindow)Values[0]).Surface.FocusNode(overrideNode); label.RightClick += () => ShowContextMenu(overrideNode, label); } } - - // New function button - const float groupPanelButtonSize = 14; - var addNewFunction = new Image - { - TooltipText = "Add new function", - AutoFocus = true, - AnchorPreset = AnchorPresets.TopRight, - Parent = group.Panel, - Bounds = new Rectangle(group.Panel.Width - groupPanelButtonSize, 0, groupPanelButtonSize, groupPanelButtonSize), - IsScrollable = false, - Color = FlaxEngine.GUI.Style.Current.ForegroundGrey, - Margin = new Margin(1), - Brush = new SpriteBrush(Editor.Instance.Icons.Add64), - }; - addNewFunction.Clicked += OnAddNewFunctionClicked; - - // Override method button - var overrideMethod = new Image - { - TooltipText = "Override method", - AutoFocus = true, - AnchorPreset = AnchorPresets.TopRight, - Parent = group.Panel, - Bounds = new Rectangle(group.Panel.Width - groupPanelButtonSize * 2, 0, groupPanelButtonSize, groupPanelButtonSize), - IsScrollable = false, - Color = FlaxEngine.GUI.Style.Current.ForegroundGrey, - Margin = new Margin(1), - Brush = new SpriteBrush(Editor.Instance.Icons.Import64), - }; - overrideMethod.Clicked += OnOverrideMethodClicked; - } - - private void OnAddNewFunctionClicked(Image image, MouseButton button) - { - if (button != MouseButton.Left) - return; - var surface = ((VisualScriptWindow)Values[0]).Surface; - var surfaceBounds = surface.AllNodesBounds; - surface.ShowArea(new Rectangle(surfaceBounds.BottomLeft, new Vector2(200, 150)).MakeExpanded(400.0f)); - var node = surface.Context.SpawnNode(16, 6, surfaceBounds.BottomLeft + new Vector2(0, 50)); - surface.Select(node); } private void ShowContextMenu(SurfaceNode node, ClickableLabel label) { + // TODO: Execute only on "Edit Signature...", this makes the "Show" button useless ((VisualScriptWindow)Values[0]).Surface.FocusNode(node); + var cm = new ContextMenu(); cm.AddButton("Show", () => ((VisualScriptWindow)Values[0]).Surface.FocusNode(node)).Icon = Editor.Instance.Icons.Search12; cm.AddButton("Delete", () => ((VisualScriptWindow)Values[0]).Surface.Delete(node)).Icon = Editor.Instance.Icons.Cross12; @@ -253,11 +230,17 @@ namespace FlaxEditor.Windows.Assets cm.Show(label, new Vector2(0, label.Height)); } - private void OnOverrideMethodClicked(Image image, MouseButton button) + private void OnAddNewFunctionClicked() { - if (button != MouseButton.Left) - return; + var surface = ((VisualScriptWindow)Values[0]).Surface; + var surfaceBounds = surface.AllNodesBounds; + surface.ShowArea(new Rectangle(surfaceBounds.BottomLeft, new Vector2(200, 150)).MakeExpanded(400.0f)); + var node = surface.Context.SpawnNode(16, 6, surfaceBounds.BottomLeft + new Vector2(0, 50)); + surface.Select(node); + } + private void OnOverrideMethodClicked() + { var cm = new ContextMenu(); var window = (VisualScriptWindow)Values[0]; var scriptMeta = window.Asset.Meta; @@ -310,7 +293,7 @@ namespace FlaxEditor.Windows.Assets { cm.AddButton("Nothing to override"); } - cm.Show(image, new Vector2(0, image.Height)); + cm.Show(_overrideButton, new Vector2(0, _overrideButton.Height)); } } From 96089d5396f6f259ec93ae5c1b94a2bf7bfcc03a Mon Sep 17 00:00:00 2001 From: W2Wizard <63303990+W2Wizard@users.noreply.github.com> Date: Sun, 13 Jun 2021 16:20:23 +0200 Subject: [PATCH 2/6] Fix timeline track icons --- Source/Editor/EditorIcons.cs | 4 +++- Source/Editor/GUI/Timeline/Tracks/ActorTrack.cs | 4 ++-- Source/Editor/GUI/Timeline/Tracks/AudioTrack.cs | 2 +- Source/Editor/GUI/Timeline/Tracks/CameraCutTrack.cs | 6 +++--- Source/Editor/GUI/Timeline/Tracks/FolderTrack.cs | 2 +- Source/Editor/GUI/Timeline/Tracks/MemberTrack.cs | 12 ++++++------ Source/Editor/Windows/ContentWindow.cs | 2 +- 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Source/Editor/EditorIcons.cs b/Source/Editor/EditorIcons.cs index ff3164dcc..da92a159f 100644 --- a/Source/Editor/EditorIcons.cs +++ b/Source/Editor/EditorIcons.cs @@ -46,7 +46,9 @@ namespace FlaxEditor public SpriteHandle Down32; public SpriteHandle FolderClosed32; public SpriteHandle FolderOpen32; - public SpriteHandle FolderFill32; + public SpriteHandle Folder32; + public SpriteHandle CameraFill32; + public SpriteHandle Search32; public SpriteHandle Info32; public SpriteHandle Warning32; public SpriteHandle Error32; diff --git a/Source/Editor/GUI/Timeline/Tracks/ActorTrack.cs b/Source/Editor/GUI/Timeline/Tracks/ActorTrack.cs index 580d1f266..fc096ca56 100644 --- a/Source/Editor/GUI/Timeline/Tracks/ActorTrack.cs +++ b/Source/Editor/GUI/Timeline/Tracks/ActorTrack.cs @@ -70,7 +70,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks : base(ref options) { // Select Actor button - const float buttonSize = 14; + const float buttonSize = 20; var icons = Editor.Instance.Icons; _selectActor = new Image { @@ -80,7 +80,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks IsScrollable = false, Color = Style.Current.ForegroundGrey, Margin = new Margin(1), - Brush = new SpriteBrush(icons.Search12), + Brush = new SpriteBrush(icons.Search32), Offsets = new Margin(-buttonSize - 2 + _addButton.Offsets.Left, buttonSize, buttonSize * -0.5f, buttonSize), Parent = this, }; diff --git a/Source/Editor/GUI/Timeline/Tracks/AudioTrack.cs b/Source/Editor/GUI/Timeline/Tracks/AudioTrack.cs index 98cb3979f..1df00c1b0 100644 --- a/Source/Editor/GUI/Timeline/Tracks/AudioTrack.cs +++ b/Source/Editor/GUI/Timeline/Tracks/AudioTrack.cs @@ -312,7 +312,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks Curve.UnlockChildrenRecursive(); // Navigation buttons - const float buttonSize = 14; + const float buttonSize = 20; var icons = Editor.Instance.Icons; var rightKey = new Image { diff --git a/Source/Editor/GUI/Timeline/Tracks/CameraCutTrack.cs b/Source/Editor/GUI/Timeline/Tracks/CameraCutTrack.cs index 359fa0126..f6f80ab22 100644 --- a/Source/Editor/GUI/Timeline/Tracks/CameraCutTrack.cs +++ b/Source/Editor/GUI/Timeline/Tracks/CameraCutTrack.cs @@ -682,10 +682,10 @@ namespace FlaxEditor.GUI.Timeline.Tracks public CameraCutTrack(ref TrackCreateOptions options) : base(ref options) { - Height = CameraCutThumbnailRenderer.Height + 4 + 4; + Height = CameraCutThumbnailRenderer.Height + 8; // Pilot Camera button - const float buttonSize = 14; + const float buttonSize = 20; var icons = Editor.Instance.Icons; _pilotCamera = new Image { @@ -695,7 +695,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks IsScrollable = false, Color = Style.Current.ForegroundGrey, Margin = new Margin(1), - Brush = new SpriteBrush(icons.Camera64), + Brush = new SpriteBrush(icons.CameraFill32), Offsets = new Margin(-buttonSize - 2 + _selectActor.Offsets.Left, buttonSize, buttonSize * -0.5f, buttonSize), Parent = this, }; diff --git a/Source/Editor/GUI/Timeline/Tracks/FolderTrack.cs b/Source/Editor/GUI/Timeline/Tracks/FolderTrack.cs index 5e251b6d2..c01719b97 100644 --- a/Source/Editor/GUI/Timeline/Tracks/FolderTrack.cs +++ b/Source/Editor/GUI/Timeline/Tracks/FolderTrack.cs @@ -24,7 +24,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks { TypeId = 1, Name = "Folder", - Icon = Editor.Instance.Icons.Folder64, + Icon = Editor.Instance.Icons.Folder32, Create = options => new FolderTrack(ref options), Load = LoadTrack, Save = SaveTrack, diff --git a/Source/Editor/GUI/Timeline/Tracks/MemberTrack.cs b/Source/Editor/GUI/Timeline/Tracks/MemberTrack.cs index 302570fae..d6fa64a98 100644 --- a/Source/Editor/GUI/Timeline/Tracks/MemberTrack.cs +++ b/Source/Editor/GUI/Timeline/Tracks/MemberTrack.cs @@ -118,7 +118,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks if (useNavigationButtons) { // Navigation buttons - const float buttonSize = 14; + const float buttonSize = 20; var icons = Editor.Instance.Icons; _rightKey = new Image { @@ -128,7 +128,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks IsScrollable = false, Color = Style.Current.ForegroundGrey, Margin = new Margin(1), - Brush = new SpriteBrush(icons.Right64), + Brush = new SpriteBrush(icons.Right32), Offsets = new Margin(-buttonSize - 2 + uiLeft, buttonSize, buttonSize * -0.5f, buttonSize), Parent = this, }; @@ -138,9 +138,9 @@ namespace FlaxEditor.GUI.Timeline.Tracks AutoFocus = true, AnchorPreset = AnchorPresets.MiddleRight, IsScrollable = false, - Color = Style.Current.Foreground, + Color = Style.Current.ForegroundGrey, Margin = new Margin(3), - Brush = new SpriteBrush(icons.Add64), + Brush = new SpriteBrush(icons.Add32), Offsets = new Margin(-buttonSize - 2 + _rightKey.Offsets.Left, buttonSize, buttonSize * -0.5f, buttonSize), Parent = this, }; @@ -150,9 +150,9 @@ namespace FlaxEditor.GUI.Timeline.Tracks AutoFocus = true, AnchorPreset = AnchorPresets.MiddleRight, IsScrollable = false, - Color = Style.Current.Foreground, + Color = Style.Current.ForegroundGrey, Margin = new Margin(1), - Brush = new SpriteBrush(icons.Left64), + Brush = new SpriteBrush(icons.Left32), Offsets = new Margin(-buttonSize - 2 + _addKey.Offsets.Left, buttonSize, buttonSize * -0.5f, buttonSize), Parent = this, }; diff --git a/Source/Editor/Windows/ContentWindow.cs b/Source/Editor/Windows/ContentWindow.cs index 88a976d2b..8a4db3789 100644 --- a/Source/Editor/Windows/ContentWindow.cs +++ b/Source/Editor/Windows/ContentWindow.cs @@ -66,7 +66,7 @@ namespace FlaxEditor.Windows : base(editor, true, ScrollBars.None) { Title = "Content"; - Icon = editor.Icons.Folder64; + Icon = editor.Icons.Folder32; // Content database events editor.ContentDatabase.WorkspaceModified += () => _isWorkspaceDirty = true; From 7e3b64b328a8f449085c3d5cde80c85b5a949ad4 Mon Sep 17 00:00:00 2001 From: W2Wizard <63303990+W2Wizard@users.noreply.github.com> Date: Sun, 13 Jun 2021 16:46:08 +0200 Subject: [PATCH 3/6] Adjust track icon size Go down from 20 to 18 instead. --- Source/Editor/GUI/Timeline/Tracks/ActorTrack.cs | 2 +- Source/Editor/GUI/Timeline/Tracks/AudioTrack.cs | 9 +++++---- Source/Editor/GUI/Timeline/Tracks/CameraCutTrack.cs | 2 +- Source/Editor/GUI/Timeline/Tracks/MemberTrack.cs | 9 +++++---- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Source/Editor/GUI/Timeline/Tracks/ActorTrack.cs b/Source/Editor/GUI/Timeline/Tracks/ActorTrack.cs index fc096ca56..22dae35e0 100644 --- a/Source/Editor/GUI/Timeline/Tracks/ActorTrack.cs +++ b/Source/Editor/GUI/Timeline/Tracks/ActorTrack.cs @@ -70,7 +70,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks : base(ref options) { // Select Actor button - const float buttonSize = 20; + const float buttonSize = 18; var icons = Editor.Instance.Icons; _selectActor = new Image { diff --git a/Source/Editor/GUI/Timeline/Tracks/AudioTrack.cs b/Source/Editor/GUI/Timeline/Tracks/AudioTrack.cs index 1df00c1b0..f9b7fa3f7 100644 --- a/Source/Editor/GUI/Timeline/Tracks/AudioTrack.cs +++ b/Source/Editor/GUI/Timeline/Tracks/AudioTrack.cs @@ -312,7 +312,8 @@ namespace FlaxEditor.GUI.Timeline.Tracks Curve.UnlockChildrenRecursive(); // Navigation buttons - const float buttonSize = 20; + const float keySize = 18; + const float addSize = 20; var icons = Editor.Instance.Icons; var rightKey = new Image { @@ -323,7 +324,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks Color = Style.Current.ForegroundGrey, Margin = new Margin(1), Brush = new SpriteBrush(icons.Right32), - Offsets = new Margin(-buttonSize - 2 + _muteCheckbox.Offsets.Left, buttonSize, buttonSize * -0.5f, buttonSize), + Offsets = new Margin(-keySize - 2 + _muteCheckbox.Offsets.Left, keySize, keySize * -0.5f, keySize), Parent = this, }; rightKey.Clicked += OnRightKeyClicked; @@ -336,7 +337,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks Color = Style.Current.ForegroundGrey, Margin = new Margin(3), Brush = new SpriteBrush(icons.Add32), - Offsets = new Margin(-buttonSize - 2 + rightKey.Offsets.Left, buttonSize, buttonSize * -0.5f, buttonSize), + Offsets = new Margin(-addSize - 2 + rightKey.Offsets.Left, addSize, addSize * -0.5f, addSize), Parent = this, }; addKey.Clicked += OnAddKeyClicked; @@ -349,7 +350,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks Color = Style.Current.ForegroundGrey, Margin = new Margin(1), Brush = new SpriteBrush(icons.Left32), - Offsets = new Margin(-buttonSize - 2 + addKey.Offsets.Left, buttonSize, buttonSize * -0.5f, buttonSize), + Offsets = new Margin(-keySize - 2 + addKey.Offsets.Left, keySize, keySize * -0.5f, keySize), Parent = this, }; leftKey.Clicked += OnLeftKeyClicked; diff --git a/Source/Editor/GUI/Timeline/Tracks/CameraCutTrack.cs b/Source/Editor/GUI/Timeline/Tracks/CameraCutTrack.cs index f6f80ab22..05f0c42ae 100644 --- a/Source/Editor/GUI/Timeline/Tracks/CameraCutTrack.cs +++ b/Source/Editor/GUI/Timeline/Tracks/CameraCutTrack.cs @@ -685,7 +685,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks Height = CameraCutThumbnailRenderer.Height + 8; // Pilot Camera button - const float buttonSize = 20; + const float buttonSize = 18; var icons = Editor.Instance.Icons; _pilotCamera = new Image { diff --git a/Source/Editor/GUI/Timeline/Tracks/MemberTrack.cs b/Source/Editor/GUI/Timeline/Tracks/MemberTrack.cs index d6fa64a98..64beb855d 100644 --- a/Source/Editor/GUI/Timeline/Tracks/MemberTrack.cs +++ b/Source/Editor/GUI/Timeline/Tracks/MemberTrack.cs @@ -118,7 +118,8 @@ namespace FlaxEditor.GUI.Timeline.Tracks if (useNavigationButtons) { // Navigation buttons - const float buttonSize = 20; + const float keySize = 18; + const float addSize = 20; var icons = Editor.Instance.Icons; _rightKey = new Image { @@ -129,7 +130,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks Color = Style.Current.ForegroundGrey, Margin = new Margin(1), Brush = new SpriteBrush(icons.Right32), - Offsets = new Margin(-buttonSize - 2 + uiLeft, buttonSize, buttonSize * -0.5f, buttonSize), + Offsets = new Margin(-keySize - 2 + uiLeft, keySize, keySize * -0.5f, keySize), Parent = this, }; _addKey = new Image @@ -141,7 +142,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks Color = Style.Current.ForegroundGrey, Margin = new Margin(3), Brush = new SpriteBrush(icons.Add32), - Offsets = new Margin(-buttonSize - 2 + _rightKey.Offsets.Left, buttonSize, buttonSize * -0.5f, buttonSize), + Offsets = new Margin(-addSize - 2 + _rightKey.Offsets.Left, addSize, addSize * -0.5f, addSize), Parent = this, }; _leftKey = new Image @@ -153,7 +154,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks Color = Style.Current.ForegroundGrey, Margin = new Margin(1), Brush = new SpriteBrush(icons.Left32), - Offsets = new Margin(-buttonSize - 2 + _addKey.Offsets.Left, buttonSize, buttonSize * -0.5f, buttonSize), + Offsets = new Margin(-keySize - 2 + _addKey.Offsets.Left, keySize, keySize * -0.5f, keySize), Parent = this, }; uiLeft = _leftKey.Offsets.Left; From 8e781ccf7b1363ed9e6e9e3c5601f862a480e718 Mon Sep 17 00:00:00 2001 From: W2Wizard <63303990+W2Wizard@users.noreply.github.com> Date: Sun, 13 Jun 2021 17:33:58 +0200 Subject: [PATCH 4/6] Apply asset new icons Apply the Icons for SwitchSettings, LocalizationSettings and Json Asset. --- Source/Editor/Content/Items/JsonAssetItem.cs | 2 +- Source/Editor/EditorIcons.cs | 2 +- Source/Editor/GUI/PlatformSelector.cs | 5 ++--- Source/Editor/Modules/ContentDatabaseModule.cs | 11 +++++++---- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Source/Editor/Content/Items/JsonAssetItem.cs b/Source/Editor/Content/Items/JsonAssetItem.cs index 1c9232c9c..80957f181 100644 --- a/Source/Editor/Content/Items/JsonAssetItem.cs +++ b/Source/Editor/Content/Items/JsonAssetItem.cs @@ -22,7 +22,7 @@ namespace FlaxEditor.Content public JsonAssetItem(string path, Guid id, string typeName) : base(path, typeName, ref id) { - _thumbnail = Editor.Instance.Icons.Document128; + _thumbnail = Editor.Instance.Icons.Json128; } /// diff --git a/Source/Editor/EditorIcons.cs b/Source/Editor/EditorIcons.cs index da92a159f..1f7be216e 100644 --- a/Source/Editor/EditorIcons.cs +++ b/Source/Editor/EditorIcons.cs @@ -136,8 +136,8 @@ namespace FlaxEditor public SpriteHandle FlaxLogo128; public SpriteHandle SwitchIcon128; public SpriteHandle SwitchSettings128; - public SpriteHandle Json128; public SpriteHandle LocalizationSettings128; + public SpriteHandle Json128; internal void LoadIcons() { diff --git a/Source/Editor/GUI/PlatformSelector.cs b/Source/Editor/GUI/PlatformSelector.cs index cc7bc003a..3b9802873 100644 --- a/Source/Editor/GUI/PlatformSelector.cs +++ b/Source/Editor/GUI/PlatformSelector.cs @@ -89,11 +89,10 @@ namespace FlaxEditor.GUI new PlatformData(PlatformType.PS4, icons.PS4Icon128, "PlayStation 4"), new PlatformData(PlatformType.XboxScarlett, icons.XBoxScarletIcon128, "Xbox Scarlett"), new PlatformData(PlatformType.Android, icons.AndroidIcon128, "Android"), - new PlatformData(PlatformType.Switch, icons.ColorWheel128, "Switch"), - + new PlatformData(PlatformType.Switch, icons.SwitchIcon128, "Switch"), }; - const float IconSize = 48.0f; + const float IconSize = 64.0f; TileSize = new Vector2(IconSize); AutoResize = true; Offsets = new Margin(0, 0, 0, IconSize); diff --git a/Source/Editor/Modules/ContentDatabaseModule.cs b/Source/Editor/Modules/ContentDatabaseModule.cs index ec71b8564..ca4577d55 100644 --- a/Source/Editor/Modules/ContentDatabaseModule.cs +++ b/Source/Editor/Modules/ContentDatabaseModule.cs @@ -936,23 +936,26 @@ namespace FlaxEditor.Modules Proxy.Add(new SettingsProxy(typeof(PhysicsSettings), Editor.Instance.Icons.PhysicsSettings128)); Proxy.Add(new SettingsProxy(typeof(GraphicsSettings), Editor.Instance.Icons.GraphicsSettings128)); Proxy.Add(new SettingsProxy(typeof(NavigationSettings), Editor.Instance.Icons.NavigationSettings128)); - Proxy.Add(new SettingsProxy(typeof(LocalizationSettings), Editor.Instance.Icons.Document128)); + Proxy.Add(new SettingsProxy(typeof(LocalizationSettings), Editor.Instance.Icons.LocalizationSettings128)); + Proxy.Add(new SettingsProxy(typeof(AudioSettings), Editor.Instance.Icons.AudioSettings128)); Proxy.Add(new SettingsProxy(typeof(BuildSettings), Editor.Instance.Icons.BuildSettings128)); Proxy.Add(new SettingsProxy(typeof(InputSettings), Editor.Instance.Icons.InputSettings128)); Proxy.Add(new SettingsProxy(typeof(WindowsPlatformSettings), Editor.Instance.Icons.WindowsSettings128)); Proxy.Add(new SettingsProxy(typeof(UWPPlatformSettings), Editor.Instance.Icons.UWPSettings128)); Proxy.Add(new SettingsProxy(typeof(LinuxPlatformSettings), Editor.Instance.Icons.LinuxSettings128)); + Proxy.Add(new SettingsProxy(typeof(AndroidPlatformSettings), Editor.Instance.Icons.AndroidSettings128)); + var typePS4PlatformSettings = TypeUtils.GetManagedType(GameSettings.PS4PlatformSettingsTypename); if (typePS4PlatformSettings != null) Proxy.Add(new SettingsProxy(typePS4PlatformSettings, Editor.Instance.Icons.PlaystationSettings128)); + var typeXboxScarlettPlatformSettings = TypeUtils.GetManagedType(GameSettings.XboxScarlettPlatformSettingsTypename); if (typeXboxScarlettPlatformSettings != null) Proxy.Add(new SettingsProxy(typeXboxScarlettPlatformSettings, Editor.Instance.Icons.XBoxScarletIcon128)); - Proxy.Add(new SettingsProxy(typeof(AndroidPlatformSettings), Editor.Instance.Icons.AndroidSettings128)); + var typeSwitchPlatformSettings = TypeUtils.GetManagedType(GameSettings.SwitchPlatformSettingsTypename); if (typeSwitchPlatformSettings != null) - Proxy.Add(new SettingsProxy(typeSwitchPlatformSettings, Editor.Instance.Icons.Document128)); - Proxy.Add(new SettingsProxy(typeof(AudioSettings), Editor.Instance.Icons.AudioSettings128)); + Proxy.Add(new SettingsProxy(typeSwitchPlatformSettings, Editor.Instance.Icons.SwitchSettings128)); // Last add generic json (won't override other json proxies) Proxy.Add(new GenericJsonAssetProxy()); From 5408898e15c0fcbb301e97217f135822fa95f7f4 Mon Sep 17 00:00:00 2001 From: W2Wizard <63303990+W2Wizard@users.noreply.github.com> Date: Sun, 13 Jun 2021 20:16:06 +0200 Subject: [PATCH 5/6] Increase BoxSize & overhaul debug log icons --- Source/Editor/Surface/Constants.cs | 2 +- Source/Editor/Windows/DebugLogWindow.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Editor/Surface/Constants.cs b/Source/Editor/Surface/Constants.cs index 3636d193c..a63d8b489 100644 --- a/Source/Editor/Surface/Constants.cs +++ b/Source/Editor/Surface/Constants.cs @@ -48,7 +48,7 @@ namespace FlaxEditor.Surface /// /// The box size (with and height). /// - public const float BoxSize = 16.0f; + public const float BoxSize = 20.0f; /// /// The node layout offset on the y axis (height of the boxes rows, etc.). It's used to make the design more consistent. diff --git a/Source/Editor/Windows/DebugLogWindow.cs b/Source/Editor/Windows/DebugLogWindow.cs index bc80a0ba7..e95debfff 100644 --- a/Source/Editor/Windows/DebugLogWindow.cs +++ b/Source/Editor/Windows/DebugLogWindow.cs @@ -312,9 +312,9 @@ namespace FlaxEditor.Windows _clearOnPlayButton = (ToolStripButton)toolstrip.AddButton("Clear on Play").SetAutoCheck(true).SetChecked(true).LinkTooltip("Clears all log entries on enter playmode"); _pauseOnErrorButton = (ToolStripButton)toolstrip.AddButton("Pause on Error").SetAutoCheck(true).LinkTooltip("Performs auto pause on error"); toolstrip.AddSeparator(); - _groupButtons[0] = (ToolStripButton)toolstrip.AddButton(editor.Icons.Error64, () => UpdateLogTypeVisibility(LogGroup.Error, _groupButtons[0].Checked)).SetAutoCheck(true).SetChecked(true).LinkTooltip("Shows/hides error messages"); - _groupButtons[1] = (ToolStripButton)toolstrip.AddButton(editor.Icons.Warning64, () => UpdateLogTypeVisibility(LogGroup.Warning, _groupButtons[1].Checked)).SetAutoCheck(true).SetChecked(true).LinkTooltip("Shows/hides warning messages"); - _groupButtons[2] = (ToolStripButton)toolstrip.AddButton(editor.Icons.Info64, () => UpdateLogTypeVisibility(LogGroup.Info, _groupButtons[2].Checked)).SetAutoCheck(true).SetChecked(true).LinkTooltip("Shows/hides info messages"); + _groupButtons[0] = (ToolStripButton)toolstrip.AddButton(editor.Icons.Error32, () => UpdateLogTypeVisibility(LogGroup.Error, _groupButtons[0].Checked)).SetAutoCheck(true).SetChecked(true).LinkTooltip("Shows/hides error messages"); + _groupButtons[1] = (ToolStripButton)toolstrip.AddButton(editor.Icons.Warning32, () => UpdateLogTypeVisibility(LogGroup.Warning, _groupButtons[1].Checked)).SetAutoCheck(true).SetChecked(true).LinkTooltip("Shows/hides warning messages"); + _groupButtons[2] = (ToolStripButton)toolstrip.AddButton(editor.Icons.Info32, () => UpdateLogTypeVisibility(LogGroup.Info, _groupButtons[2].Checked)).SetAutoCheck(true).SetChecked(true).LinkTooltip("Shows/hides info messages"); UpdateCount(); // Split panel @@ -387,10 +387,10 @@ namespace FlaxEditor.Windows switch (_timestampsFormats) { case InterfaceOptions.TimestampsFormats.Utc: - desc.Title = string.Format("[{0}] ", DateTime.UtcNow) + desc.Title; + desc.Title = $"[{DateTime.UtcNow}] {desc.Title}"; break; case InterfaceOptions.TimestampsFormats.LocalTime: - desc.Title = string.Format("[{0}] ", DateTime.Now) + desc.Title; + desc.Title = $"[{DateTime.Now}] {desc.Title}"; break; case InterfaceOptions.TimestampsFormats.TimeSinceStartup: desc.Title = string.Format("[{0:g}] ", TimeSpan.FromSeconds(Time.TimeSinceStartup)) + desc.Title; From 83e6319643ad33c3bd60cd6c0185b9c306f5f753 Mon Sep 17 00:00:00 2001 From: W2Wizard <63303990+W2Wizard@users.noreply.github.com> Date: Sun, 13 Jun 2021 22:37:47 +0200 Subject: [PATCH 6/6] Adjust debug log tab icon --- Source/Editor/GUI/Docking/DockPanel.cs | 2 +- Source/Editor/Windows/DebugLogWindow.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Editor/GUI/Docking/DockPanel.cs b/Source/Editor/GUI/Docking/DockPanel.cs index f968c2501..0f31759f2 100644 --- a/Source/Editor/GUI/Docking/DockPanel.cs +++ b/Source/Editor/GUI/Docking/DockPanel.cs @@ -84,7 +84,7 @@ namespace FlaxEditor.GUI.Docking /// /// The default tabs header buttons size. /// - public const float DefaultButtonsSize = 12; + public const float DefaultButtonsSize = 15; /// /// The default tabs header buttons margin. diff --git a/Source/Editor/Windows/DebugLogWindow.cs b/Source/Editor/Windows/DebugLogWindow.cs index e95debfff..13f72992c 100644 --- a/Source/Editor/Windows/DebugLogWindow.cs +++ b/Source/Editor/Windows/DebugLogWindow.cs @@ -480,15 +480,15 @@ namespace FlaxEditor.Windows { if (_iconType == LogType.Warning) { - Icon = IconWarning; + Icon = Editor.Icons.Warning32; } else if (_iconType == LogType.Error) { - Icon = IconError; + Icon = Editor.Icons.Error32; } else { - Icon = IconInfo; + Icon = Editor.Icons.Info32; } }