Merge branch 'input-settings-changes' of https://github.com/Menotdan/FlaxEngine into Menotdan-input-settings-changes
# Conflicts: # Source/Editor/Modules/UIModule.cs
This commit is contained in:
@@ -193,6 +193,7 @@ namespace FlaxEditor.Content.GUI
|
|||||||
OnDelete?.Invoke(_selection);
|
OnDelete?.Invoke(_selection);
|
||||||
}),
|
}),
|
||||||
new InputActionsContainer.Binding(options => options.SelectAll, SelectAll),
|
new InputActionsContainer.Binding(options => options.SelectAll, SelectAll),
|
||||||
|
new InputActionsContainer.Binding(options => options.DeselectAll, DeselectAll),
|
||||||
new InputActionsContainer.Binding(options => options.Rename, () =>
|
new InputActionsContainer.Binding(options => options.Rename, () =>
|
||||||
{
|
{
|
||||||
if (HasSelection && _selection[0].CanRename)
|
if (HasSelection && _selection[0].CanRename)
|
||||||
@@ -397,10 +398,7 @@ namespace FlaxEditor.Content.GUI
|
|||||||
PerformLayout();
|
PerformLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
private void BulkSelectUpdate(bool select = true)
|
||||||
/// Selects all the items.
|
|
||||||
/// </summary>
|
|
||||||
public void SelectAll()
|
|
||||||
{
|
{
|
||||||
// Lock layout
|
// Lock layout
|
||||||
var wasLayoutLocked = IsLayoutLocked;
|
var wasLayoutLocked = IsLayoutLocked;
|
||||||
@@ -408,13 +406,30 @@ namespace FlaxEditor.Content.GUI
|
|||||||
|
|
||||||
// Select items
|
// Select items
|
||||||
_selection.Clear();
|
_selection.Clear();
|
||||||
_selection.AddRange(_items);
|
if (select)
|
||||||
|
_selection.AddRange(_items);
|
||||||
|
|
||||||
// Unload and perform UI layout
|
// Unload and perform UI layout
|
||||||
IsLayoutLocked = wasLayoutLocked;
|
IsLayoutLocked = wasLayoutLocked;
|
||||||
PerformLayout();
|
PerformLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Selects all the items.
|
||||||
|
/// </summary>
|
||||||
|
public void SelectAll()
|
||||||
|
{
|
||||||
|
BulkSelectUpdate(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deselects all the items.
|
||||||
|
/// </summary>
|
||||||
|
public void DeselectAll()
|
||||||
|
{
|
||||||
|
BulkSelectUpdate(false);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Deselects the specified item.
|
/// Deselects the specified item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -484,6 +484,7 @@ namespace FlaxEditor.GUI
|
|||||||
cm.AddSeparator();
|
cm.AddSeparator();
|
||||||
cm.AddButton("Edit all keyframes", () => _editor.EditAllKeyframes(this, location));
|
cm.AddButton("Edit all keyframes", () => _editor.EditAllKeyframes(this, location));
|
||||||
cm.AddButton("Select all keyframes", _editor.SelectAll);
|
cm.AddButton("Select all keyframes", _editor.SelectAll);
|
||||||
|
cm.AddButton("Deselect all keyframes", _editor.DeselectAll);
|
||||||
cm.AddButton("Copy all keyframes", () =>
|
cm.AddButton("Copy all keyframes", () =>
|
||||||
{
|
{
|
||||||
_editor.SelectAll();
|
_editor.SelectAll();
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using System.Globalization;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using FlaxEditor.CustomEditors;
|
using FlaxEditor.CustomEditors;
|
||||||
using FlaxEditor.GUI.ContextMenu;
|
using FlaxEditor.GUI.ContextMenu;
|
||||||
|
using FlaxEditor.Options;
|
||||||
using FlaxEngine;
|
using FlaxEngine;
|
||||||
using FlaxEngine.GUI;
|
using FlaxEngine.GUI;
|
||||||
|
|
||||||
@@ -713,15 +714,28 @@ namespace FlaxEditor.GUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void BulkSelectUpdate(bool select = true)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < _points.Count; i++)
|
||||||
|
{
|
||||||
|
_points[i].IsSelected = select;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Selects all keyframes.
|
/// Selects all keyframes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SelectAll()
|
public void SelectAll()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _points.Count; i++)
|
BulkSelectUpdate(true);
|
||||||
{
|
}
|
||||||
_points[i].IsSelected = true;
|
|
||||||
}
|
/// <summary>
|
||||||
|
/// Deselects all keyframes.
|
||||||
|
/// </summary>
|
||||||
|
public void DeselectAll()
|
||||||
|
{
|
||||||
|
BulkSelectUpdate(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -926,34 +940,35 @@ namespace FlaxEditor.GUI
|
|||||||
if (base.OnKeyDown(key))
|
if (base.OnKeyDown(key))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
switch (key)
|
InputOptions options = Editor.Instance.Options.Options.Input;
|
||||||
|
if (options.SelectAll.Process(this))
|
||||||
|
{
|
||||||
|
SelectAll();
|
||||||
|
UpdateTangents();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (options.DeselectAll.Process(this))
|
||||||
|
{
|
||||||
|
DeselectAll();
|
||||||
|
UpdateTangents();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (options.Delete.Process(this))
|
||||||
{
|
{
|
||||||
case KeyboardKeys.Delete:
|
|
||||||
RemoveKeyframes();
|
RemoveKeyframes();
|
||||||
return true;
|
return true;
|
||||||
case KeyboardKeys.A:
|
|
||||||
if (Root.GetKey(KeyboardKeys.Control))
|
|
||||||
{
|
|
||||||
SelectAll();
|
|
||||||
UpdateTangents();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case KeyboardKeys.C:
|
|
||||||
if (Root.GetKey(KeyboardKeys.Control))
|
|
||||||
{
|
|
||||||
CopyKeyframes();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case KeyboardKeys.V:
|
|
||||||
if (Root.GetKey(KeyboardKeys.Control))
|
|
||||||
{
|
|
||||||
KeyframesEditorUtils.Paste(this);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
else if (options.Copy.Process(this))
|
||||||
|
{
|
||||||
|
CopyKeyframes();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (options.Paste.Process(this))
|
||||||
|
{
|
||||||
|
KeyframesEditorUtils.Paste(this);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using FlaxEditor.CustomEditors;
|
using FlaxEditor.CustomEditors;
|
||||||
using FlaxEditor.GUI.ContextMenu;
|
using FlaxEditor.GUI.ContextMenu;
|
||||||
|
using FlaxEditor.Options;
|
||||||
using FlaxEditor.Scripting;
|
using FlaxEditor.Scripting;
|
||||||
using FlaxEngine;
|
using FlaxEngine;
|
||||||
using FlaxEngine.GUI;
|
using FlaxEngine.GUI;
|
||||||
@@ -432,6 +433,7 @@ namespace FlaxEditor.GUI
|
|||||||
if (_editor.EnableKeyframesValueEdit)
|
if (_editor.EnableKeyframesValueEdit)
|
||||||
cm.AddButton("Edit all keyframes", () => _editor.EditAllKeyframes(this, location));
|
cm.AddButton("Edit all keyframes", () => _editor.EditAllKeyframes(this, location));
|
||||||
cm.AddButton("Select all keyframes", _editor.SelectAll).Enabled = _editor._points.Count > 0;
|
cm.AddButton("Select all keyframes", _editor.SelectAll).Enabled = _editor._points.Count > 0;
|
||||||
|
cm.AddButton("Deselect all keyframes", _editor.DeselectAll).Enabled = _editor._points.Count > 0;
|
||||||
cm.AddButton("Copy all keyframes", () =>
|
cm.AddButton("Copy all keyframes", () =>
|
||||||
{
|
{
|
||||||
_editor.SelectAll();
|
_editor.SelectAll();
|
||||||
@@ -1209,15 +1211,28 @@ namespace FlaxEditor.GUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void BulkSelectUpdate(bool select = true)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < _points.Count; i++)
|
||||||
|
{
|
||||||
|
_points[i].IsSelected = select;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Selects all keyframes.
|
/// Selects all keyframes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SelectAll()
|
public void SelectAll()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _points.Count; i++)
|
BulkSelectUpdate(true);
|
||||||
{
|
}
|
||||||
_points[i].IsSelected = true;
|
|
||||||
}
|
/// <summary>
|
||||||
|
/// Deselects all keyframes.
|
||||||
|
/// </summary>
|
||||||
|
public void DeselectAll()
|
||||||
|
{
|
||||||
|
BulkSelectUpdate(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -1268,33 +1283,33 @@ namespace FlaxEditor.GUI
|
|||||||
if (base.OnKeyDown(key))
|
if (base.OnKeyDown(key))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
switch (key)
|
InputOptions options = Editor.Instance.Options.Options.Input;
|
||||||
|
if (options.SelectAll.Process(this))
|
||||||
|
{
|
||||||
|
SelectAll();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (options.DeselectAll.Process(this))
|
||||||
|
{
|
||||||
|
DeselectAll();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (options.Delete.Process(this))
|
||||||
{
|
{
|
||||||
case KeyboardKeys.Delete:
|
|
||||||
RemoveKeyframes();
|
RemoveKeyframes();
|
||||||
return true;
|
return true;
|
||||||
case KeyboardKeys.A:
|
|
||||||
if (Root.GetKey(KeyboardKeys.Control))
|
|
||||||
{
|
|
||||||
SelectAll();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case KeyboardKeys.C:
|
|
||||||
if (Root.GetKey(KeyboardKeys.Control))
|
|
||||||
{
|
|
||||||
CopyKeyframes();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case KeyboardKeys.V:
|
|
||||||
if (Root.GetKey(KeyboardKeys.Control))
|
|
||||||
{
|
|
||||||
KeyframesEditorUtils.Paste(this);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
else if (options.Copy.Process(this))
|
||||||
|
{
|
||||||
|
CopyKeyframes();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (options.Paste.Process(this))
|
||||||
|
{
|
||||||
|
KeyframesEditorUtils.Paste(this);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using FlaxEditor.Options;
|
||||||
using FlaxEngine;
|
using FlaxEngine;
|
||||||
using FlaxEngine.Assertions;
|
using FlaxEngine.Assertions;
|
||||||
using FlaxEngine.GUI;
|
using FlaxEngine.GUI;
|
||||||
@@ -315,10 +316,7 @@ namespace FlaxEditor.GUI.Tree
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
private void BulkSelectUpdateExpanded(bool select = true)
|
||||||
/// Select all expanded nodes
|
|
||||||
/// </summary>
|
|
||||||
public void SelectAllExpanded()
|
|
||||||
{
|
{
|
||||||
if (_supportMultiSelect)
|
if (_supportMultiSelect)
|
||||||
{
|
{
|
||||||
@@ -327,7 +325,8 @@ namespace FlaxEditor.GUI.Tree
|
|||||||
|
|
||||||
// Update selection
|
// Update selection
|
||||||
Selection.Clear();
|
Selection.Clear();
|
||||||
WalkSelectExpandedTree(Selection, _children[0] as TreeNode);
|
if (select)
|
||||||
|
WalkSelectExpandedTree(Selection, _children[0] as TreeNode);
|
||||||
|
|
||||||
// Check if changed
|
// Check if changed
|
||||||
if (Selection.Count != prev.Count || !Selection.SequenceEqual(prev))
|
if (Selection.Count != prev.Count || !Selection.SequenceEqual(prev))
|
||||||
@@ -338,6 +337,22 @@ namespace FlaxEditor.GUI.Tree
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Select all expanded nodes
|
||||||
|
/// </summary>
|
||||||
|
public void SelectAllExpanded()
|
||||||
|
{
|
||||||
|
BulkSelectUpdateExpanded(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deselect all nodes
|
||||||
|
/// </summary>
|
||||||
|
public void DeselectAll()
|
||||||
|
{
|
||||||
|
BulkSelectUpdateExpanded(false);
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Update(float deltaTime)
|
public override void Update(float deltaTime)
|
||||||
{
|
{
|
||||||
@@ -472,14 +487,19 @@ namespace FlaxEditor.GUI.Tree
|
|||||||
// Check if can use multi selection
|
// Check if can use multi selection
|
||||||
if (_supportMultiSelect)
|
if (_supportMultiSelect)
|
||||||
{
|
{
|
||||||
bool isCtrlDown = Root.GetKey(KeyboardKeys.Control);
|
InputOptions options = Editor.Instance.Options.Options.Input;
|
||||||
|
|
||||||
// Select all expanded nodes
|
// Select all expanded nodes
|
||||||
if (key == KeyboardKeys.A && isCtrlDown)
|
if (options.SelectAll.Process(this))
|
||||||
{
|
{
|
||||||
SelectAllExpanded();
|
SelectAllExpanded();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if (options.DeselectAll.Process(this))
|
||||||
|
{
|
||||||
|
DeselectAll();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return base.OnKeyDown(key);
|
return base.OnKeyDown(key);
|
||||||
|
|||||||
@@ -60,13 +60,26 @@ namespace FlaxEditor.Modules
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void BulkScenesSelectUpdate(bool select = true)
|
||||||
|
{
|
||||||
|
// Blank list deselects all
|
||||||
|
Select(select ? Editor.Scene.Root.ChildNodes : new List<SceneGraphNode>());
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Selects all scenes.
|
/// Selects all scenes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SelectAllScenes()
|
public void SelectAllScenes()
|
||||||
{
|
{
|
||||||
// Select all scenes (linked to the root node)
|
BulkScenesSelectUpdate(true);
|
||||||
Select(Editor.Scene.Root.ChildNodes);
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deselects all scenes.
|
||||||
|
/// </summary>
|
||||||
|
public void DeselectAllScenes()
|
||||||
|
{
|
||||||
|
BulkScenesSelectUpdate(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ namespace FlaxEditor.Modules
|
|||||||
private ContextMenuButton _menuEditDelete;
|
private ContextMenuButton _menuEditDelete;
|
||||||
private ContextMenuButton _menuEditDuplicate;
|
private ContextMenuButton _menuEditDuplicate;
|
||||||
private ContextMenuButton _menuEditSelectAll;
|
private ContextMenuButton _menuEditSelectAll;
|
||||||
|
private ContextMenuButton _menuEditDeselectAll;
|
||||||
private ContextMenuButton _menuEditFind;
|
private ContextMenuButton _menuEditFind;
|
||||||
private ContextMenuButton _menuSceneMoveActorToViewport;
|
private ContextMenuButton _menuSceneMoveActorToViewport;
|
||||||
private ContextMenuButton _menuSceneAlignActorWithViewport;
|
private ContextMenuButton _menuSceneAlignActorWithViewport;
|
||||||
@@ -554,6 +555,7 @@ namespace FlaxEditor.Modules
|
|||||||
_menuEditDuplicate = cm.AddButton("Duplicate", inputOptions.Duplicate, Editor.SceneEditing.Duplicate);
|
_menuEditDuplicate = cm.AddButton("Duplicate", inputOptions.Duplicate, Editor.SceneEditing.Duplicate);
|
||||||
cm.AddSeparator();
|
cm.AddSeparator();
|
||||||
_menuEditSelectAll = cm.AddButton("Select all", inputOptions.SelectAll, Editor.SceneEditing.SelectAllScenes);
|
_menuEditSelectAll = cm.AddButton("Select all", inputOptions.SelectAll, Editor.SceneEditing.SelectAllScenes);
|
||||||
|
_menuEditDeselectAll = cm.AddButton("Deselect all", inputOptions.DeselectAll, Editor.SceneEditing.DeselectAllScenes);
|
||||||
_menuCreateParentForSelectedActors = cm.AddButton("Create parent for selected actors", Editor.SceneEditing.CreateParentForSelectedActors);
|
_menuCreateParentForSelectedActors = cm.AddButton("Create parent for selected actors", Editor.SceneEditing.CreateParentForSelectedActors);
|
||||||
_menuEditFind = cm.AddButton("Find", inputOptions.Search, Editor.Windows.SceneWin.Search);
|
_menuEditFind = cm.AddButton("Find", inputOptions.Search, Editor.Windows.SceneWin.Search);
|
||||||
cm.AddSeparator();
|
cm.AddSeparator();
|
||||||
@@ -673,6 +675,7 @@ namespace FlaxEditor.Modules
|
|||||||
_menuEditDelete.ShortKeys = inputOptions.Delete.ToString();
|
_menuEditDelete.ShortKeys = inputOptions.Delete.ToString();
|
||||||
_menuEditDuplicate.ShortKeys = inputOptions.Duplicate.ToString();
|
_menuEditDuplicate.ShortKeys = inputOptions.Duplicate.ToString();
|
||||||
_menuEditSelectAll.ShortKeys = inputOptions.SelectAll.ToString();
|
_menuEditSelectAll.ShortKeys = inputOptions.SelectAll.ToString();
|
||||||
|
_menuEditDeselectAll.ShortKeys = inputOptions.DeselectAll.ToString();
|
||||||
_menuEditFind.ShortKeys = inputOptions.Search.ToString();
|
_menuEditFind.ShortKeys = inputOptions.Search.ToString();
|
||||||
_menuGamePlayGame.ShortKeys = inputOptions.Play.ToString();
|
_menuGamePlayGame.ShortKeys = inputOptions.Play.ToString();
|
||||||
_menuGamePlayCurrentScenes.ShortKeys = inputOptions.PlayCurrentScenes.ToString();
|
_menuGamePlayCurrentScenes.ShortKeys = inputOptions.PlayCurrentScenes.ToString();
|
||||||
@@ -871,6 +874,7 @@ namespace FlaxEditor.Modules
|
|||||||
_menuEditDelete.Enabled = hasSthSelected;
|
_menuEditDelete.Enabled = hasSthSelected;
|
||||||
_menuEditDuplicate.Enabled = hasSthSelected;
|
_menuEditDuplicate.Enabled = hasSthSelected;
|
||||||
_menuEditSelectAll.Enabled = Level.IsAnySceneLoaded;
|
_menuEditSelectAll.Enabled = Level.IsAnySceneLoaded;
|
||||||
|
_menuEditDeselectAll.Enabled = hasSthSelected;
|
||||||
|
|
||||||
control.PerformLayout();
|
control.PerformLayout();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,10 @@ namespace FlaxEditor.Options
|
|||||||
[EditorDisplay("Common"), EditorOrder(190)]
|
[EditorDisplay("Common"), EditorOrder(190)]
|
||||||
public InputBinding SelectAll = new InputBinding(KeyboardKeys.A, KeyboardKeys.Control);
|
public InputBinding SelectAll = new InputBinding(KeyboardKeys.A, KeyboardKeys.Control);
|
||||||
|
|
||||||
|
[DefaultValue(typeof(InputBinding), "Ctrl+Shift+A")]
|
||||||
|
[EditorDisplay("Common"), EditorOrder(195)]
|
||||||
|
public InputBinding DeselectAll = new InputBinding(KeyboardKeys.A, KeyboardKeys.Shift, KeyboardKeys.Control);
|
||||||
|
|
||||||
[DefaultValue(typeof(InputBinding), "F")]
|
[DefaultValue(typeof(InputBinding), "F")]
|
||||||
[EditorDisplay("Common"), EditorOrder(200)]
|
[EditorDisplay("Common"), EditorOrder(200)]
|
||||||
public InputBinding FocusSelection = new InputBinding(KeyboardKeys.F);
|
public InputBinding FocusSelection = new InputBinding(KeyboardKeys.F);
|
||||||
|
|||||||
@@ -382,6 +382,7 @@ namespace FlaxEditor.Surface
|
|||||||
{
|
{
|
||||||
new InputActionsContainer.Binding(options => options.Delete, Delete),
|
new InputActionsContainer.Binding(options => options.Delete, Delete),
|
||||||
new InputActionsContainer.Binding(options => options.SelectAll, SelectAll),
|
new InputActionsContainer.Binding(options => options.SelectAll, SelectAll),
|
||||||
|
new InputActionsContainer.Binding(options => options.DeselectAll, DeselectAll),
|
||||||
new InputActionsContainer.Binding(options => options.Copy, Copy),
|
new InputActionsContainer.Binding(options => options.Copy, Copy),
|
||||||
new InputActionsContainer.Binding(options => options.Paste, Paste),
|
new InputActionsContainer.Binding(options => options.Paste, Paste),
|
||||||
new InputActionsContainer.Binding(options => options.Cut, Cut),
|
new InputActionsContainer.Binding(options => options.Cut, Cut),
|
||||||
@@ -611,17 +612,14 @@ namespace FlaxEditor.Surface
|
|||||||
_context.MarkAsModified(graphEdited);
|
_context.MarkAsModified(graphEdited);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
private void BulkSelectUpdate(bool select = true)
|
||||||
/// Selects all the nodes.
|
|
||||||
/// </summary>
|
|
||||||
public void SelectAll()
|
|
||||||
{
|
{
|
||||||
bool selectionChanged = false;
|
bool selectionChanged = false;
|
||||||
for (int i = 0; i < _rootControl.Children.Count; i++)
|
for (int i = 0; i < _rootControl.Children.Count; i++)
|
||||||
{
|
{
|
||||||
if (_rootControl.Children[i] is SurfaceControl control && !control.IsSelected)
|
if (_rootControl.Children[i] is SurfaceControl control && control.IsSelected != select)
|
||||||
{
|
{
|
||||||
control.IsSelected = true;
|
control.IsSelected = select;
|
||||||
selectionChanged = true;
|
selectionChanged = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -629,6 +627,22 @@ namespace FlaxEditor.Surface
|
|||||||
SelectionChanged?.Invoke();
|
SelectionChanged?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Selects all the nodes.
|
||||||
|
/// </summary>
|
||||||
|
public void SelectAll()
|
||||||
|
{
|
||||||
|
BulkSelectUpdate(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deelects all the nodes.
|
||||||
|
/// </summary>
|
||||||
|
public void DeselectAll()
|
||||||
|
{
|
||||||
|
BulkSelectUpdate(false);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clears the selection.
|
/// Clears the selection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1305,6 +1305,7 @@ namespace FlaxEditor.Utilities
|
|||||||
inputActions.Add(options => options.Paste, Editor.Instance.SceneEditing.Paste);
|
inputActions.Add(options => options.Paste, Editor.Instance.SceneEditing.Paste);
|
||||||
inputActions.Add(options => options.Duplicate, Editor.Instance.SceneEditing.Duplicate);
|
inputActions.Add(options => options.Duplicate, Editor.Instance.SceneEditing.Duplicate);
|
||||||
inputActions.Add(options => options.SelectAll, Editor.Instance.SceneEditing.SelectAllScenes);
|
inputActions.Add(options => options.SelectAll, Editor.Instance.SceneEditing.SelectAllScenes);
|
||||||
|
inputActions.Add(options => options.DeselectAll, Editor.Instance.SceneEditing.DeselectAllScenes);
|
||||||
inputActions.Add(options => options.Delete, Editor.Instance.SceneEditing.Delete);
|
inputActions.Add(options => options.Delete, Editor.Instance.SceneEditing.Delete);
|
||||||
inputActions.Add(options => options.Search, () => Editor.Instance.Windows.SceneWin.Search());
|
inputActions.Add(options => options.Search, () => Editor.Instance.Windows.SceneWin.Search());
|
||||||
inputActions.Add(options => options.MoveActorToViewport, Editor.Instance.UI.MoveActorToViewport);
|
inputActions.Add(options => options.MoveActorToViewport, Editor.Instance.UI.MoveActorToViewport);
|
||||||
|
|||||||
@@ -170,6 +170,8 @@ namespace FlaxEditor.Windows
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override bool OnKeyDown(KeyboardKeys key)
|
public override bool OnKeyDown(KeyboardKeys key)
|
||||||
{
|
{
|
||||||
|
InputOptions options = FlaxEditor.Editor.Instance.Options.Options.Input;
|
||||||
|
|
||||||
// Up
|
// Up
|
||||||
if (key == KeyboardKeys.ArrowUp)
|
if (key == KeyboardKeys.ArrowUp)
|
||||||
{
|
{
|
||||||
@@ -200,7 +202,7 @@ namespace FlaxEditor.Windows
|
|||||||
Open();
|
Open();
|
||||||
}
|
}
|
||||||
// Ctrl+C
|
// Ctrl+C
|
||||||
else if (key == KeyboardKeys.C && Root.GetKey(KeyboardKeys.Control))
|
else if (options.Copy.Process(this))
|
||||||
{
|
{
|
||||||
Copy();
|
Copy();
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ using FlaxEditor.GUI.ContextMenu;
|
|||||||
using FlaxEditor.GUI.Docking;
|
using FlaxEditor.GUI.Docking;
|
||||||
using FlaxEditor.GUI.Input;
|
using FlaxEditor.GUI.Input;
|
||||||
using FlaxEditor.GUI.Tree;
|
using FlaxEditor.GUI.Tree;
|
||||||
|
using FlaxEditor.Options;
|
||||||
using FlaxEditor.Scripting;
|
using FlaxEditor.Scripting;
|
||||||
using FlaxEditor.Surface;
|
using FlaxEditor.Surface;
|
||||||
using FlaxEditor.Windows;
|
using FlaxEditor.Windows;
|
||||||
@@ -142,6 +143,7 @@ namespace FlaxEngine.Windows.Search
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override bool OnKeyDown(KeyboardKeys key)
|
public override bool OnKeyDown(KeyboardKeys key)
|
||||||
{
|
{
|
||||||
|
InputOptions options = FlaxEditor.Editor.Instance.Options.Options.Input;
|
||||||
if (IsFocused)
|
if (IsFocused)
|
||||||
{
|
{
|
||||||
if (key == KeyboardKeys.Return && Navigate != null)
|
if (key == KeyboardKeys.Return && Navigate != null)
|
||||||
@@ -149,7 +151,7 @@ namespace FlaxEngine.Windows.Search
|
|||||||
Navigate.Invoke(this);
|
Navigate.Invoke(this);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (key == KeyboardKeys.C && Root.GetKey(KeyboardKeys.Control))
|
if (options.Copy.Process(this))
|
||||||
{
|
{
|
||||||
Clipboard.Text = Text;
|
Clipboard.Text = Text;
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
|
// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
#if FLAX_EDITOR
|
||||||
|
using FlaxEditor.Options;
|
||||||
|
#endif
|
||||||
using FlaxEngine.Assertions;
|
using FlaxEngine.Assertions;
|
||||||
using FlaxEngine.Utilities;
|
using FlaxEngine.Utilities;
|
||||||
|
|
||||||
@@ -1296,6 +1299,42 @@ namespace FlaxEngine.GUI
|
|||||||
bool ctrDown = window.GetKey(KeyboardKeys.Control);
|
bool ctrDown = window.GetKey(KeyboardKeys.Control);
|
||||||
KeyDown?.Invoke(key);
|
KeyDown?.Invoke(key);
|
||||||
|
|
||||||
|
// Handle controls that have bindings
|
||||||
|
#if FLAX_EDITOR
|
||||||
|
InputOptions options = FlaxEditor.Editor.Instance.Options.Options.Input;
|
||||||
|
if (options.Copy.Process(this))
|
||||||
|
{
|
||||||
|
Copy();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (options.Paste.Process(this))
|
||||||
|
{
|
||||||
|
Paste();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (options.Duplicate.Process(this))
|
||||||
|
{
|
||||||
|
Duplicate();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (options.Cut.Process(this))
|
||||||
|
{
|
||||||
|
Cut();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (options.SelectAll.Process(this))
|
||||||
|
{
|
||||||
|
SelectAll();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (options.DeselectAll.Process(this))
|
||||||
|
{
|
||||||
|
Deselect();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Handle controls without bindings
|
||||||
switch (key)
|
switch (key)
|
||||||
{
|
{
|
||||||
case KeyboardKeys.ArrowRight:
|
case KeyboardKeys.ArrowRight:
|
||||||
|
|||||||
Reference in New Issue
Block a user