mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 13:32:54 +08:00
MaskSelection -> SelectionBox
This commit is contained in:
parent
65bb91dcf7
commit
ad2836a61e
@ -28,7 +28,7 @@ namespace osu.Game.Tests.Visual
|
||||
{
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||
{
|
||||
typeof(MaskSelection),
|
||||
typeof(SelectionBox),
|
||||
typeof(DragBox),
|
||||
typeof(HitObjectComposer),
|
||||
typeof(OsuHitObjectComposer),
|
||||
|
@ -165,10 +165,10 @@ namespace osu.Game.Rulesets.Edit
|
||||
public virtual SelectionMask CreateMaskFor(DrawableHitObject hitObject) => null;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="MaskSelection"/> which outlines <see cref="DrawableHitObject"/>s
|
||||
/// Creates a <see cref="SelectionBox"/> which outlines <see cref="DrawableHitObject"/>s
|
||||
/// and handles hitobject pattern adjustments.
|
||||
/// </summary>
|
||||
public virtual MaskSelection CreateMaskSelection() => new MaskSelection();
|
||||
public virtual SelectionBox CreateMaskSelection() => new SelectionBox();
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="ScalableContainer"/> which provides a layer above or below the <see cref="Playfield"/>.
|
||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers
|
||||
public class BlueprintContainer : CompositeDrawable
|
||||
{
|
||||
private SelectionBlueprintContainer selectionBlueprints;
|
||||
private MaskSelection maskSelection;
|
||||
private SelectionBox selectionBox;
|
||||
|
||||
private IEnumerable<SelectionMask> aliveMasks => selectionBlueprints.Children.Where(c => c.IsAlive);
|
||||
|
||||
@ -33,16 +33,16 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
maskSelection = composer.CreateMaskSelection();
|
||||
maskSelection.DeselectAll = deselectAll;
|
||||
selectionBox = composer.CreateMaskSelection();
|
||||
selectionBox.DeselectAll = deselectAll;
|
||||
|
||||
var dragBox = new DragBox(select);
|
||||
dragBox.DragEnd += () => maskSelection.UpdateVisibility();
|
||||
dragBox.DragEnd += () => selectionBox.UpdateVisibility();
|
||||
|
||||
InternalChildren = new[]
|
||||
{
|
||||
dragBox,
|
||||
maskSelection,
|
||||
selectionBox,
|
||||
selectionBlueprints = new SelectionBlueprintContainer { RelativeSizeAxes = Axes.Both },
|
||||
dragBox.CreateProxy()
|
||||
};
|
||||
@ -117,19 +117,19 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers
|
||||
|
||||
private void onMaskSelected(SelectionMask mask)
|
||||
{
|
||||
maskSelection.HandleSelected(mask);
|
||||
selectionBox.HandleSelected(mask);
|
||||
selectionBlueprints.ChangeChildDepth(mask, 1);
|
||||
}
|
||||
|
||||
private void onMaskDeselected(SelectionMask mask)
|
||||
{
|
||||
maskSelection.HandleDeselected(mask);
|
||||
selectionBox.HandleDeselected(mask);
|
||||
selectionBlueprints.ChangeChildDepth(mask, 0);
|
||||
}
|
||||
|
||||
private void onSelectionRequested(SelectionMask mask, InputState state) => maskSelection.HandleSelectionRequested(mask, state);
|
||||
private void onSelectionRequested(SelectionMask mask, InputState state) => selectionBox.HandleSelectionRequested(mask, state);
|
||||
|
||||
private void onDragRequested(SelectionMask mask, Vector2 delta, InputState state) => maskSelection.HandleDrag(mask, delta, state);
|
||||
private void onDragRequested(SelectionMask mask, Vector2 delta, InputState state) => selectionBox.HandleDrag(mask, delta, state);
|
||||
|
||||
private class SelectionBlueprintContainer : Container<SelectionMask>
|
||||
{
|
||||
|
@ -46,7 +46,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers
|
||||
{
|
||||
Masking = true,
|
||||
BorderColour = Color4.White,
|
||||
BorderThickness = MaskSelection.BORDER_RADIUS,
|
||||
BorderThickness = SelectionBox.BORDER_RADIUS,
|
||||
Child = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
|
@ -21,7 +21,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers
|
||||
/// <summary>
|
||||
/// A box which surrounds <see cref="SelectionMask"/>s and provides interactive handles, context menus etc.
|
||||
/// </summary>
|
||||
public class MaskSelection : CompositeDrawable
|
||||
public class SelectionBox : CompositeDrawable
|
||||
{
|
||||
public const float BORDER_RADIUS = 2;
|
||||
|
||||
@ -32,7 +32,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers
|
||||
[Resolved]
|
||||
private IPlacementHandler placementHandler { get; set; }
|
||||
|
||||
public MaskSelection()
|
||||
public SelectionBox()
|
||||
{
|
||||
selectedMasks = new List<SelectionMask>();
|
||||
|
||||
@ -147,7 +147,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Updates whether this <see cref="MaskSelection"/> is visible.
|
||||
/// Updates whether this <see cref="SelectionBox"/> is visible.
|
||||
/// </summary>
|
||||
internal void UpdateVisibility()
|
||||
{
|
Loading…
Reference in New Issue
Block a user