2019-01-24 16:43:03 +08:00
|
|
|
|
// 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.
|
2018-05-16 07:34:14 +08:00
|
|
|
|
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using osu.Framework.Graphics;
|
2019-01-23 19:52:00 +08:00
|
|
|
|
using osu.Framework.Screens;
|
2018-12-22 13:29:27 +08:00
|
|
|
|
using osu.Game.Screens;
|
2018-05-16 07:34:14 +08:00
|
|
|
|
using osu.Game.Screens.Multi;
|
|
|
|
|
|
2019-03-25 00:02:36 +08:00
|
|
|
|
namespace osu.Game.Tests.Visual.Multiplayer
|
2018-05-16 07:34:14 +08:00
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
2019-05-15 03:37:25 +08:00
|
|
|
|
public class TestSceneMultiHeader : OsuTestScene
|
2018-05-16 07:34:14 +08:00
|
|
|
|
{
|
2019-05-15 03:37:25 +08:00
|
|
|
|
public TestSceneMultiHeader()
|
2018-05-16 07:34:14 +08:00
|
|
|
|
{
|
2018-12-22 13:29:27 +08:00
|
|
|
|
int index = 0;
|
|
|
|
|
|
2020-01-31 18:10:44 +08:00
|
|
|
|
OsuScreenStack screenStack = new OsuScreenStack { RelativeSizeAxes = Axes.Both };
|
|
|
|
|
|
|
|
|
|
screenStack.Push(new TestMultiplayerSubScreen(index));
|
2018-12-22 13:29:27 +08:00
|
|
|
|
|
2018-05-16 07:34:14 +08:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2019-01-23 19:52:00 +08:00
|
|
|
|
screenStack,
|
2020-12-24 23:18:35 +08:00
|
|
|
|
new Header("Multiplayer", screenStack)
|
2018-05-16 07:34:14 +08:00
|
|
|
|
};
|
2018-12-22 13:29:27 +08:00
|
|
|
|
|
2019-01-23 19:52:00 +08:00
|
|
|
|
AddStep("push multi screen", () => screenStack.CurrentScreen.Push(new TestMultiplayerSubScreen(++index)));
|
2018-12-22 13:29:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-12-26 19:05:57 +08:00
|
|
|
|
private class TestMultiplayerSubScreen : OsuScreen, IMultiplayerSubScreen
|
2018-12-22 13:29:27 +08:00
|
|
|
|
{
|
|
|
|
|
private readonly int index;
|
|
|
|
|
|
|
|
|
|
public string ShortTitle => $"Screen {index}";
|
|
|
|
|
|
2018-12-26 19:05:57 +08:00
|
|
|
|
public TestMultiplayerSubScreen(int index)
|
2018-12-22 13:29:27 +08:00
|
|
|
|
{
|
|
|
|
|
this.index = index;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string ToString() => ShortTitle;
|
2018-05-16 07:34:14 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|