Refactor CurveEditor and KeyframesEditor to use input options.

This commit is contained in:
Menotdan
2023-12-08 17:38:58 -05:00
parent 526edb83de
commit bcce52ca22
2 changed files with 39 additions and 47 deletions

View File

@@ -7,6 +7,7 @@ using System.Linq;
using System.Text;
using FlaxEditor.CustomEditors;
using FlaxEditor.GUI.ContextMenu;
using FlaxEditor.Options;
using FlaxEditor.Scripting;
using FlaxEngine;
using FlaxEngine.GUI;
@@ -1268,33 +1269,28 @@ namespace FlaxEditor.GUI
if (base.OnKeyDown(key))
return true;
switch (key)
InputOptions options = Editor.Instance.Options.Options.Input;
if (options.SelectAll.Process(this))
{
SelectAll();
return true;
}
else if (options.Delete.Process(this))
{
case KeyboardKeys.Delete:
RemoveKeyframes();
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;
}