2018-01-05 19:21:19 +08:00
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-10-04 20:10:01 +08:00
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
using OpenTK;
|
|
|
|
using osu.Framework.Configuration;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
|
|
|
|
2017-10-10 14:22:32 +08:00
|
|
|
namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
|
2017-10-04 20:10:01 +08:00
|
|
|
{
|
2018-04-05 18:40:03 +08:00
|
|
|
public class TimelineArea : CompositeDrawable
|
2017-10-04 20:10:01 +08:00
|
|
|
{
|
|
|
|
public readonly Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
|
|
|
|
|
2018-04-05 18:32:23 +08:00
|
|
|
private readonly Timeline timeline;
|
2017-10-04 20:10:01 +08:00
|
|
|
|
2018-04-05 18:40:03 +08:00
|
|
|
public TimelineArea()
|
2017-10-04 20:10:01 +08:00
|
|
|
{
|
|
|
|
Masking = true;
|
|
|
|
CornerRadius = 5;
|
|
|
|
|
2017-10-12 16:51:01 +08:00
|
|
|
OsuCheckbox hitObjectsCheckbox;
|
|
|
|
OsuCheckbox hitSoundsCheckbox;
|
2017-10-12 16:50:51 +08:00
|
|
|
OsuCheckbox waveformCheckbox;
|
2017-10-04 20:10:01 +08:00
|
|
|
InternalChildren = new Drawable[]
|
|
|
|
{
|
|
|
|
new Box
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Colour = OsuColour.FromHex("111")
|
|
|
|
},
|
2018-04-05 15:07:33 +08:00
|
|
|
new GridContainer
|
2017-10-04 20:10:01 +08:00
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2018-04-05 15:07:33 +08:00
|
|
|
Content = new[]
|
2017-10-04 20:10:01 +08:00
|
|
|
{
|
2018-04-05 15:07:33 +08:00
|
|
|
new Drawable[]
|
2017-10-04 20:10:01 +08:00
|
|
|
{
|
2018-04-05 15:07:33 +08:00
|
|
|
new Container
|
2017-10-04 20:10:01 +08:00
|
|
|
{
|
2018-04-05 15:07:33 +08:00
|
|
|
RelativeSizeAxes = Axes.Y,
|
|
|
|
AutoSizeAxes = Axes.X,
|
|
|
|
Children = new Drawable[]
|
2017-10-04 20:10:01 +08:00
|
|
|
{
|
2018-04-05 15:07:33 +08:00
|
|
|
new Box
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Colour = OsuColour.FromHex("222")
|
|
|
|
},
|
|
|
|
new FillFlowContainer
|
2017-10-04 20:10:01 +08:00
|
|
|
{
|
2018-04-05 15:07:33 +08:00
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
Origin = Anchor.CentreLeft,
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
Width = 160,
|
|
|
|
Padding = new MarginPadding { Horizontal = 15 },
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
Spacing = new Vector2(0, 4),
|
|
|
|
Children = new[]
|
|
|
|
{
|
|
|
|
hitObjectsCheckbox = new OsuCheckbox { LabelText = "Hitobjects" },
|
|
|
|
hitSoundsCheckbox = new OsuCheckbox { LabelText = "Hitsounds" },
|
|
|
|
waveformCheckbox = new OsuCheckbox { LabelText = "Waveform" }
|
|
|
|
}
|
2017-10-04 20:10:01 +08:00
|
|
|
}
|
|
|
|
}
|
2018-04-05 15:07:33 +08:00
|
|
|
},
|
|
|
|
new Container
|
2017-10-04 20:10:01 +08:00
|
|
|
{
|
2018-04-05 15:07:33 +08:00
|
|
|
RelativeSizeAxes = Axes.Y,
|
|
|
|
AutoSizeAxes = Axes.X,
|
|
|
|
Children = new Drawable[]
|
2017-10-04 20:10:01 +08:00
|
|
|
{
|
2018-04-05 15:07:33 +08:00
|
|
|
new Box
|
2017-10-04 20:10:01 +08:00
|
|
|
{
|
2018-04-05 15:07:33 +08:00
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Colour = OsuColour.FromHex("333")
|
|
|
|
},
|
|
|
|
new Container<TimelineButton>
|
|
|
|
{
|
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
Origin = Anchor.CentreLeft,
|
|
|
|
RelativeSizeAxes = Axes.Y,
|
|
|
|
AutoSizeAxes = Axes.X,
|
|
|
|
Masking = true,
|
|
|
|
Children = new[]
|
2017-10-04 20:10:01 +08:00
|
|
|
{
|
2018-04-05 15:07:33 +08:00
|
|
|
new TimelineButton
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Y,
|
|
|
|
Height = 0.5f,
|
|
|
|
Icon = FontAwesome.fa_search_plus,
|
2018-04-05 18:32:23 +08:00
|
|
|
Action = () => timeline.Zoom++
|
2018-04-05 15:07:33 +08:00
|
|
|
},
|
|
|
|
new TimelineButton
|
|
|
|
{
|
|
|
|
Anchor = Anchor.BottomLeft,
|
|
|
|
Origin = Anchor.BottomLeft,
|
|
|
|
RelativeSizeAxes = Axes.Y,
|
|
|
|
Height = 0.5f,
|
|
|
|
Icon = FontAwesome.fa_search_minus,
|
2018-04-05 18:32:23 +08:00
|
|
|
Action = () => timeline.Zoom--
|
2018-04-05 15:07:33 +08:00
|
|
|
},
|
|
|
|
}
|
2017-10-04 20:10:01 +08:00
|
|
|
}
|
|
|
|
}
|
2018-04-05 15:07:33 +08:00
|
|
|
},
|
2018-04-05 18:32:23 +08:00
|
|
|
timeline = new Timeline { RelativeSizeAxes = Axes.Both }
|
2017-10-04 20:10:01 +08:00
|
|
|
},
|
2018-04-05 15:07:33 +08:00
|
|
|
},
|
|
|
|
ColumnDimensions = new[]
|
|
|
|
{
|
|
|
|
new Dimension(GridSizeMode.AutoSize),
|
|
|
|
new Dimension(GridSizeMode.AutoSize),
|
|
|
|
new Dimension(GridSizeMode.Distributed),
|
2017-10-04 20:10:01 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-10-12 16:51:01 +08:00
|
|
|
hitObjectsCheckbox.Current.Value = true;
|
|
|
|
hitSoundsCheckbox.Current.Value = true;
|
2017-10-12 16:50:51 +08:00
|
|
|
waveformCheckbox.Current.Value = true;
|
|
|
|
|
2018-04-05 18:32:23 +08:00
|
|
|
timeline.Beatmap.BindTo(Beatmap);
|
|
|
|
timeline.WaveformVisible.BindTo(waveformCheckbox.Current);
|
2017-10-04 20:10:01 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|