Merge branch 'master' into resume-cursor-2

This commit is contained in:
Dean Herbert
2019-03-29 15:56:46 +09:00
committed by GitHub
9 changed files with 197 additions and 127 deletions

View File

@ -5,13 +5,10 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Screens;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays.SearchableList;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Screens.Multi
@ -20,11 +17,11 @@ namespace osu.Game.Screens.Multi
{
public const float HEIGHT = 121;
private readonly OsuSpriteText screenType;
private readonly HeaderBreadcrumbControl breadcrumbs;
public Header(ScreenStack stack)
{
MultiHeaderTitle title;
RelativeSizeAxes = Axes.X;
Height = HEIGHT;
@ -41,39 +38,11 @@ namespace osu.Game.Screens.Multi
Padding = new MarginPadding { Horizontal = SearchableListOverlay.WIDTH_PADDING + OsuScreen.HORIZONTAL_OVERFLOW_PADDING },
Children = new Drawable[]
{
new FillFlowContainer
title = new MultiHeaderTitle
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.BottomLeft,
Position = new Vector2(-35f, 5f),
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(10f, 0f),
Children = new Drawable[]
{
new SpriteIcon
{
Size = new Vector2(25),
Icon = OsuIcon.Multi,
},
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Children = new[]
{
new OsuSpriteText
{
Text = "multiplayer ",
Font = OsuFont.GetFont(size: 25)
},
screenType = new OsuSpriteText
{
Font = OsuFont.GetFont(weight: FontWeight.Light, size: 25)
},
},
},
},
X = -35,
},
breadcrumbs = new HeaderBreadcrumbControl(stack)
{
@ -85,10 +54,10 @@ namespace osu.Game.Screens.Multi
},
};
breadcrumbs.Current.ValueChanged += scren =>
breadcrumbs.Current.ValueChanged += screen =>
{
if (scren.NewValue is IMultiplayerSubScreen multiScreen)
screenType.Text = multiScreen.ShortTitle.ToLowerInvariant();
if (screen.NewValue is IMultiplayerSubScreen multiScreen)
title.Screen = multiScreen;
};
breadcrumbs.Current.TriggerChange();
@ -97,10 +66,25 @@ namespace osu.Game.Screens.Multi
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
screenType.Colour = colours.Yellow;
breadcrumbs.StripColour = colours.Green;
}
private class MultiHeaderTitle : ScreenTitle
{
public IMultiplayerSubScreen Screen
{
set => Section = value.ShortTitle.ToLowerInvariant();
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Title = "multiplayer";
Icon = OsuIcon.Multi;
AccentColour = colours.Yellow;
}
}
private class HeaderBreadcrumbControl : ScreenBreadcrumbControl
{
public HeaderBreadcrumbControl(ScreenStack stack)