mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Begin refactoring SelectionBlueprint to handle non-drawable HitObjects
This commit is contained in:
@ -11,20 +11,24 @@ using osu.Game.Beatmaps;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
||||
{
|
||||
public class TimelinePart : TimelinePart<Drawable>
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a part of the summary timeline..
|
||||
/// </summary>
|
||||
public class TimelinePart : Container
|
||||
public class TimelinePart<T> : Container<T> where T : Drawable
|
||||
{
|
||||
protected readonly IBindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
|
||||
|
||||
private readonly Container timeline;
|
||||
private readonly Container<T> content;
|
||||
|
||||
protected override Container<Drawable> Content => timeline;
|
||||
protected override Container<T> Content => content;
|
||||
|
||||
public TimelinePart()
|
||||
public TimelinePart(Container<T> content = null)
|
||||
{
|
||||
AddInternal(timeline = new Container { RelativeSizeAxes = Axes.Both });
|
||||
AddInternal(this.content = content ?? new Container<T> { RelativeSizeAxes = Axes.Both });
|
||||
|
||||
Beatmap.ValueChanged += b =>
|
||||
{
|
||||
@ -44,17 +48,17 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
||||
// the track may not be loaded completely (only has a length once it is).
|
||||
if (!Beatmap.Value.Track.IsLoaded)
|
||||
{
|
||||
timeline.RelativeChildSize = Vector2.One;
|
||||
content.RelativeChildSize = Vector2.One;
|
||||
Schedule(updateRelativeChildSize);
|
||||
return;
|
||||
}
|
||||
|
||||
timeline.RelativeChildSize = new Vector2((float)Math.Max(1, Beatmap.Value.Track.Length), 1);
|
||||
content.RelativeChildSize = new Vector2((float)Math.Max(1, Beatmap.Value.Track.Length), 1);
|
||||
}
|
||||
|
||||
protected virtual void LoadBeatmap(WorkingBeatmap beatmap)
|
||||
{
|
||||
timeline.Clear();
|
||||
content.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user