1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:07:52 +08:00

Pass all selected hitobjects to the selection blueprints

This commit is contained in:
smoogipoo 2018-11-15 21:01:06 +09:00
parent d5464702fa
commit df7515b66f
6 changed files with 13 additions and 6 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Input.Events;
@ -38,7 +39,7 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
Position = Parent.ToLocalSpace(HitObject.ToScreenSpace(Vector2.Zero));
}
public override void AdjustPosition(DragEvent dragEvent)
public override void AdjustPosition(DragEvent dragEvent, IEnumerable<DrawableHitObject> selectedObjects)
{
var objectParent = HitObject.Parent;

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
using osu.Framework.Input.Events;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Objects.Drawables;
@ -17,6 +18,6 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints
{
}
public override void AdjustPosition(DragEvent dragEvent) => OsuObject.Position += dragEvent.Delta;
public override void AdjustPosition(DragEvent dragEvent, IEnumerable<DrawableHitObject> selectedObjects) => OsuObject.Position += dragEvent.Delta;
}
}

View File

@ -1,7 +1,9 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
using osu.Framework.Input.Events;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
@ -25,6 +27,6 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
// Todo: This is temporary, since the slider circle masks don't do anything special yet. In the future they will handle input.
public override bool HandlePositionalInput => false;
public override void AdjustPosition(DragEvent dragEvent) => slider.Position += dragEvent.Delta;
public override void AdjustPosition(DragEvent dragEvent, IEnumerable<DrawableHitObject> selectedObjects) => slider.Position += dragEvent.Delta;
}
}

View File

@ -1,7 +1,9 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
using osu.Framework.Input.Events;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners.Components;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
@ -21,7 +23,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => piece.ReceivePositionalInputAt(screenSpacePos);
public override void AdjustPosition(DragEvent dragEvent)
public override void AdjustPosition(DragEvent dragEvent, IEnumerable<DrawableHitObject> selectedObjects)
{
// Spinners don't support position adjustments
}

View File

@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Collections.Generic;
using osu.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -134,7 +135,7 @@ namespace osu.Game.Rulesets.Edit
return true;
}
public abstract void AdjustPosition(DragEvent dragEvent);
public abstract void AdjustPosition(DragEvent dragEvent, IEnumerable<DrawableHitObject> selectedObjects);
/// <summary>
/// The screen-space point that causes this <see cref="SelectionBlueprint"/> to be selected.

View File

@ -64,7 +64,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
// Todo: Various forms of snapping
foreach (var blueprint in selectedBlueprints)
blueprint.AdjustPosition(dragEvent);
blueprint.AdjustPosition(dragEvent, selectedBlueprints.Select(b => b.HitObject));
}
protected override bool OnKeyDown(KeyDownEvent e)