2017-09-26 14:45:27 +08:00
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
using OpenTK;
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Edit.Components.Timelines.Summary
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// The timeline that sits at the bottom of the editor.
|
|
|
|
/// </summary>
|
2017-11-17 17:26:13 +08:00
|
|
|
public class SummaryTimeline : BottomBarContainer
|
2017-09-26 14:45:27 +08:00
|
|
|
{
|
|
|
|
private readonly Drawable timelineBar;
|
|
|
|
|
|
|
|
public SummaryTimeline()
|
|
|
|
{
|
2017-09-26 16:56:16 +08:00
|
|
|
TimelinePart markerPart, controlPointPart, bookmarkPart, breakPart;
|
|
|
|
|
2017-11-17 17:26:13 +08:00
|
|
|
Children = new[]
|
2017-09-26 14:45:27 +08:00
|
|
|
{
|
2017-11-17 17:26:13 +08:00
|
|
|
markerPart = new MarkerPart { RelativeSizeAxes = Axes.Both },
|
|
|
|
controlPointPart = new ControlPointPart
|
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.BottomCentre,
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Height = 0.35f
|
|
|
|
},
|
|
|
|
bookmarkPart = new BookmarkPart
|
2017-09-26 16:56:16 +08:00
|
|
|
{
|
2017-11-17 17:26:13 +08:00
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.TopCentre,
|
2017-09-26 16:56:16 +08:00
|
|
|
RelativeSizeAxes = Axes.Both,
|
2017-11-17 17:26:13 +08:00
|
|
|
Height = 0.35f
|
|
|
|
},
|
|
|
|
timelineBar = new Container
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Children = new Drawable[]
|
2017-09-26 14:45:27 +08:00
|
|
|
{
|
2017-11-17 17:26:13 +08:00
|
|
|
new Circle
|
2017-09-26 14:45:27 +08:00
|
|
|
{
|
2017-11-17 17:26:13 +08:00
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
Origin = Anchor.CentreRight,
|
|
|
|
Size = new Vector2(5)
|
2017-09-26 16:56:16 +08:00
|
|
|
},
|
2017-11-17 17:26:13 +08:00
|
|
|
new Box
|
2017-09-26 16:56:16 +08:00
|
|
|
{
|
2017-11-17 17:26:13 +08:00
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
Origin = Anchor.CentreLeft,
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
Height = 1,
|
|
|
|
EdgeSmoothness = new Vector2(0, 1),
|
2017-09-26 16:56:16 +08:00
|
|
|
},
|
2017-11-17 17:26:13 +08:00
|
|
|
new Circle
|
2017-09-26 16:56:16 +08:00
|
|
|
{
|
2017-11-17 17:26:13 +08:00
|
|
|
Anchor = Anchor.CentreRight,
|
|
|
|
Origin = Anchor.CentreLeft,
|
|
|
|
Size = new Vector2(5)
|
2017-09-26 16:56:16 +08:00
|
|
|
},
|
2017-09-26 14:45:27 +08:00
|
|
|
}
|
2017-11-17 17:26:13 +08:00
|
|
|
},
|
|
|
|
breakPart = new BreakPart
|
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Height = 0.25f
|
2017-09-26 16:56:16 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
markerPart.Beatmap.BindTo(Beatmap);
|
|
|
|
controlPointPart.Beatmap.BindTo(Beatmap);
|
|
|
|
bookmarkPart.Beatmap.BindTo(Beatmap);
|
|
|
|
breakPart.Beatmap.BindTo(Beatmap);
|
2017-09-26 14:45:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2017-09-26 14:51:45 +08:00
|
|
|
private void load(OsuColour colours)
|
2017-09-26 14:45:27 +08:00
|
|
|
{
|
|
|
|
timelineBar.Colour = colours.Gray5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|