mirror of https://github.com/ppy/osu
Update editor time when a new timing point is selected
This commit is contained in:
parent
25601ac17c
commit
81e8b678d3
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue