mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 14:12:55 +08:00
Fix marker being cleared each beatmap change
This commit is contained in:
parent
708632bca8
commit
eae29820c0
@ -15,6 +15,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
||||
{
|
||||
protected override void LoadBeatmap(WorkingBeatmap beatmap)
|
||||
{
|
||||
base.LoadBeatmap(beatmap);
|
||||
foreach (int bookmark in beatmap.BeatmapInfo.Bookmarks)
|
||||
Add(new BookmarkVisualisation(bookmark));
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
||||
{
|
||||
protected override void LoadBeatmap(WorkingBeatmap beatmap)
|
||||
{
|
||||
base.LoadBeatmap(beatmap);
|
||||
foreach (var breakPeriod in beatmap.Beatmap.Breaks)
|
||||
Add(new BreakVisualisation(breakPeriod));
|
||||
}
|
||||
|
@ -18,6 +18,8 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
||||
{
|
||||
protected override void LoadBeatmap(WorkingBeatmap beatmap)
|
||||
{
|
||||
base.LoadBeatmap(beatmap);
|
||||
|
||||
ControlPointInfo cpi = beatmap.Beatmap.ControlPointInfo;
|
||||
|
||||
cpi.TimingPoints.ForEach(addTimingPoint);
|
||||
|
@ -7,6 +7,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
||||
@ -61,10 +62,14 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
marker.X = (float)(Beatmap.Value?.Track.CurrentTime ?? 0);
|
||||
}
|
||||
|
||||
protected override void LoadBeatmap(WorkingBeatmap beatmap)
|
||||
{
|
||||
// block base call so we don't clear our marker (can be reused on beatmap change).
|
||||
}
|
||||
|
||||
private class MarkerVisualisation : CompositeDrawable
|
||||
{
|
||||
public MarkerVisualisation()
|
||||
|
@ -25,7 +25,6 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
||||
|
||||
Beatmap.ValueChanged += b =>
|
||||
{
|
||||
timeline.Clear();
|
||||
timeline.RelativeChildSize = new Vector2((float)Math.Max(1, b.Track.Length), 1);
|
||||
LoadBeatmap(b);
|
||||
};
|
||||
@ -35,6 +34,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
||||
|
||||
protected virtual void LoadBeatmap(WorkingBeatmap beatmap)
|
||||
{
|
||||
timeline.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user