Allow different sizing modes for OverlinedParticipants

This commit is contained in:
smoogipoo
2020-02-19 17:37:01 +09:00
parent 380d200b46
commit ec73e8f0c7
6 changed files with 110 additions and 25 deletions

View File

@ -1,8 +1,10 @@
// 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.
using System;
using System.Collections.Generic;
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Screens.Multi.Components;
using osuTK;
@ -10,18 +12,46 @@ namespace osu.Game.Tests.Visual.Multiplayer
{
public class TestSceneOverlinedParticipants : MultiplayerTestScene
{
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(OverlinedParticipants),
typeof(OverlinedDisplay),
typeof(ParticipantsList)
};
protected override bool UseOnlineAPI => true;
public TestSceneOverlinedParticipants()
{
Room.RoomID.Value = 7;
}
Add(new Container
[Test]
public void TestHorizontalLayout()
{
AddStep("create component", () =>
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(500),
Child = new OverlinedParticipants()
Child = new OverlinedParticipants(Direction.Horizontal)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Width = 500,
AutoSizeAxes = Axes.Y,
};
});
}
[Test]
public void TestVerticalLayout()
{
AddStep("create component", () =>
{
Child = new OverlinedParticipants(Direction.Vertical)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(500)
};
});
}
}