mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Privatise the OsuGame beatmap, add local beatmap to OsuTestCase
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using OpenTK;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
@ -15,7 +16,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
||||
/// </summary>
|
||||
public abstract class TimelinePart : CompositeDrawable
|
||||
{
|
||||
public Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
|
||||
protected readonly IBindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
|
||||
|
||||
private readonly Container timeline;
|
||||
|
||||
@ -30,6 +31,12 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
||||
};
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(IGameBeatmap beatmap)
|
||||
{
|
||||
Beatmap.BindTo(beatmap);
|
||||
}
|
||||
|
||||
private void updateRelativeChildSize()
|
||||
{
|
||||
// the track may not be loaded completely (only has a length once it is).
|
||||
|
@ -20,19 +20,17 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours, IAdjustableClock adjustableClock)
|
||||
{
|
||||
TimelinePart markerPart, controlPointPart, bookmarkPart, breakPart;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
markerPart = new MarkerPart(adjustableClock) { RelativeSizeAxes = Axes.Both },
|
||||
controlPointPart = new ControlPointPart
|
||||
new MarkerPart(adjustableClock) { RelativeSizeAxes = Axes.Both },
|
||||
new ControlPointPart
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.BottomCentre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Height = 0.35f
|
||||
},
|
||||
bookmarkPart = new BookmarkPart
|
||||
new BookmarkPart
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.TopCentre,
|
||||
@ -67,7 +65,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary
|
||||
},
|
||||
}
|
||||
},
|
||||
breakPart = new BreakPart
|
||||
new BreakPart
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
@ -75,11 +73,6 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary
|
||||
Height = 0.25f
|
||||
}
|
||||
};
|
||||
|
||||
markerPart.Beatmap.BindTo(Beatmap);
|
||||
controlPointPart.Beatmap.BindTo(Beatmap);
|
||||
bookmarkPart.Beatmap.BindTo(Beatmap);
|
||||
breakPart.Beatmap.BindTo(Beatmap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user