don't clear content panel folder- and scene tree search box on script reload and enter/ exit play

This commit is contained in:
Saas
2025-09-18 23:24:10 +02:00
parent afdd264e63
commit fd191f7ffb
3 changed files with 9 additions and 1 deletions

View File

@@ -115,6 +115,7 @@ namespace FlaxEditor.Windows
var root = _root;
root.LockChildrenRecursive();
PerformLayout();
// Update tree
var query = _foldersSearchBox.Text;

View File

@@ -1085,6 +1085,8 @@ namespace FlaxEditor.Windows
if (Editor.ContentDatabase.Find(_lastViewedFolderBeforeReload) is ContentFolder folder)
_tree.Select(folder.Node);
}
OnFoldersSearchBoxTextChanged();
}
private void Refresh()

View File

@@ -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);
}
/// <inheritdoc />
public override void OnPlayBeginning()
{
@@ -125,6 +126,7 @@ namespace FlaxEditor.Windows
{
base.OnPlayBegin();
_blockSceneTreeScroll = false;
OnSearchBoxTextChanged();
}
/// <inheritdoc />
@@ -139,6 +141,7 @@ namespace FlaxEditor.Windows
{
base.OnPlayEnd();
_blockSceneTreeScroll = true;
OnSearchBoxTextChanged();
}
/// <summary>
@@ -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();
}