From 19edce1770f09d2b9bb0ba8b1c179a5f47da2f3e Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Wed, 9 Apr 2025 10:43:52 +0200 Subject: [PATCH 01/10] add controls and filter to actor toolbox search --- Source/Editor/Windows/ToolboxWindow.cs | 165 +++++++++++++++++++------ 1 file changed, 130 insertions(+), 35 deletions(-) diff --git a/Source/Editor/Windows/ToolboxWindow.cs b/Source/Editor/Windows/ToolboxWindow.cs index 81f7b94d4..43b935557 100644 --- a/Source/Editor/Windows/ToolboxWindow.cs +++ b/Source/Editor/Windows/ToolboxWindow.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; +using FlaxEditor.GUI.ContextMenu; using FlaxEditor.GUI.Input; using FlaxEditor.GUI.Tabs; using FlaxEditor.GUI.Tree; @@ -98,10 +99,20 @@ namespace FlaxEditor.Windows } } + private enum SearchFilter + { + Ui = 1, + Actors = 2, + Models = 4, + } + private TextBox _searchBox; private ContainerControl _groupSearch; private Tabs _actorGroups; private ContainerControl groupPrimitives; + private Button _viewDropdown; + + private int _searchTypeShowMask = (int)SearchFilter.Ui | (int)SearchFilter.Actors | (int)SearchFilter.Models; /// /// The editor instance. @@ -127,16 +138,23 @@ namespace FlaxEditor.Windows UseScroll = true, AnchorPreset = AnchorPresets.StretchAll, Offsets = Margin.Zero, - TabsSize = new Float2(120, 32), + TabsSize = new Float2(90, 32), Parent = this, }; _groupSearch = CreateGroupWithList(_actorGroups, "Search", 26); - _searchBox = new SearchBox + + _viewDropdown = new Button(2, 2, 45.0f, TextBoxBase.DefaultHeight) + { + TooltipText = "Change search filter options", + Text = "Filters", + Parent = _groupSearch.Parent.Parent, + }; + _viewDropdown.Clicked += OnViewButtonClicked; + + _searchBox = new SearchBox(false, _viewDropdown.Right + 2, 2, _groupSearch.Width - _viewDropdown.Right - 4) { - AnchorPreset = AnchorPresets.HorizontalStretchTop, Parent = _groupSearch.Parent.Parent, - Bounds = new Rectangle(4, 4, _actorGroups.Width - 8, 18), }; _searchBox.TextChanged += OnSearchBoxTextChanged; @@ -145,6 +163,42 @@ namespace FlaxEditor.Windows _actorGroups.SelectedTabIndex = 1; } + private void OnViewButtonClicked() + { + var menu = new ContextMenu(); + + var infoLogButton = menu.AddButton("Ui"); + infoLogButton.AutoCheck = true; + infoLogButton.Checked = (_searchTypeShowMask & (int)SearchFilter.Ui) != 0; + infoLogButton.Clicked += () => ToggleSearchFilter(SearchFilter.Ui); + + var warningLogButton = menu.AddButton("Actors"); + warningLogButton.AutoCheck = true; + warningLogButton.Checked = (_searchTypeShowMask & (int)SearchFilter.Actors) != 0; + warningLogButton.Clicked += () => ToggleSearchFilter(SearchFilter.Actors); + + var errorLogButton = menu.AddButton("Models"); + errorLogButton.AutoCheck = true; + errorLogButton.Checked = (_searchTypeShowMask & (int)SearchFilter.Models) != 0; + errorLogButton.Clicked += () => ToggleSearchFilter(SearchFilter.Models); + + menu.Show(_viewDropdown.Parent, _viewDropdown.BottomLeft); + } + + private void ToggleSearchFilter(SearchFilter type) + { + _searchTypeShowMask ^= (int)type; + OnSearchBoxTextChanged(); + } + + /// + protected override void PerformLayoutBeforeChildren() + { + base.PerformLayoutBeforeChildren(); + + _searchBox.Width = _groupSearch.Width - _viewDropdown.Right - 4; + } + private void OnScriptsReload() { // Prevent any references to actor types from the game assemblies that will be reloaded @@ -213,7 +267,7 @@ namespace FlaxEditor.Windows { if (controlType.IsAbstract) continue; - _groupSearch.AddChild(CreateControlItem(Utilities.Utils.GetPropertyNameUI(controlType.Name), controlType)); + ActorToolboxAttribute attribute = null; foreach (var e in controlType.GetAttributes(false)) { @@ -312,51 +366,92 @@ namespace FlaxEditor.Windows _groupSearch.LockChildrenRecursive(); _groupSearch.DisposeChildren(); - foreach (var actorType in Editor.CodeEditing.Actors.Get()) + if (((int)SearchFilter.Actors & _searchTypeShowMask) != 0) { - ActorToolboxAttribute attribute = null; - foreach (var e in actorType.GetAttributes(false)) + foreach (var actorType in Editor.CodeEditing.Actors.Get()) { - if (e is ActorToolboxAttribute actorToolboxAttribute) + ActorToolboxAttribute attribute = null; + foreach (var e in actorType.GetAttributes(false)) { - attribute = actorToolboxAttribute; - break; + if (e is ActorToolboxAttribute actorToolboxAttribute) + { + attribute = actorToolboxAttribute; + break; + } } - } - var text = (attribute == null) ? actorType.Name : string.IsNullOrEmpty(attribute.Name) ? actorType.Name : attribute.Name; + var text = (attribute == null) ? actorType.Name : string.IsNullOrEmpty(attribute.Name) ? actorType.Name : attribute.Name; - // Display all actors on no search - if (string.IsNullOrEmpty(filterText)) - _groupSearch.AddChild(CreateActorItem(Utilities.Utils.GetPropertyNameUI(text), actorType)); - - if (!QueryFilterHelper.Match(filterText, text, out QueryFilterHelper.Range[] ranges)) - continue; - - var item = CreateActorItem(Utilities.Utils.GetPropertyNameUI(text), actorType); - SearchFilterHighlights(item, text, ranges); - } - - // Hack primitive models into the search results - foreach (var child in groupPrimitives.Children) - { - if (child is Item primitiveAssetItem) - { - var text = primitiveAssetItem.Text; + // Display all actors on no search + if (string.IsNullOrEmpty(filterText)) + _groupSearch.AddChild(CreateActorItem(Utilities.Utils.GetPropertyNameUI(text), actorType)); if (!QueryFilterHelper.Match(filterText, text, out QueryFilterHelper.Range[] ranges)) continue; - // Rebuild the path based on item name (it would be better to convert the drag data back to a string somehow) - string path = $"Primitives/{text}.flax"; - - var item = CreateEditorAssetItem(text, path); + var item = CreateActorItem(Utilities.Utils.GetPropertyNameUI(text), actorType); SearchFilterHighlights(item, text, ranges); } } + if (((int)SearchFilter.Models & _searchTypeShowMask) != 0) + { + // Hack primitive models into the search results + foreach (var child in groupPrimitives.Children) + { + if (child is Item primitiveAssetItem) + { + var text = primitiveAssetItem.Text; + + // Rebuild the path based on item name (it would be better to convert the drag data back to a string somehow) + string path = $"Primitives/{text}.flax"; + + // Display all primitives on no search + if (string.IsNullOrEmpty(filterText)) + _groupSearch.AddChild(CreateEditorAssetItem(text, path)); + + if (!QueryFilterHelper.Match(filterText, text, out QueryFilterHelper.Range[] ranges)) + continue; + + var item = CreateEditorAssetItem(text, path); + SearchFilterHighlights(item, text, ranges); + } + } + } + + if (((int)SearchFilter.Ui & _searchTypeShowMask) != 0) + { + foreach (var controlType in Editor.Instance.CodeEditing.Controls.Get()) + { + if (controlType.IsAbstract) + continue; + + ActorToolboxAttribute attribute = null; + foreach (var e in controlType.GetAttributes(false)) + { + if (e is ActorToolboxAttribute actorToolboxAttribute) + { + attribute = actorToolboxAttribute; + break; + } + } + + var text = (attribute == null) ? controlType.Name : string.IsNullOrEmpty(attribute.Name) ? controlType.Name : attribute.Name; + + // Display all controls on no search + if (string.IsNullOrEmpty(filterText)) + _groupSearch.AddChild(CreateControlItem(Utilities.Utils.GetPropertyNameUI(controlType.Name), controlType)); + + if (!QueryFilterHelper.Match(filterText, text, out QueryFilterHelper.Range[] ranges)) + continue; + + var item = CreateControlItem(Utilities.Utils.GetPropertyNameUI(controlType.Name), controlType); + SearchFilterHighlights(item, text, ranges); + } + } + if (string.IsNullOrEmpty(filterText)) - _groupSearch.SortChildren(); + _groupSearch.SortChildren(); _groupSearch.UnlockChildrenRecursive(); PerformLayout(); From 6bf90f29c52c198d855ed1fadce41cb4289c5ad0 Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Wed, 9 Apr 2025 14:29:19 +0200 Subject: [PATCH 02/10] fixes --- Source/Editor/Windows/ToolboxWindow.cs | 30 ++++++++++++++++---------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/Source/Editor/Windows/ToolboxWindow.cs b/Source/Editor/Windows/ToolboxWindow.cs index 43b935557..84cd94ff2 100644 --- a/Source/Editor/Windows/ToolboxWindow.cs +++ b/Source/Editor/Windows/ToolboxWindow.cs @@ -103,7 +103,7 @@ namespace FlaxEditor.Windows { Ui = 1, Actors = 2, - Models = 4, + Primitives = 4, } private TextBox _searchBox; @@ -113,6 +113,7 @@ namespace FlaxEditor.Windows private Button _viewDropdown; private int _searchTypeShowMask = (int)SearchFilter.Ui | (int)SearchFilter.Actors | (int)SearchFilter.Models; + private int _searchFilterMask = (int)SearchFilter.Ui | (int)SearchFilter.Actors | (int)SearchFilter.Primitives; /// /// The editor instance. @@ -167,8 +168,6 @@ namespace FlaxEditor.Windows { var menu = new ContextMenu(); - var infoLogButton = menu.AddButton("Ui"); - infoLogButton.AutoCheck = true; infoLogButton.Checked = (_searchTypeShowMask & (int)SearchFilter.Ui) != 0; infoLogButton.Clicked += () => ToggleSearchFilter(SearchFilter.Ui); @@ -179,15 +178,17 @@ namespace FlaxEditor.Windows var errorLogButton = menu.AddButton("Models"); errorLogButton.AutoCheck = true; - errorLogButton.Checked = (_searchTypeShowMask & (int)SearchFilter.Models) != 0; - errorLogButton.Clicked += () => ToggleSearchFilter(SearchFilter.Models); + var primitiveFilterButton = menu.AddButton("Primitives"); + primitiveFilterButton.AutoCheck = true; + primitiveFilterButton.Checked = (_searchFilterMask & (int)SearchFilter.Primitives) != 0; + primitiveFilterButton.Clicked += () => ToggleSearchFilter(SearchFilter.Primitives); menu.Show(_viewDropdown.Parent, _viewDropdown.BottomLeft); } private void ToggleSearchFilter(SearchFilter type) { - _searchTypeShowMask ^= (int)type; + _searchFilterMask ^= (int)type; OnSearchBoxTextChanged(); } @@ -246,14 +247,21 @@ namespace FlaxEditor.Windows group.Dispose(); } - // Setup primitives tabs + // Add primitives to primtives and search tab groupPrimitives = CreateGroupWithList(_actorGroups, "Primitives"); + groupPrimitives.AddChild(CreateEditorAssetItem("Cube", "Primitives/Cube.flax")); + _groupSearch.AddChild(CreateEditorAssetItem("Cube", "Primitives/Cube.flax")); groupPrimitives.AddChild(CreateEditorAssetItem("Sphere", "Primitives/Sphere.flax")); + _groupSearch.AddChild(CreateEditorAssetItem("Sphere", "Primitives/Sphere.flax")); groupPrimitives.AddChild(CreateEditorAssetItem("Plane", "Primitives/Plane.flax")); + _groupSearch.AddChild(CreateEditorAssetItem("Plane", "Primitives/Plane.flax")); groupPrimitives.AddChild(CreateEditorAssetItem("Cylinder", "Primitives/Cylinder.flax")); + _groupSearch.AddChild(CreateEditorAssetItem("Cylinder", "Primitives/Cylinder.flax")); groupPrimitives.AddChild(CreateEditorAssetItem("Cone", "Primitives/Cone.flax")); + _groupSearch.AddChild(CreateEditorAssetItem("Cone", "Primitives/Cone.flax")); groupPrimitives.AddChild(CreateEditorAssetItem("Capsule", "Primitives/Capsule.flax")); + _groupSearch.AddChild(CreateEditorAssetItem("Capsule", "Primitives/Capsule.flax")); // Created first to order specific tabs CreateGroupWithList(_actorGroups, "Lights"); @@ -267,7 +275,7 @@ namespace FlaxEditor.Windows { if (controlType.IsAbstract) continue; - + _groupSearch.AddChild(CreateControlItem(Utilities.Utils.GetPropertyNameUI(controlType.Name), controlType)); ActorToolboxAttribute attribute = null; foreach (var e in controlType.GetAttributes(false)) { @@ -366,7 +374,7 @@ namespace FlaxEditor.Windows _groupSearch.LockChildrenRecursive(); _groupSearch.DisposeChildren(); - if (((int)SearchFilter.Actors & _searchTypeShowMask) != 0) + if (((int)SearchFilter.Actors & _searchFilterMask) != 0) { foreach (var actorType in Editor.CodeEditing.Actors.Get()) { @@ -394,7 +402,7 @@ namespace FlaxEditor.Windows } } - if (((int)SearchFilter.Models & _searchTypeShowMask) != 0) + if (((int)SearchFilter.Primitives & _searchFilterMask) != 0) { // Hack primitive models into the search results foreach (var child in groupPrimitives.Children) @@ -419,7 +427,7 @@ namespace FlaxEditor.Windows } } - if (((int)SearchFilter.Ui & _searchTypeShowMask) != 0) + if (((int)SearchFilter.Ui & _searchFilterMask) != 0) { foreach (var controlType in Editor.Instance.CodeEditing.Controls.Get()) { From aecbab5613daf1769b00b4fa6b25393cb33ad3e5 Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Wed, 9 Apr 2025 14:30:08 +0200 Subject: [PATCH 03/10] more fixes --- Source/Editor/Windows/ToolboxWindow.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Source/Editor/Windows/ToolboxWindow.cs b/Source/Editor/Windows/ToolboxWindow.cs index 84cd94ff2..44854f029 100644 --- a/Source/Editor/Windows/ToolboxWindow.cs +++ b/Source/Editor/Windows/ToolboxWindow.cs @@ -112,7 +112,6 @@ namespace FlaxEditor.Windows private ContainerControl groupPrimitives; private Button _viewDropdown; - private int _searchTypeShowMask = (int)SearchFilter.Ui | (int)SearchFilter.Actors | (int)SearchFilter.Models; private int _searchFilterMask = (int)SearchFilter.Ui | (int)SearchFilter.Actors | (int)SearchFilter.Primitives; /// @@ -168,16 +167,16 @@ namespace FlaxEditor.Windows { var menu = new ContextMenu(); - infoLogButton.Checked = (_searchTypeShowMask & (int)SearchFilter.Ui) != 0; - infoLogButton.Clicked += () => ToggleSearchFilter(SearchFilter.Ui); + var uiFilterButton = menu.AddButton("Ui"); + uiFilterButton.AutoCheck = true; + uiFilterButton.Checked = (_searchFilterMask & (int)SearchFilter.Ui) != 0; + uiFilterButton.Clicked += () => ToggleSearchFilter(SearchFilter.Ui); - var warningLogButton = menu.AddButton("Actors"); - warningLogButton.AutoCheck = true; - warningLogButton.Checked = (_searchTypeShowMask & (int)SearchFilter.Actors) != 0; - warningLogButton.Clicked += () => ToggleSearchFilter(SearchFilter.Actors); + var actorFilterButton = menu.AddButton("Actors"); + actorFilterButton.AutoCheck = true; + actorFilterButton.Checked = (_searchFilterMask & (int)SearchFilter.Actors) != 0; + actorFilterButton.Clicked += () => ToggleSearchFilter(SearchFilter.Actors); - var errorLogButton = menu.AddButton("Models"); - errorLogButton.AutoCheck = true; var primitiveFilterButton = menu.AddButton("Primitives"); primitiveFilterButton.AutoCheck = true; primitiveFilterButton.Checked = (_searchFilterMask & (int)SearchFilter.Primitives) != 0; From 6e44eebb9eee8f8a4f518bec2baeae04032a8d5a Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Wed, 9 Apr 2025 17:01:17 +0200 Subject: [PATCH 04/10] another fix --- Source/Editor/Windows/ToolboxWindow.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Editor/Windows/ToolboxWindow.cs b/Source/Editor/Windows/ToolboxWindow.cs index 44854f029..789ff0290 100644 --- a/Source/Editor/Windows/ToolboxWindow.cs +++ b/Source/Editor/Windows/ToolboxWindow.cs @@ -458,7 +458,7 @@ namespace FlaxEditor.Windows } if (string.IsNullOrEmpty(filterText)) - _groupSearch.SortChildren(); + _groupSearch.SortChildren(); _groupSearch.UnlockChildrenRecursive(); PerformLayout(); From 5049f3b2d811a4b130e318528b86901f4504133c Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Wed, 9 Apr 2025 23:45:00 +0200 Subject: [PATCH 05/10] add hint if no filters are active --- Source/Editor/Windows/ToolboxWindow.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Source/Editor/Windows/ToolboxWindow.cs b/Source/Editor/Windows/ToolboxWindow.cs index 789ff0290..a4a34c9fe 100644 --- a/Source/Editor/Windows/ToolboxWindow.cs +++ b/Source/Editor/Windows/ToolboxWindow.cs @@ -146,7 +146,7 @@ namespace FlaxEditor.Windows _viewDropdown = new Button(2, 2, 45.0f, TextBoxBase.DefaultHeight) { - TooltipText = "Change search filter options", + TooltipText = "Change search filter options.", Text = "Filters", Parent = _groupSearch.Parent.Parent, }; @@ -465,6 +465,22 @@ namespace FlaxEditor.Windows PerformLayout(); } + /// + { + base.Draw(); + + bool showFilterHint = ((int)SearchFilter.Actors & _searchFilterMask) == 0 && + ((int)SearchFilter.Primitives & _searchFilterMask) == 0 && + ((int)SearchFilter.Ui & _searchFilterMask) == 0; + + if (showFilterHint) + { + var textRect = _groupSearch.Parent.Parent.Bounds; + var style = Style.Current; + Render2D.DrawText(style.FontMedium, "No search filter active, please enable at least one filter.", textRect, style.ForegroundGrey, TextAlignment.Center, TextAlignment.Center, TextWrapping.WrapWords); + } + } + private void SearchFilterHighlights(Item item, string text, QueryFilterHelper.Range[] ranges) { _groupSearch.AddChild(item); From d58a9beb3df09b559635490f3a5bc347debb2ff5 Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Wed, 9 Apr 2025 23:45:43 +0200 Subject: [PATCH 06/10] why was this not in the last commit? --- Source/Editor/Windows/ToolboxWindow.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Editor/Windows/ToolboxWindow.cs b/Source/Editor/Windows/ToolboxWindow.cs index a4a34c9fe..6666fcdb7 100644 --- a/Source/Editor/Windows/ToolboxWindow.cs +++ b/Source/Editor/Windows/ToolboxWindow.cs @@ -466,6 +466,7 @@ namespace FlaxEditor.Windows } /// + public override void Draw() { base.Draw(); From 41706993483723e8d5148682c4323929e3dd2766 Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Thu, 10 Apr 2025 09:25:52 +0200 Subject: [PATCH 07/10] add hint if there are no search results --- Source/Editor/Windows/ToolboxWindow.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Source/Editor/Windows/ToolboxWindow.cs b/Source/Editor/Windows/ToolboxWindow.cs index 6666fcdb7..020aa53b1 100644 --- a/Source/Editor/Windows/ToolboxWindow.cs +++ b/Source/Editor/Windows/ToolboxWindow.cs @@ -470,15 +470,20 @@ namespace FlaxEditor.Windows { base.Draw(); - bool showFilterHint = ((int)SearchFilter.Actors & _searchFilterMask) == 0 && + // Show a text to hint the user that either no filter is active or the search does not return any results + bool noSearchResults = _groupSearch.Children.Count == 0 && !string.IsNullOrEmpty(_searchBox.Text); + bool showHint = (((int)SearchFilter.Actors & _searchFilterMask) == 0 && ((int)SearchFilter.Primitives & _searchFilterMask) == 0 && - ((int)SearchFilter.Ui & _searchFilterMask) == 0; - - if (showFilterHint) + ((int)SearchFilter.Ui & _searchFilterMask) == 0) || + noSearchResults; + + String hint = noSearchResults ? "No results." : "No search filter active, please enable at least one filter."; + + if (showHint) { var textRect = _groupSearch.Parent.Parent.Bounds; var style = Style.Current; - Render2D.DrawText(style.FontMedium, "No search filter active, please enable at least one filter.", textRect, style.ForegroundGrey, TextAlignment.Center, TextAlignment.Center, TextWrapping.WrapWords); + Render2D.DrawText(style.FontMedium, hint, textRect, style.ForegroundGrey, TextAlignment.Center, TextAlignment.Center, TextWrapping.WrapWords); } } From 0c1e0e48d420600cad47d6fd89c11581af26e75d Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Thu, 10 Apr 2025 22:12:47 +0200 Subject: [PATCH 08/10] always sort the search results alphabetically --- Source/Editor/Windows/ToolboxWindow.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Editor/Windows/ToolboxWindow.cs b/Source/Editor/Windows/ToolboxWindow.cs index 020aa53b1..160084dd2 100644 --- a/Source/Editor/Windows/ToolboxWindow.cs +++ b/Source/Editor/Windows/ToolboxWindow.cs @@ -455,10 +455,10 @@ namespace FlaxEditor.Windows var item = CreateControlItem(Utilities.Utils.GetPropertyNameUI(controlType.Name), controlType); SearchFilterHighlights(item, text, ranges); } - } + } - if (string.IsNullOrEmpty(filterText)) - _groupSearch.SortChildren(); + // Sort the search results alphabetically + _groupSearch.SortChildren(); _groupSearch.UnlockChildrenRecursive(); PerformLayout(); From 4e44831bbe663d32bc46e910ee2709125e873fbf Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Fri, 11 Apr 2025 19:07:39 +0200 Subject: [PATCH 09/10] fix searchbox width --- Source/Editor/Windows/ToolboxWindow.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Editor/Windows/ToolboxWindow.cs b/Source/Editor/Windows/ToolboxWindow.cs index 160084dd2..13ebf554d 100644 --- a/Source/Editor/Windows/ToolboxWindow.cs +++ b/Source/Editor/Windows/ToolboxWindow.cs @@ -152,9 +152,11 @@ namespace FlaxEditor.Windows }; _viewDropdown.Clicked += OnViewButtonClicked; - _searchBox = new SearchBox(false, _viewDropdown.Right + 2, 2, _groupSearch.Width - _viewDropdown.Right - 4) + _searchBox = new SearchBox { + AnchorPreset = AnchorPresets.HorizontalStretchTop, Parent = _groupSearch.Parent.Parent, + Bounds = new Rectangle(_viewDropdown.Right + 2, 2, _actorGroups.Width - 4, TextBoxBase.DefaultHeight), }; _searchBox.TextChanged += OnSearchBoxTextChanged; From 1704cfba4d06732eccada9ddf564bb5dad971b6e Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Fri, 25 Apr 2025 18:32:05 +0200 Subject: [PATCH 10/10] do not clear user search on script reload --- Source/Editor/Windows/ToolboxWindow.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Editor/Windows/ToolboxWindow.cs b/Source/Editor/Windows/ToolboxWindow.cs index 13ebf554d..1533d037a 100644 --- a/Source/Editor/Windows/ToolboxWindow.cs +++ b/Source/Editor/Windows/ToolboxWindow.cs @@ -204,7 +204,6 @@ namespace FlaxEditor.Windows private void OnScriptsReload() { // Prevent any references to actor types from the game assemblies that will be reloaded - _searchBox.Clear(); _groupSearch.DisposeChildren(); _groupSearch.PerformLayout(); @@ -228,6 +227,7 @@ namespace FlaxEditor.Windows private void OnScriptsReloadEnd() { RefreshActorTabs(); + OnSearchBoxTextChanged(); } private void RefreshActorTabs()