Refactor new scene tree double click feature to support both prefab and scene editing
#1502
This commit is contained in:
@@ -8,6 +8,7 @@ using FlaxEditor.Content;
|
||||
using FlaxEditor.GUI;
|
||||
using FlaxEditor.GUI.Drag;
|
||||
using FlaxEditor.GUI.Tree;
|
||||
using FlaxEditor.Options;
|
||||
using FlaxEditor.Scripting;
|
||||
using FlaxEditor.Utilities;
|
||||
using FlaxEditor.Windows;
|
||||
@@ -15,7 +16,6 @@ using FlaxEditor.Windows.Assets;
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.GUI;
|
||||
using FlaxEngine.Utilities;
|
||||
using Object = FlaxEngine.Object;
|
||||
|
||||
namespace FlaxEditor.SceneGraph.GUI
|
||||
{
|
||||
@@ -393,7 +393,7 @@ namespace FlaxEditor.SceneGraph.GUI
|
||||
/// <summary>
|
||||
/// Starts the actor renaming action.
|
||||
/// </summary>
|
||||
public void StartRenaming(EditorWindow window, Panel treePanel = null)
|
||||
public void StartRenaming(EditorWindow window = null, Panel treePanel = null)
|
||||
{
|
||||
// Block renaming during scripts reload
|
||||
if (Editor.Instance.ProgressReporting.CompileScripts.IsActive)
|
||||
@@ -461,6 +461,30 @@ namespace FlaxEditor.SceneGraph.GUI
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool OnMouseDoubleClickHeader(ref Float2 location, MouseButton button)
|
||||
{
|
||||
if (button == MouseButton.Left)
|
||||
{
|
||||
var sceneContext = this.GetSceneContext();
|
||||
switch (Editor.Instance.Options.Options.Input.DoubleClickSceneNode)
|
||||
{
|
||||
case SceneNodeDoubleClick.RenameActor:
|
||||
sceneContext.RenameSelection();
|
||||
return true;
|
||||
case SceneNodeDoubleClick.FocusActor:
|
||||
sceneContext.FocusSelection();
|
||||
return true;
|
||||
case SceneNodeDoubleClick.OpenPrefab:
|
||||
Editor.Instance.Prefabs.OpenPrefab(ActorNode);
|
||||
return true;
|
||||
case SceneNodeDoubleClick.Expand:
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
return base.OnMouseDoubleClickHeader(ref location, button);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override DragDropEffect OnDragEnterHeader(DragData data)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user