Move responsibility placement blueprint's StartTime set to within

This commit is contained in:
Dean Herbert
2020-05-21 14:38:40 +09:00
parent bac78707de
commit a9a1c00cf1
6 changed files with 18 additions and 8 deletions

View File

@ -10,6 +10,7 @@ using osu.Framework.Timing;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Objects;
using osu.Game.Screens.Edit;
using osu.Game.Screens.Edit.Compose;
using osuTK;
@ -83,11 +84,18 @@ namespace osu.Game.Rulesets.Edit
PlacementActive = false;
}
[Resolved(canBeNull: true)]
private IFrameBasedClock editorClock { get; set; }
/// <summary>
/// Updates the position of this <see cref="PlacementBlueprint"/> to a new screen-space position.
/// </summary>
/// <param name="snapResult">The snap result information.</param>
public abstract void UpdatePosition(SnapResult snapResult);
public virtual void UpdatePosition(SnapResult snapResult)
{
if (!PlacementActive)
HitObject.StartTime = snapResult.Time ?? editorClock?.CurrentTime ?? Time.Current;
}
/// <summary>
/// Invokes <see cref="Objects.HitObject.ApplyDefaults(ControlPointInfo,BeatmapDifficulty)"/>,