From 2516820e4a32c6f6d06637134ad7b935145879f6 Mon Sep 17 00:00:00 2001 From: Saas Date: Fri, 3 Oct 2025 18:46:18 +0200 Subject: [PATCH 1/4] fix reloading scripts expands all folders --- Source/Editor/Windows/ContentWindow.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Editor/Windows/ContentWindow.cs b/Source/Editor/Windows/ContentWindow.cs index d0cf84251..390658add 100644 --- a/Source/Editor/Windows/ContentWindow.cs +++ b/Source/Editor/Windows/ContentWindow.cs @@ -1086,7 +1086,8 @@ namespace FlaxEditor.Windows _tree.Select(folder.Node); } - OnFoldersSearchBoxTextChanged(); + if (!string.IsNullOrWhiteSpace(_foldersSearchBox.Text)) + OnFoldersSearchBoxTextChanged(); } private void Refresh() From 7ba01a413fc198f68334cf6c5d1449d957973507 Mon Sep 17 00:00:00 2001 From: Saas Date: Fri, 3 Oct 2025 18:50:41 +0200 Subject: [PATCH 2/4] Revert "fix reloading scripts expands all folders" This reverts commit 2516820e4a32c6f6d06637134ad7b935145879f6. --- Source/Editor/Windows/ContentWindow.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/Editor/Windows/ContentWindow.cs b/Source/Editor/Windows/ContentWindow.cs index 390658add..d0cf84251 100644 --- a/Source/Editor/Windows/ContentWindow.cs +++ b/Source/Editor/Windows/ContentWindow.cs @@ -1086,8 +1086,7 @@ namespace FlaxEditor.Windows _tree.Select(folder.Node); } - if (!string.IsNullOrWhiteSpace(_foldersSearchBox.Text)) - OnFoldersSearchBoxTextChanged(); + OnFoldersSearchBoxTextChanged(); } private void Refresh() From 2d4843b1f41a6e5b2b2f5d5ca342e1ab8dc2a5e1 Mon Sep 17 00:00:00 2001 From: Saas Date: Fri, 3 Oct 2025 20:41:52 +0200 Subject: [PATCH 3/4] fix reloading scripts expanding scene tree #3701 --- Source/Editor/Content/Tree/ContentTreeNode.cs | 14 ++++++-------- Source/Editor/SceneGraph/GUI/ActorTreeNode.cs | 11 +++++------ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/Source/Editor/Content/Tree/ContentTreeNode.cs b/Source/Editor/Content/Tree/ContentTreeNode.cs index 8629296fc..ca629000d 100644 --- a/Source/Editor/Content/Tree/ContentTreeNode.cs +++ b/Source/Editor/Content/Tree/ContentTreeNode.cs @@ -175,15 +175,13 @@ namespace FlaxEditor.Content } } - bool isExpanded = isAnyChildVisible; - - if (isExpanded) + if (!noFilter) { - Expand(true); - } - else - { - Collapse(true); + bool isExpanded = isAnyChildVisible; + if (isExpanded) + Expand(true); + else + Collapse(true); } Visible = isThisVisible | isAnyChildVisible; diff --git a/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs b/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs index 5f56e918a..4607a4f63 100644 --- a/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs +++ b/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs @@ -324,13 +324,12 @@ namespace FlaxEditor.SceneGraph.GUI isExpanded = Editor.Instance.ProjectCache.IsExpandedActor(ref id); } - if (isExpanded) + if (!noFilter) { - Expand(true); - } - else - { - Collapse(true); + if (isExpanded) + Expand(true); + else + Collapse(true); } Visible = isThisVisible | isAnyChildVisible; From ec08a6ca7275bcc463a4a659767f960ce1b95e5d Mon Sep 17 00:00:00 2001 From: Saas Date: Fri, 3 Oct 2025 20:44:35 +0200 Subject: [PATCH 4/4] Reapply "Merge branch 'NoClearSearchboxesWhenStuffHappens' of https://github.com/xxSeys1/FlaxEngine into xxSeys1-NoClearSearchboxesWhenStuffHappens" This reverts commit 537d8b57ca2457496322754fdc3e630d16fe28a3. --- Source/Editor/Windows/ContentWindow.Search.cs | 1 + Source/Editor/Windows/ContentWindow.cs | 2 ++ Source/Editor/Windows/SceneTreeWindow.cs | 7 ++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Source/Editor/Windows/ContentWindow.Search.cs b/Source/Editor/Windows/ContentWindow.Search.cs index f28dc4834..5a0ed63aa 100644 --- a/Source/Editor/Windows/ContentWindow.Search.cs +++ b/Source/Editor/Windows/ContentWindow.Search.cs @@ -115,6 +115,7 @@ namespace FlaxEditor.Windows var root = _root; root.LockChildrenRecursive(); + PerformLayout(); // Update tree var query = _foldersSearchBox.Text; diff --git a/Source/Editor/Windows/ContentWindow.cs b/Source/Editor/Windows/ContentWindow.cs index 3d2ec4a66..d0cf84251 100644 --- a/Source/Editor/Windows/ContentWindow.cs +++ b/Source/Editor/Windows/ContentWindow.cs @@ -1085,6 +1085,8 @@ namespace FlaxEditor.Windows if (Editor.ContentDatabase.Find(_lastViewedFolderBeforeReload) is ContentFolder folder) _tree.Select(folder.Node); } + + OnFoldersSearchBoxTextChanged(); } private void Refresh() diff --git a/Source/Editor/Windows/SceneTreeWindow.cs b/Source/Editor/Windows/SceneTreeWindow.cs index 75a3723cf..ab6d2e262 100644 --- a/Source/Editor/Windows/SceneTreeWindow.cs +++ b/Source/Editor/Windows/SceneTreeWindow.cs @@ -68,6 +68,7 @@ namespace FlaxEditor.Windows TooltipText = "Search the scene tree.\n\nYou can prefix your search with different search operators:\ns: -> Actor with script of type\na: -> Actor type\nc: -> Control type", }; _searchBox.TextChanged += OnSearchBoxTextChanged; + ScriptsBuilder.ScriptsReloadEnd += OnSearchBoxTextChanged; // Scene tree panel _sceneTreePanel = new Panel @@ -112,7 +113,7 @@ namespace FlaxEditor.Windows InputActions.Add(options => options.LockFocusSelection, () => Editor.Windows.EditWin.Viewport.LockFocusSelection()); InputActions.Add(options => options.Rename, RenameSelection); } - + /// public override void OnPlayBeginning() { @@ -125,6 +126,7 @@ namespace FlaxEditor.Windows { base.OnPlayBegin(); _blockSceneTreeScroll = false; + OnSearchBoxTextChanged(); } /// @@ -139,6 +141,7 @@ namespace FlaxEditor.Windows { base.OnPlayEnd(); _blockSceneTreeScroll = true; + OnSearchBoxTextChanged(); } /// @@ -174,6 +177,7 @@ namespace FlaxEditor.Windows return; _tree.LockChildrenRecursive(); + PerformLayout(); // Update tree var query = _searchBox.Text; @@ -599,6 +603,7 @@ namespace FlaxEditor.Windows _dragHandlers = null; _tree = null; _searchBox = null; + ScriptsBuilder.ScriptsReloadEnd -= OnSearchBoxTextChanged; base.OnDestroy(); }