Add main content nodes to not be duplicated.

This commit is contained in:
Chandler Cox
2023-11-21 15:40:34 -06:00
parent fe53317ec7
commit 94f1dff497
2 changed files with 9 additions and 1 deletions

View File

@@ -28,6 +28,11 @@ namespace FlaxEditor.Content
/// Whether this node can be deleted. /// Whether this node can be deleted.
/// </summary> /// </summary>
protected virtual bool _canDelete => true; protected virtual bool _canDelete => true;
/// <summary>
/// Whether this node can be duplicated.
/// </summary>
protected virtual bool _canDuplicate => true;
/// <summary> /// <summary>
/// Gets the content folder item. /// Gets the content folder item.
@@ -315,7 +320,7 @@ namespace FlaxEditor.Content
switch (key) switch (key)
{ {
case KeyboardKeys.D: case KeyboardKeys.D:
if (Folder.Exists) if (Folder.Exists && _canDuplicate)
Editor.Instance.Windows.ContentWin.Duplicate(Folder); Editor.Instance.Windows.ContentWin.Duplicate(Folder);
return true; return true;
} }

View File

@@ -15,6 +15,9 @@ namespace FlaxEditor.Content
/// <inheritdoc /> /// <inheritdoc />
protected override bool _canDelete => false; protected override bool _canDelete => false;
/// <inheritdoc />
protected override bool _canDuplicate => false;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="MainContentTreeNode"/> class. /// Initializes a new instance of the <see cref="MainContentTreeNode"/> class.
/// </summary> /// </summary>