mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
Move selection events to BlueprintContainer
This commit is contained in:
@ -6,8 +6,6 @@ using osu.Framework;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Input.States;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osuTK;
|
||||
@ -29,12 +27,6 @@ namespace osu.Game.Rulesets.Edit
|
||||
/// </summary>
|
||||
public event Action<SelectionBlueprint> Deselected;
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when this <see cref="SelectionBlueprint"/> has requested selection.
|
||||
/// Will fire even if already selected. Does not actually perform selection.
|
||||
/// </summary>
|
||||
public event Action<SelectionBlueprint, InputState> SelectionRequested;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="DrawableHitObject"/> which this <see cref="SelectionBlueprint"/> applies to.
|
||||
/// </summary>
|
||||
@ -99,33 +91,6 @@ namespace osu.Game.Rulesets.Edit
|
||||
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => DrawableObject.ReceivePositionalInputAt(screenSpacePos);
|
||||
|
||||
private bool selectionRequested;
|
||||
|
||||
protected override bool OnMouseDown(MouseDownEvent e)
|
||||
{
|
||||
selectionRequested = false;
|
||||
|
||||
if (State == SelectionState.NotSelected)
|
||||
{
|
||||
SelectionRequested?.Invoke(this, e.CurrentState);
|
||||
selectionRequested = true;
|
||||
}
|
||||
|
||||
return IsSelected;
|
||||
}
|
||||
|
||||
protected override bool OnClick(ClickEvent e)
|
||||
{
|
||||
if (State == SelectionState.Selected && !selectionRequested)
|
||||
{
|
||||
selectionRequested = true;
|
||||
SelectionRequested?.Invoke(this, e.CurrentState);
|
||||
return true;
|
||||
}
|
||||
|
||||
return base.OnClick(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The screen-space point that causes this <see cref="SelectionBlueprint"/> to be selected.
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user