mirror of
https://github.com/osukey/osukey.git
synced 2025-05-03 20:57:28 +09:00
Allow deselecting any selection in the editor using the Back
binding (escape key)
This commit is contained in:
parent
9869e815ce
commit
b14b1072c2
@ -16,6 +16,7 @@ using osu.Framework.Input;
|
|||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
using osu.Game.Input.Bindings;
|
||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Input;
|
using osuTK.Input;
|
||||||
@ -26,7 +27,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
/// A container which provides a "blueprint" display of items.
|
/// A container which provides a "blueprint" display of items.
|
||||||
/// Includes selection and manipulation support via a <see cref="Components.SelectionHandler{T}"/>.
|
/// Includes selection and manipulation support via a <see cref="Components.SelectionHandler{T}"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract partial class BlueprintContainer<T> : CompositeDrawable, IKeyBindingHandler<PlatformAction>
|
public abstract partial class BlueprintContainer<T> : CompositeDrawable, IKeyBindingHandler<PlatformAction>, IKeyBindingHandler<GlobalAction>
|
||||||
where T : class
|
where T : class
|
||||||
{
|
{
|
||||||
protected DragBox DragBox { get; private set; }
|
protected DragBox DragBox { get; private set; }
|
||||||
@ -279,6 +280,30 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
||||||
|
{
|
||||||
|
if (e.Repeat)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
switch (e.Action)
|
||||||
|
{
|
||||||
|
case GlobalAction.Back:
|
||||||
|
if (SelectedItems.Count > 0)
|
||||||
|
{
|
||||||
|
DeselectAll();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnReleased(KeyBindingReleaseEvent<GlobalAction> e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
#region Blueprint Addition/Removal
|
#region Blueprint Addition/Removal
|
||||||
|
|
||||||
protected virtual void AddBlueprintFor(T item)
|
protected virtual void AddBlueprintFor(T item)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user