Move selection drag events to BlueprintContainer

This commit is contained in:
smoogipoo
2019-10-23 18:58:15 +09:00
parent cef2318cf5
commit 714c89faa4
2 changed files with 42 additions and 44 deletions

View File

@ -35,21 +35,11 @@ namespace osu.Game.Rulesets.Edit
/// </summary>
public event Action<SelectionBlueprint, InputState> SelectionRequested;
/// <summary>
/// Invoked when this <see cref="SelectionBlueprint"/> has requested drag.
/// </summary>
public event Action<SelectionBlueprint, DragEvent> DragRequested;
/// <summary>
/// The <see cref="DrawableHitObject"/> which this <see cref="SelectionBlueprint"/> applies to.
/// </summary>
public readonly DrawableHitObject DrawableObject;
/// <summary>
/// The screen-space position of <see cref="DrawableObject"/> prior to handling a movement event.
/// </summary>
internal Vector2 ScreenSpaceMovementStartPosition { get; private set; }
protected override bool ShouldBeAlive => (DrawableObject.IsAlive && DrawableObject.IsPresent) || State == SelectionState.Selected;
public override bool HandlePositionalInput => ShouldBeAlive;
public override bool RemoveWhenNotAlive => false;
@ -136,18 +126,6 @@ namespace osu.Game.Rulesets.Edit
return base.OnClick(e);
}
protected override bool OnDragStart(DragStartEvent e)
{
ScreenSpaceMovementStartPosition = DrawableObject.ToScreenSpace(DrawableObject.OriginPosition);
return true;
}
protected override bool OnDrag(DragEvent e)
{
DragRequested?.Invoke(this, e);
return true;
}
/// <summary>
/// The screen-space point that causes this <see cref="SelectionBlueprint"/> to be selected.
/// </summary>