Merge pull request #6534 from smoogipoo/placement-blueprint-starttime

Make BeginPlacement() set the hitobject start time
This commit is contained in:
Dean Herbert 2019-10-18 16:25:38 +09:00 committed by GitHub
commit 50d4a9d726
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 4 additions and 9 deletions

View File

@ -49,10 +49,8 @@ protected override bool OnMouseDown(MouseDownEvent e)
if (Column == null)
return base.OnMouseDown(e);
HitObject.StartTime = TimeAt(e.ScreenSpaceMousePosition);
HitObject.Column = Column.Index;
BeginPlacement();
BeginPlacement(TimeAt(e.ScreenSpaceMousePosition));
return true;
}

View File

@ -30,7 +30,6 @@ protected override void Update()
protected override bool OnClick(ClickEvent e)
{
HitObject.StartTime = EditorClock.CurrentTime;
EndPlacement();
return true;
}

View File

@ -104,8 +104,6 @@ protected override bool OnDoubleClick(DoubleClickEvent e)
private void beginCurve()
{
BeginPlacement();
HitObject.StartTime = EditorClock.CurrentTime;
setState(PlacementState.Body);
}

View File

@ -41,8 +41,6 @@ protected override bool OnClick(ClickEvent e)
}
else
{
HitObject.StartTime = EditorClock.CurrentTime;
isPlacingEnd = true;
piece.FadeTo(1f, 150, Easing.OutQuint);

View File

@ -91,8 +91,10 @@ public PlacementState State
/// <summary>
/// Signals that the placement of <see cref="HitObject"/> has started.
/// </summary>
protected void BeginPlacement()
/// <param name="startTime">The start time of <see cref="HitObject"/> at the placement point. If null, the current clock time is used.</param>
protected void BeginPlacement(double? startTime = null)
{
HitObject.StartTime = startTime ?? EditorClock.CurrentTime;
placementHandler.BeginPlacement(HitObject);
PlacementBegun = true;
}