Add and place all the bottom bar objects

This commit is contained in:
EVAST9919 2017-11-17 12:26:13 +03:00
parent c1fd2a3950
commit d62da4334e
6 changed files with 130 additions and 73 deletions

View File

@ -0,0 +1,44 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
namespace osu.Game.Screens.Edit.Components
{
public class BottomBarContainer : Container
{
private const float corner_radius = 5;
private const float contents_padding = 15;
private readonly Drawable background;
private readonly Container content;
protected override Container<Drawable> Content => content;
public BottomBarContainer()
{
Masking = true;
CornerRadius = corner_radius;
InternalChildren = new[]
{
background = new Box { RelativeSizeAxes = Axes.Both },
content = new Container
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Horizontal = contents_padding },
}
};
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
background.Colour = colours.Gray1;
}
}
}

View File

@ -0,0 +1,9 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Screens.Edit.Components
{
public class PlaybackContainer : BottomBarContainer
{
}
}

View File

@ -0,0 +1,9 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Screens.Edit.Components
{
public class TimeInfoContainer : BottomBarContainer
{
}
}

View File

@ -16,31 +16,16 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary
/// <summary> /// <summary>
/// The timeline that sits at the bottom of the editor. /// The timeline that sits at the bottom of the editor.
/// </summary> /// </summary>
public class SummaryTimeline : CompositeDrawable public class SummaryTimeline : BottomBarContainer
{ {
private const float corner_radius = 5;
private const float contents_padding = 15;
public Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>(); public Bindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
private readonly Drawable background;
private readonly Drawable timelineBar; private readonly Drawable timelineBar;
public SummaryTimeline() public SummaryTimeline()
{ {
Masking = true;
CornerRadius = corner_radius;
TimelinePart markerPart, controlPointPart, bookmarkPart, breakPart; TimelinePart markerPart, controlPointPart, bookmarkPart, breakPart;
InternalChildren = new[]
{
background = new Box { RelativeSizeAxes = Axes.Both },
new Container
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Left = contents_padding, Right = contents_padding },
Children = new[] Children = new[]
{ {
markerPart = new MarkerPart { RelativeSizeAxes = Axes.Both }, markerPart = new MarkerPart { RelativeSizeAxes = Axes.Both },
@ -92,8 +77,6 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Height = 0.25f Height = 0.25f
} }
}
}
}; };
markerPart.Beatmap.BindTo(Beatmap); markerPart.Beatmap.BindTo(Beatmap);
@ -105,7 +88,6 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
background.Colour = colours.Gray1;
timelineBar.Colour = colours.Gray5; timelineBar.Colour = colours.Gray5;
} }
} }

View File

@ -17,6 +17,7 @@ using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Edit.Screens; using osu.Game.Screens.Edit.Screens;
using osu.Game.Screens.Edit.Screens.Compose; using osu.Game.Screens.Edit.Screens.Compose;
using osu.Game.Screens.Edit.Screens.Design; using osu.Game.Screens.Edit.Screens.Design;
using osu.Game.Screens.Edit.Components;
namespace osu.Game.Screens.Edit namespace osu.Game.Screens.Edit
{ {
@ -34,7 +35,9 @@ namespace osu.Game.Screens.Edit
public Editor() public Editor()
{ {
EditorMenuBar menuBar; EditorMenuBar menuBar;
TimeInfoContainer timeInfo;
SummaryTimeline timeline; SummaryTimeline timeline;
PlaybackContainer playback;
Children = new[] Children = new[]
{ {
@ -84,23 +87,30 @@ namespace osu.Game.Screens.Edit
new Container new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Top = 5, Bottom = 5, Left = 10, Right = 10 }, Padding = new MarginPadding { Vertical = 5, Horizontal = 10 },
Child = new FillFlowContainer Children = new Drawable[]
{ {
Name = "Bottom bar", timeInfo = new TimeInfoContainer
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal, Width = 0.17f
Spacing = new Vector2(10, 0), },
Children = new[]
{
timeline = new SummaryTimeline timeline = new SummaryTimeline
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Width = 0.65f Width = 0.65f
} },
} playback = new PlaybackContainer
{
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
RelativeSizeAxes = Axes.Both,
Width = 0.17f
},
} }
} }
} }

View File

@ -294,6 +294,9 @@
<Compile Include="Overlays\Profile\Sections\Ranks\DrawableTotalScore.cs" /> <Compile Include="Overlays\Profile\Sections\Ranks\DrawableTotalScore.cs" />
<Compile Include="Overlays\Profile\Sections\Ranks\ScoreModsContainer.cs" /> <Compile Include="Overlays\Profile\Sections\Ranks\ScoreModsContainer.cs" />
<Compile Include="Overlays\Settings\SettingsButton.cs" /> <Compile Include="Overlays\Settings\SettingsButton.cs" />
<Compile Include="Screens\Edit\Components\BottomBarContainer.cs" />
<Compile Include="Screens\Edit\Components\PlaybackContainer.cs" />
<Compile Include="Screens\Edit\Components\TimeInfoContainer.cs" />
<Compile Include="Screens\Edit\Screens\Compose\Timeline\BeatmapWaveformGraph.cs" /> <Compile Include="Screens\Edit\Screens\Compose\Timeline\BeatmapWaveformGraph.cs" />
<Compile Include="Beatmaps\Drawables\DifficultyColouredContainer.cs" /> <Compile Include="Beatmaps\Drawables\DifficultyColouredContainer.cs" />
<Compile Include="Beatmaps\Drawables\DifficultyIcon.cs" /> <Compile Include="Beatmaps\Drawables\DifficultyIcon.cs" />