1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 12:33:01 +08:00

Rework+fix TestCaseMultiHeader

This commit is contained in:
smoogipoo 2018-12-22 14:29:27 +09:00
parent 7191233be8
commit dbd391825a
2 changed files with 25 additions and 8 deletions

View File

@ -3,8 +3,8 @@
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Game.Screens;
using osu.Game.Screens.Multi;
using osu.Game.Screens.Multi.Lounge;
namespace osu.Game.Tests.Visual
{
@ -13,15 +13,31 @@ namespace osu.Game.Tests.Visual
{
public TestCaseMultiHeader()
{
LoungeScreen loungeScreen;
int index = 0;
OsuScreen currentScreen = new TestMultiplayerScreen(index);
Children = new Drawable[]
{
loungeScreen = new LoungeScreen(null)
{
Padding = new MarginPadding { Top = Header.HEIGHT },
},
new Header(loungeScreen),
currentScreen,
new Header(currentScreen)
};
AddStep("push multi screen", () => currentScreen.Push(currentScreen = new TestMultiplayerScreen(++index)));
}
private class TestMultiplayerScreen : OsuScreen, IMultiplayerScreen
{
private readonly int index;
public string ShortTitle => $"Screen {index}";
public TestMultiplayerScreen(int index)
{
this.index = index;
}
public override string ToString() => ShortTitle;
}
}
}

View File

@ -103,7 +103,8 @@ namespace osu.Game.Screens.Multi
private class HeaderBreadcrumbControl : ScreenBreadcrumbControl
{
public HeaderBreadcrumbControl(Screen initialScreen) : base(initialScreen)
public HeaderBreadcrumbControl(Screen initialScreen)
: base(initialScreen)
{
}