mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 21:43:22 +08:00
Merge pull request #24577 from OliBomby/null-tracking
Fix tracking on empty control point groups
This commit is contained in:
commit
f51e2a92a1
@ -147,13 +147,25 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
trackedType = null;
|
||||
else
|
||||
{
|
||||
// If the selected group only has one control point, update the tracking type.
|
||||
if (selectedGroup.Value.ControlPoints.Count == 1)
|
||||
trackedType = selectedGroup.Value?.ControlPoints.Single().GetType();
|
||||
// If the selected group has more than one control point, choose the first as the tracking type
|
||||
// if we don't already have a singular tracked type.
|
||||
else if (trackedType == null)
|
||||
trackedType = selectedGroup.Value?.ControlPoints.FirstOrDefault()?.GetType();
|
||||
switch (selectedGroup.Value.ControlPoints.Count)
|
||||
{
|
||||
// If the selected group has no control points, clear the tracked type.
|
||||
// Otherwise the user will be unable to select a group with no control points.
|
||||
case 0:
|
||||
trackedType = null;
|
||||
break;
|
||||
|
||||
// If the selected group only has one control point, update the tracking type.
|
||||
case 1:
|
||||
trackedType = selectedGroup.Value?.ControlPoints.Single().GetType();
|
||||
break;
|
||||
|
||||
// If the selected group has more than one control point, choose the first as the tracking type
|
||||
// if we don't already have a singular tracked type.
|
||||
default:
|
||||
trackedType ??= selectedGroup.Value?.ControlPoints.FirstOrDefault()?.GetType();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (trackedType != null)
|
||||
|
Loading…
Reference in New Issue
Block a user