Merge branch 'i-beat-snapping' into timeline-maybe

This commit is contained in:
Dean Herbert
2020-01-23 15:37:54 +09:00
99 changed files with 467 additions and 322 deletions

View File

@ -262,10 +262,10 @@ namespace osu.Game.Screens.Edit.Compose.Components
return base.OnMouseDown(e);
}
protected override bool OnMouseUp(MouseUpEvent e)
protected override void OnMouseUp(MouseUpEvent e)
{
marker.Active = false;
return base.OnMouseUp(e);
base.OnMouseUp(e);
}
protected override bool OnClick(ClickEvent e)
@ -274,10 +274,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
return true;
}
protected override bool OnDrag(DragEvent e)
protected override void OnDrag(DragEvent e)
{
handleMouseInput(e.ScreenSpaceMousePosition);
return true;
}
private void handleMouseInput(Vector2 screenSpaceMousePosition)

View File

@ -143,14 +143,12 @@ namespace osu.Game.Screens.Edit.Compose.Components
return true;
}
protected override bool OnMouseUp(MouseUpEvent e)
protected override void OnMouseUp(MouseUpEvent e)
{
// Special case for when a drag happened instead of a click
Schedule(() => endClickSelection());
finishSelectionMovement();
return e.Button == MouseButton.Left;
}
protected override bool OnDragStart(DragStartEvent e)
@ -170,29 +168,27 @@ namespace osu.Game.Screens.Edit.Compose.Components
return false;
}
protected override bool OnDrag(DragEvent e)
protected override void OnDrag(DragEvent e)
{
if (e.Button == MouseButton.Right)
return false;
return;
if (DragBox.State == Visibility.Visible)
return DragBox.HandleDrag(e);
DragBox.HandleDrag(e);
return moveCurrentSelection(e);
moveCurrentSelection(e);
}
protected override bool OnDragEnd(DragEndEvent e)
protected override void OnDragEnd(DragEndEvent e)
{
if (e.Button == MouseButton.Right)
return false;
return;
if (DragBox.State == Visibility.Visible)
{
DragBox.Hide();
selectionHandler.UpdateVisibility();
}
return true;
}
protected override bool OnKeyDown(KeyDownEvent e)
@ -210,8 +206,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
return false;
}
protected override bool OnKeyUp(KeyUpEvent e) => false;
public bool OnPressed(PlatformAction action)
{
switch (action.ActionType)
@ -224,7 +218,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
return false;
}
public bool OnReleased(PlatformAction action) => false;
public void OnReleased(PlatformAction action)
{
}
#region Blueprint Addition/Removal

View File

@ -87,7 +87,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
return false;
}
public bool OnReleased(PlatformAction action) => action.ActionMethod == PlatformActionMethod.Delete;
public void OnReleased(PlatformAction action)
{
}
#endregion

View File

@ -148,10 +148,10 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
return false;
}
protected override bool OnMouseUp(MouseUpEvent e)
protected override void OnMouseUp(MouseUpEvent e)
{
endUserDrag();
return base.OnMouseUp(e);
base.OnMouseUp(e);
}
private void beginUserDrag()
@ -177,7 +177,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
public (Vector2 position, double time) GetSnappedPosition(Vector2 position, double time)
{
var targetTime = (position.X / Content.DrawWidth) * track.Length;
return (position, beatSnapProvider.SnapTime(targetTime, targetTime, beatSnapProvider.BeatDivisor));
return (position, beatSnapProvider.SnapTime(targetTime, targetTime));
}
public float GetBeatSnapDistanceAt(double referenceTime) => throw new NotImplementedException();

View File

@ -50,7 +50,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
DragBox.Alpha = 0;
}
protected override bool OnDrag(DragEvent e)
protected override void OnDrag(DragEvent e)
{
if (timeline != null)
{
@ -64,14 +64,14 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
timeline.ScrollBy((float)((mouseX - timelineQuad.TopLeft.X) / 10 * Clock.ElapsedFrameTime));
}
base.OnDrag(e);
lastDragEvent = e;
return base.OnDrag(e);
}
protected override bool OnDragEnd(DragEndEvent e)
protected override void OnDragEnd(DragEndEvent e)
{
base.OnDragEnd(e);
lastDragEvent = null;
return base.OnDragEnd(e);
}
protected override void Update()