Update editor time when a new timing point is selected

This commit is contained in:
Dean Herbert 2019-10-22 20:17:19 +09:00
parent 25601ac17c
commit 81e8b678d3
1 changed files with 12 additions and 0 deletions

View File

@ -2,11 +2,13 @@
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Timing;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics;
@ -19,6 +21,9 @@ public class TimingScreen : EditorScreenWithTimeline
[Cached]
private Bindable<IEnumerable<ControlPoint>> selectedPoints = new Bindable<IEnumerable<ControlPoint>>();
[Resolved]
private IAdjustableClock clock { get; set; }
protected override Drawable CreateMainContent() => new GridContainer
{
RelativeSizeAxes = Axes.Both,
@ -37,6 +42,13 @@ public class TimingScreen : EditorScreenWithTimeline
}
};
protected override void LoadComplete()
{
base.LoadComplete();
selectedPoints.BindValueChanged(selected => { clock.Seek(selected.NewValue.First().Time); });
}
public class ControlPointList : CompositeDrawable
{
[Resolved]