mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
DragLayer -> DragBox
This commit is contained in:
@ -29,7 +29,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||||
{
|
{
|
||||||
typeof(MaskSelection),
|
typeof(MaskSelection),
|
||||||
typeof(DragLayer),
|
typeof(DragBox),
|
||||||
typeof(HitObjectComposer),
|
typeof(HitObjectComposer),
|
||||||
typeof(OsuHitObjectComposer),
|
typeof(OsuHitObjectComposer),
|
||||||
typeof(HitObjectMaskLayer),
|
typeof(HitObjectMaskLayer),
|
||||||
|
@ -8,15 +8,14 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics.Primitives;
|
using osu.Framework.Graphics.Primitives;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Rulesets.Edit;
|
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Edit.Screens.Compose.Layers
|
namespace osu.Game.Screens.Edit.Screens.Compose.Layers
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A layer that handles and displays drag selection for a collection of <see cref="SelectionMask"/>s.
|
/// A box that displays the drag selection and provides selection events for users to handle.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DragLayer : CompositeDrawable
|
public class DragBox : CompositeDrawable
|
||||||
{
|
{
|
||||||
private readonly Action<RectangleF> performSelection;
|
private readonly Action<RectangleF> performSelection;
|
||||||
|
|
||||||
@ -28,10 +27,10 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers
|
|||||||
private Drawable box;
|
private Drawable box;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new <see cref="DragLayer"/>.
|
/// Creates a new <see cref="DragBox"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="maskContainer">The selectable <see cref="SelectionMask"/>s.</param>
|
/// <param name="performSelection">A delegate that performs drag selection.</param>
|
||||||
public DragLayer(Action<RectangleF> performSelection)
|
public DragBox(Action<RectangleF> performSelection)
|
||||||
{
|
{
|
||||||
this.performSelection = performSelection;
|
this.performSelection = performSelection;
|
||||||
|
|
@ -37,15 +37,15 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers
|
|||||||
|
|
||||||
maskSelection.DeselectAll = maskContainer.DeselectAll;
|
maskSelection.DeselectAll = maskContainer.DeselectAll;
|
||||||
|
|
||||||
var dragLayer = new DragLayer(maskContainer.Select);
|
var dragBox = new DragBox(maskContainer.Select);
|
||||||
dragLayer.DragEnd += () => maskSelection.UpdateVisibility();
|
dragBox.DragEnd += () => maskSelection.UpdateVisibility();
|
||||||
|
|
||||||
InternalChildren = new[]
|
InternalChildren = new[]
|
||||||
{
|
{
|
||||||
dragLayer,
|
dragBox,
|
||||||
maskSelection,
|
maskSelection,
|
||||||
maskContainer,
|
maskContainer,
|
||||||
dragLayer.CreateProxy()
|
dragBox.CreateProxy()
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (var obj in composer.HitObjects)
|
foreach (var obj in composer.HitObjects)
|
||||||
|
Reference in New Issue
Block a user