Merge pull request #2672 from DrabWeb/multiplayer-screen-type

Add Type property to MultiplayerScreen
This commit is contained in:
Dean Herbert
2018-05-31 11:42:33 +09:00
committed by GitHub
3 changed files with 10 additions and 5 deletions

View File

@ -20,7 +20,7 @@ namespace osu.Game.Screens.Multi
{ {
public const float HEIGHT = 121; public const float HEIGHT = 121;
private readonly OsuSpriteText screenTitle; private readonly OsuSpriteText screenType;
private readonly HeaderBreadcrumbControl breadcrumbs; private readonly HeaderBreadcrumbControl breadcrumbs;
public Header(Screen initialScreen) public Header(Screen initialScreen)
@ -67,7 +67,7 @@ namespace osu.Game.Screens.Multi
Text = "multiplayer ", Text = "multiplayer ",
TextSize = 25, TextSize = 25,
}, },
screenTitle = new OsuSpriteText screenType = new OsuSpriteText
{ {
TextSize = 25, TextSize = 25,
Font = @"Exo2.0-Light", Font = @"Exo2.0-Light",
@ -86,14 +86,14 @@ namespace osu.Game.Screens.Multi
}, },
}; };
breadcrumbs.Current.ValueChanged += s => screenTitle.Text = ((MultiplayerScreen)s).Title; breadcrumbs.Current.ValueChanged += s => screenType.Text = ((MultiplayerScreen)s).Type.ToLower();
breadcrumbs.Current.TriggerChange(); breadcrumbs.Current.TriggerChange();
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
screenTitle.Colour = colours.Yellow; screenType.Colour = colours.Yellow;
breadcrumbs.StripColour = colours.Green; breadcrumbs.StripColour = colours.Green;
} }

View File

@ -25,7 +25,7 @@ namespace osu.Game.Screens.Multi.Screens.Lounge
protected readonly FillFlowContainer<DrawableRoom> RoomsContainer; protected readonly FillFlowContainer<DrawableRoom> RoomsContainer;
protected readonly RoomInspector Inspector; protected readonly RoomInspector Inspector;
public override string Title => "lounge"; public override string Title => "Lounge";
protected override Container<Drawable> TransitionContent => content; protected override Container<Drawable> TransitionContent => content;

View File

@ -15,6 +15,11 @@ namespace osu.Game.Screens.Multi.Screens
protected virtual Container<Drawable> TransitionContent => Content; protected virtual Container<Drawable> TransitionContent => Content;
/// <summary>
/// The type to display in the title of the <see cref="Header"/>.
/// </summary>
public virtual string Type => Title;
protected override void OnEntering(Screen last) protected override void OnEntering(Screen last)
{ {
base.OnEntering(last); base.OnEntering(last);