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:
Wojtek Figat
2024-03-04 18:33:16 +01:00
13 changed files with 222 additions and 77 deletions

View File

@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using FlaxEditor.Options;
using FlaxEngine;
using FlaxEngine.Assertions;
using FlaxEngine.GUI;
@@ -315,10 +316,7 @@ namespace FlaxEditor.GUI.Tree
}
}
/// <summary>
/// Select all expanded nodes
/// </summary>
public void SelectAllExpanded()
private void BulkSelectUpdateExpanded(bool select = true)
{
if (_supportMultiSelect)
{
@@ -327,7 +325,8 @@ namespace FlaxEditor.GUI.Tree
// Update selection
Selection.Clear();
WalkSelectExpandedTree(Selection, _children[0] as TreeNode);
if (select)
WalkSelectExpandedTree(Selection, _children[0] as TreeNode);
// Check if changed
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 />
public override void Update(float deltaTime)
{
@@ -472,14 +487,19 @@ namespace FlaxEditor.GUI.Tree
// Check if can use multi selection
if (_supportMultiSelect)
{
bool isCtrlDown = Root.GetKey(KeyboardKeys.Control);
InputOptions options = Editor.Instance.Options.Options.Input;
// Select all expanded nodes
if (key == KeyboardKeys.A && isCtrlDown)
if (options.SelectAll.Process(this))
{
SelectAllExpanded();
return true;
}
else if (options.DeselectAll.Process(this))
{
DeselectAll();
return true;
}
}
return base.OnKeyDown(key);