Fix summary timeline not updating to new track length correctly

This commit is contained in:
Dean Herbert
2020-09-24 21:05:29 +09:00
parent 833ff1c1d7
commit cc9ae32811

View File

@ -3,6 +3,7 @@
using System; using System;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Audio.Track;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osuTK; using osuTK;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -22,6 +23,8 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
{ {
protected readonly IBindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>(); protected readonly IBindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
protected readonly IBindable<Track> Track = new Bindable<Track>();
private readonly Container<T> content; private readonly Container<T> content;
protected override Container<T> Content => content; protected override Container<T> Content => content;
@ -35,12 +38,15 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
updateRelativeChildSize(); updateRelativeChildSize();
LoadBeatmap(b.NewValue); LoadBeatmap(b.NewValue);
}; };
Track.ValueChanged += _ => updateRelativeChildSize();
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(IBindable<WorkingBeatmap> beatmap) private void load(IBindable<WorkingBeatmap> beatmap, EditorClock clock)
{ {
Beatmap.BindTo(beatmap); Beatmap.BindTo(beatmap);
Track.BindTo(clock.Track);
} }
private void updateRelativeChildSize() private void updateRelativeChildSize()