Double click actions + open prefab ctxmenu
This commit is contained in:
@@ -346,6 +346,29 @@ namespace FlaxEditor.Windows
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool OnMouseDoubleClick(Float2 location, MouseButton button)
|
||||
{
|
||||
if(button == MouseButton.Left)
|
||||
{
|
||||
switch (Editor.Options.Options.Input.DoubleClickSceneNode)
|
||||
{
|
||||
case SceneNodeDoubleClick.Rename:
|
||||
Rename();
|
||||
return true;
|
||||
case SceneNodeDoubleClick.Focus:
|
||||
Editor.Windows.EditWin.Viewport.FocusSelection();
|
||||
return true;
|
||||
case SceneNodeDoubleClick.Open:
|
||||
return Editor.Prefabs.OpenPrefab();
|
||||
case SceneNodeDoubleClick.None:
|
||||
default:
|
||||
return base.OnMouseDoubleClick(location, button);
|
||||
}
|
||||
}
|
||||
return base.OnMouseDoubleClick(location, button);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnLostFocus()
|
||||
@@ -459,4 +482,28 @@ namespace FlaxEditor.Windows
|
||||
base.OnDestroy();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Action to perform when a Scene Node receive a double mouse click (Left)
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public enum SceneNodeDoubleClick
|
||||
{
|
||||
/// <summary>
|
||||
/// No action is performed
|
||||
/// </summary>
|
||||
None,
|
||||
/// <summary>
|
||||
/// Rename the Scene Node
|
||||
/// </summary>
|
||||
Rename,
|
||||
/// <summary>
|
||||
/// Focus the Scene Node object in the Scene View
|
||||
/// </summary>
|
||||
Focus,
|
||||
/// <summary>
|
||||
/// If possible, open the scene node in an associated Editor (e.g. Prefab Editor)
|
||||
/// </summary>
|
||||
Open
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user