1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 04:47:24 +08:00

DragSelector -> HitObjectSelectionBox

This commit is contained in:
smoogipoo 2017-12-18 19:16:33 +09:00
parent 812181190e
commit 3999940538
4 changed files with 13 additions and 13 deletions

View File

@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
/// <summary>
/// A box that represents a drag selection.
/// </summary>
public class DragSelector : CompositeDrawable
public class HitObjectSelectionBox : CompositeDrawable
{
public readonly Bindable<SelectionInfo> Selection = new Bindable<SelectionInfo>();
@ -37,10 +37,10 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
private readonly Vector2 startPos;
/// <summary>
/// Creates a new <see cref="DragSelector"/>.
/// Creates a new <see cref="HitObjectSelectionBox"/>.
/// </summary>
/// <param name="startPos">The point at which the drag was initiated, in the parent's coordinates.</param>
public DragSelector(Vector2 startPos)
public HitObjectSelectionBox(Vector2 startPos)
{
this.startPos = startPos;

View File

@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
{
/// <summary>
/// Represents a marker visible on the border of a <see cref="MarkerContainer"/> which exposes
/// properties that are used to resize a <see cref="DragSelector"/>.
/// properties that are used to resize a <see cref="HitObjectSelectionBox"/>.
/// </summary>
public class Marker : CompositeDrawable
{

View File

@ -22,39 +22,39 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection
RelativeSizeAxes = Axes.Both;
}
private DragSelector selector;
private HitObjectSelectionBox selectionBoxBox;
protected override bool OnDragStart(InputState state)
{
// Hide the previous drag box - we won't be working with it any longer
selector?.Hide();
selectionBoxBox?.Hide();
AddInternal(selector = new DragSelector(ToLocalSpace(state.Mouse.NativeState.Position))
AddInternal(selectionBoxBox = new HitObjectSelectionBox(ToLocalSpace(state.Mouse.NativeState.Position))
{
CapturableObjects = playfield.HitObjects.Objects,
});
Selection.BindTo(selector.Selection);
Selection.BindTo(selectionBoxBox.Selection);
return true;
}
protected override bool OnDrag(InputState state)
{
selector.DragEndPosition = ToLocalSpace(state.Mouse.NativeState.Position);
selector.BeginCapture();
selectionBoxBox.DragEndPosition = ToLocalSpace(state.Mouse.NativeState.Position);
selectionBoxBox.BeginCapture();
return true;
}
protected override bool OnDragEnd(InputState state)
{
selector.FinishCapture();
selectionBoxBox.FinishCapture();
return true;
}
protected override bool OnClick(InputState state)
{
selector?.Hide();
selectionBoxBox?.Hide();
return true;
}
}

View File

@ -308,7 +308,7 @@
<Compile Include="Overlays\Profile\Sections\Ranks\ScoreModsContainer.cs" />
<Compile Include="Overlays\Settings\SettingsButton.cs" />
<Compile Include="Rulesets\Edit\Layers\Selection\CentreMarker.cs" />
<Compile Include="Rulesets\Edit\Layers\Selection\DragSelector.cs" />
<Compile Include="Rulesets\Edit\Layers\Selection\HitObjectSelectionBox.cs" />
<Compile Include="Rulesets\Edit\Layers\Selection\Marker.cs" />
<Compile Include="Rulesets\Edit\Layers\Selection\MarkerContainer.cs" />
<Compile Include="Rulesets\Edit\Layers\Selection\SelectionInfo.cs" />