Merge branch 'Tryibion-sel-prefab-clear-search'

This commit is contained in:
Wojtek Figat
2024-05-17 15:31:04 +02:00
3 changed files with 7 additions and 2 deletions

View File

@@ -75,7 +75,11 @@ namespace FlaxEditor.CustomEditors.Dedicated
// Selecting actor prefab asset
var selectPrefab = panel.Button("Select Prefab");
selectPrefab.Button.Clicked += () => Editor.Instance.Windows.ContentWin.Select(prefab);
selectPrefab.Button.Clicked += () =>
{
Editor.Instance.Windows.ContentWin.ClearItemsSearch();
Editor.Instance.Windows.ContentWin.Select(prefab);
};
// Viewing changes applied to this actor
var viewChanges = panel.Button("View Changes");

View File

@@ -202,6 +202,7 @@ namespace FlaxEditor.Modules
var prefabId = ((ActorNode)selection[0]).Actor.PrefabID;
var prefab = FlaxEngine.Content.LoadAsync<Prefab>(prefabId);
Editor.Windows.ContentWin.ClearItemsSearch();
Editor.Windows.ContentWin.Select(prefab);
}

View File

@@ -131,7 +131,7 @@ namespace FlaxEditor.Windows
public void ClearItemsSearch()
{
// Skip if already cleared
if (_itemsSearchBox.TextLength == 0 && !_viewDropdown.HasSelection)
if (_itemsSearchBox.TextLength == 0)
return;
IsLayoutLocked = true;