Move right-click deletion logic to be handled at a SelectionBlueprint level

This commit is contained in:
Dean Herbert
2020-10-27 12:53:54 +09:00
parent 266596d404
commit 27c1a4c4d3
3 changed files with 20 additions and 5 deletions

View File

@ -8,10 +8,13 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events;
using osu.Game.Graphics.UserInterface;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Screens.Edit;
using osuTK;
using osuTK.Input;
namespace osu.Game.Rulesets.Edit
{
@ -52,6 +55,20 @@ namespace osu.Game.Rulesets.Edit
updateState();
}
[Resolved]
private EditorBeatmap editorBeatmap { get; set; }
protected override bool OnMouseDown(MouseDownEvent e)
{
if (e.CurrentState.Keyboard.ShiftPressed && e.IsPressed(MouseButton.Right))
{
editorBeatmap.Remove(HitObject);
return true;
}
return base.OnMouseDown(e);
}
private SelectionState state;
public event Action<SelectionState> StateChanged;