Add auto-selecting new item created in Content window
This commit is contained in:
@@ -418,19 +418,18 @@ namespace FlaxEditor.Windows
|
||||
// Refresh database and view now
|
||||
Editor.ContentDatabase.RefreshFolder(itemFolder, true);
|
||||
RefreshView();
|
||||
|
||||
if (endEvent != null)
|
||||
var newItem = itemFolder.FindChild(newPath);
|
||||
if (newItem == null)
|
||||
{
|
||||
var newItem = itemFolder.FindChild(newPath);
|
||||
if (newItem != null)
|
||||
{
|
||||
endEvent(newItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
Editor.LogWarning("Failed to find the created new item.");
|
||||
}
|
||||
Editor.LogWarning("Failed to find the created new item.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Auto-select item
|
||||
Select(newItem, true);
|
||||
|
||||
// Custom post-action
|
||||
endEvent?.Invoke(newItem);
|
||||
}
|
||||
|
||||
|
||||
@@ -611,7 +610,7 @@ namespace FlaxEditor.Windows
|
||||
|
||||
// Create asset name
|
||||
string extension = '.' + proxy.FileExtension;
|
||||
string path = StringUtils.CombinePaths(parentFolderPath, name + extension);
|
||||
string path = StringUtils.CombinePaths(parentFolderPath, name + extension);
|
||||
if (parentFolder.FindChild(path) != null)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
Reference in New Issue
Block a user