mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 23:23:04 +08:00
Select another group after deleting selected
This commit is contained in:
parent
73369ae613
commit
81b5d7b79f
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -57,7 +58,7 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
private IBindableList<ControlPointGroup> controlGroups;
|
private IBindableList<ControlPointGroup> controlGroups;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
protected IFrameBasedClock EditorClock { get; private set; }
|
private IFrameBasedClock clock { get; set; }
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
protected IBindable<WorkingBeatmap> Beatmap { get; private set; }
|
protected IBindable<WorkingBeatmap> Beatmap { get; private set; }
|
||||||
@ -133,11 +134,13 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Beatmap.Value.Beatmap.ControlPointInfo.RemoveGroup(selectedGroup.Value);
|
Beatmap.Value.Beatmap.ControlPointInfo.RemoveGroup(selectedGroup.Value);
|
||||||
|
|
||||||
|
selectedGroup.Value = Beatmap.Value.Beatmap.ControlPointInfo.Groups.FirstOrDefault(g => g.Time >= clock.CurrentTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addNew()
|
private void addNew()
|
||||||
{
|
{
|
||||||
selectedGroup.Value = Beatmap.Value.Beatmap.ControlPointInfo.CreateGroup(EditorClock.CurrentTime);
|
selectedGroup.Value = Beatmap.Value.Beatmap.ControlPointInfo.CreateGroup(clock.CurrentTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user