1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

Distinguish primary multi screen titles in header

This commit is contained in:
Bartłomiej Dach 2020-12-24 16:18:35 +01:00
parent db1c11073f
commit 6ec045f235
5 changed files with 12 additions and 6 deletions

View File

@ -23,7 +23,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
Children = new Drawable[]
{
screenStack,
new Header(screenStack)
new Header("Multiplayer", screenStack)
};
AddStep("push multi screen", () => screenStack.CurrentScreen.Push(new TestMultiplayerSubScreen(++index)));

View File

@ -22,7 +22,7 @@ namespace osu.Game.Screens.Multi
{
public const float HEIGHT = 80;
public Header(ScreenStack stack)
public Header(string mainTitle, ScreenStack stack)
{
RelativeSizeAxes = Axes.X;
Height = HEIGHT;
@ -45,7 +45,7 @@ namespace osu.Game.Screens.Multi
Padding = new MarginPadding { Left = WaveOverlayContainer.WIDTH_PADDING + OsuScreen.HORIZONTAL_OVERFLOW_PADDING },
Children = new Drawable[]
{
title = new MultiHeaderTitle
title = new MultiHeaderTitle(mainTitle)
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.BottomLeft,
@ -80,7 +80,7 @@ namespace osu.Game.Screens.Multi
set => pageTitle.Text = value.ShortTitle.Titleize();
}
public MultiHeaderTitle()
public MultiHeaderTitle(string mainTitle)
{
AutoSizeAxes = Axes.Both;
@ -98,7 +98,7 @@ namespace osu.Game.Screens.Multi
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Font = OsuFont.GetFont(size: 24),
Text = "Multiplayer"
Text = mainTitle
},
dot = new OsuSpriteText
{

View File

@ -127,7 +127,7 @@ namespace osu.Game.Screens.Multi
screenStack = new MultiplayerSubScreenStack { RelativeSizeAxes = Axes.Both }
}
},
new Header(screenStack),
new Header(ScreenTitle, screenStack),
createButton = CreateNewMultiplayerGameButton().With(button =>
{
button.Anchor = Anchor.TopRight;
@ -311,6 +311,8 @@ namespace osu.Game.Screens.Multi
protected IScreen CurrentSubScreen => screenStack.CurrentScreen;
protected abstract string ScreenTitle { get; }
protected abstract RoomManager CreateRoomManager();
protected abstract LoungeSubScreen CreateLounge();

View File

@ -62,6 +62,8 @@ namespace osu.Game.Screens.Multi.RealtimeMultiplayer
return room;
}
protected override string ScreenTitle => "Multiplayer";
protected override RoomManager CreateRoomManager() => new RealtimeRoomManager();
protected override LoungeSubScreen CreateLounge() => new RealtimeLoungeSubScreen();

View File

@ -51,6 +51,8 @@ namespace osu.Game.Screens.Multi.Timeshift
return new Room { Name = { Value = $"{API.LocalUser}'s awesome playlist" } };
}
protected override string ScreenTitle => "Playlists";
protected override RoomManager CreateRoomManager() => new TimeshiftRoomManager();
protected override LoungeSubScreen CreateLounge() => new TimeshiftLoungeSubScreen();