1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 18:52:55 +08:00

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

@ -50,6 +50,8 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
public override void UpdatePosition(SnapResult result)
{
base.UpdatePosition(result);
if (!PlacementActive)
Column = (result as ManiaSnapResult)?.Column;
}

View File

@ -39,6 +39,10 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles
return base.OnMouseDown(e);
}
public override void UpdatePosition(SnapResult result) => HitObject.Position = ToLocalSpace(result.ScreenSpacePosition);
public override void UpdatePosition(SnapResult result)
{
base.UpdatePosition(result);
HitObject.Position = ToLocalSpace(result.ScreenSpacePosition);
}
}
}

View File

@ -69,6 +69,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
public override void UpdatePosition(SnapResult result)
{
base.UpdatePosition(result);
switch (state)
{
case PlacementState.Initial:

View File

@ -59,9 +59,5 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners
return true;
}
public override void UpdatePosition(SnapResult result)
{
}
}
}

View File

@ -244,8 +244,6 @@ namespace osu.Game.Rulesets.Edit
public void BeginPlacement(HitObject hitObject)
{
EditorBeatmap.PlacementObject.Value = hitObject;
hitObject.StartTime = SnapScreenSpacePositionToValidTime(inputManager.CurrentState.Mouse.Position).Time ?? EditorClock.CurrentTime;
}
public void EndPlacement(HitObject hitObject, bool commit)

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)"/>,