1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-08 02:07:27 +08:00

Merge pull request #18509 from peppy/editor-new-control-point-is-bettert

Improve flow of adding new control points at timing screen
This commit is contained in:
Bartłomiej Dach 2022-06-01 20:52:13 +02:00 committed by GitHub
commit be9c8566b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,7 +144,27 @@ namespace osu.Game.Screens.Edit.Timing
private void addNew() private void addNew()
{ {
selectedGroup.Value = Beatmap.ControlPointInfo.GroupAt(clock.CurrentTime, true); bool isFirstControlPoint = !Beatmap.ControlPointInfo.TimingPoints.Any();
var group = Beatmap.ControlPointInfo.GroupAt(clock.CurrentTime, true);
if (isFirstControlPoint)
group.Add(new TimingControlPoint());
else
{
// Try and create matching types from the currently selected control point.
var selected = selectedGroup.Value;
if (selected != null)
{
foreach (var controlPoint in selected.ControlPoints)
{
group.Add(controlPoint.DeepClone());
}
}
}
selectedGroup.Value = group;
} }
} }
} }