1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 02:22:56 +08:00

Add change handler logic

This commit is contained in:
Dean Herbert 2020-10-02 17:32:34 +09:00
parent 066e9bb466
commit fc920a8899

View File

@ -27,6 +27,9 @@ namespace osu.Game.Screens.Edit.Timing
[Resolved]
private EditorClock clock { get; set; }
[Resolved(canBeNull: true)]
private IEditorChangeHandler changeHandler { get; set; }
[BackgroundDependencyLoader]
private void load()
{
@ -90,6 +93,8 @@ namespace osu.Game.Screens.Edit.Timing
private void changeSelectedGroupTime(in double time)
{
changeHandler?.BeginChange();
var currentGroupItems = SelectedGroup.Value.ControlPoints.ToArray();
Beatmap.Value.Beatmap.ControlPointInfo.RemoveGroup(SelectedGroup.Value);
@ -98,6 +103,8 @@ namespace osu.Game.Screens.Edit.Timing
Beatmap.Value.Beatmap.ControlPointInfo.Add(time, cp);
SelectedGroup.Value = Beatmap.Value.Beatmap.ControlPointInfo.GroupAt(time);
changeHandler?.EndChange();
}
}
}