1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 03:02:54 +08:00

Update bottom bar components to new design language (mostly)

This commit is contained in:
Dean Herbert 2022-05-25 23:17:52 +09:00
parent 8791e3b9ef
commit 2c61a9d3d1
6 changed files with 29 additions and 33 deletions

View File

@ -50,22 +50,9 @@ namespace osu.Game.Screens.Edit
{ {
new Drawable[] new Drawable[]
{ {
new Container new TimeInfoContainer { RelativeSizeAxes = Axes.Both },
{ new SummaryTimeline { RelativeSizeAxes = Axes.Both },
RelativeSizeAxes = Axes.Both, new PlaybackControl { RelativeSizeAxes = Axes.Both },
Padding = new MarginPadding { Right = 10 },
Child = new TimeInfoContainer { RelativeSizeAxes = Axes.Both },
},
new SummaryTimeline
{
RelativeSizeAxes = Axes.Both,
},
new Container
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Left = 10 },
Child = new PlaybackControl { RelativeSizeAxes = Axes.Both },
},
TestGameplayButton = new TestGameplayButton TestGameplayButton = new TestGameplayButton
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,

View File

@ -8,20 +8,19 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Graphics; using osuTK.Graphics;
namespace osu.Game.Screens.Edit.Components namespace osu.Game.Screens.Edit.Components
{ {
public class BottomBarContainer : Container public class BottomBarContainer : Container
{ {
private const float corner_radius = 5;
private const float contents_padding = 15; private const float contents_padding = 15;
protected readonly IBindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>(); protected readonly IBindable<WorkingBeatmap> Beatmap = new Bindable<WorkingBeatmap>();
protected readonly IBindable<Track> Track = new Bindable<Track>(); protected readonly IBindable<Track> Track = new Bindable<Track>();
private readonly Drawable background; protected readonly Drawable Background;
private readonly Container content; private readonly Container content;
protected override Container<Drawable> Content => content; protected override Container<Drawable> Content => content;
@ -29,11 +28,14 @@ namespace osu.Game.Screens.Edit.Components
public BottomBarContainer() public BottomBarContainer()
{ {
Masking = true; Masking = true;
CornerRadius = corner_radius;
InternalChildren = new[] InternalChildren = new[]
{ {
background = new Box { RelativeSizeAxes = Axes.Both }, Background = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Transparent,
},
content = new Container content = new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
@ -43,12 +45,10 @@ namespace osu.Game.Screens.Edit.Components
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(IBindable<WorkingBeatmap> beatmap, OsuColour colours, EditorClock clock) private void load(IBindable<WorkingBeatmap> beatmap, EditorClock clock)
{ {
Beatmap.BindTo(beatmap); Beatmap.BindTo(beatmap);
Track.BindTo(clock.Track); Track.BindTo(clock.Track);
background.Colour = colours.Gray1;
} }
} }
} }

View File

@ -16,6 +16,7 @@ using osu.Framework.Input.Events;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays;
using osuTK.Input; using osuTK.Input;
namespace osu.Game.Screens.Edit.Components namespace osu.Game.Screens.Edit.Components
@ -155,10 +156,10 @@ namespace osu.Game.Screens.Edit.Components
private Color4 normalColour; private Color4 normalColour;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OverlayColourProvider colourProvider)
{ {
text.Colour = normalColour = colours.YellowDarker; text.Colour = normalColour = colourProvider.Light3;
textBold.Colour = hoveredColour = colours.Yellow; textBold.Colour = hoveredColour = colourProvider.Content1;
} }
protected override bool OnHover(HoverEvent e) protected override bool OnHover(HoverEvent e)

View File

@ -6,18 +6,22 @@ using osu.Game.Graphics.Sprites;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Game.Extensions; using osu.Game.Extensions;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Overlays;
namespace osu.Game.Screens.Edit.Components namespace osu.Game.Screens.Edit.Components
{ {
public class TimeInfoContainer : BottomBarContainer public class TimeInfoContainer : BottomBarContainer
{ {
private readonly OsuSpriteText trackTimer; private OsuSpriteText trackTimer;
[Resolved] [Resolved]
private EditorClock editorClock { get; set; } private EditorClock editorClock { get; set; }
public TimeInfoContainer() [BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{ {
Background.Colour = colourProvider.Background5;
Children = new Drawable[] Children = new Drawable[]
{ {
trackTimer = new OsuSpriteText trackTimer = new OsuSpriteText

View File

@ -1,13 +1,13 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osuTK;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics; using osu.Game.Overlays;
using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts; using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts;
using osuTK;
namespace osu.Game.Screens.Edit.Components.Timelines.Summary namespace osu.Game.Screens.Edit.Components.Timelines.Summary
{ {
@ -17,8 +17,10 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary
public class SummaryTimeline : BottomBarContainer public class SummaryTimeline : BottomBarContainer
{ {
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OverlayColourProvider colourProvider)
{ {
Background.Colour = colourProvider.Background6;
Children = new Drawable[] Children = new Drawable[]
{ {
new MarkerPart { RelativeSizeAxes = Axes.Both }, new MarkerPart { RelativeSizeAxes = Axes.Both },
@ -41,7 +43,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary
{ {
Name = "centre line", Name = "centre line",
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = colours.Gray5, Colour = colourProvider.Background2,
Children = new Drawable[] Children = new Drawable[]
{ {
new Circle new Circle

View File

@ -28,6 +28,8 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary
BackgroundColour = colours.Orange1; BackgroundColour = colours.Orange1;
SpriteText.Colour = colourProvider.Background6; SpriteText.Colour = colourProvider.Background6;
Content.CornerRadius = 0;
Text = "Test!"; Text = "Test!";
} }
} }