1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-30 14:03:01 +08:00
osu-lazer/osu.Game.Tests/Visual/UserInterface/TestSceneUserCard.cs

63 lines
2.0 KiB
C#
Raw Normal View History

2020-03-04 13:41:21 +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.
using System;
using System.Collections.Generic;
using osu.Framework.Graphics;
2020-03-04 13:53:14 +08:00
using osu.Framework.Graphics.Containers;
2020-03-04 13:41:21 +08:00
using osu.Game.Graphics.UserInterfaceV2.Users;
using osu.Game.Users;
2020-03-04 13:53:14 +08:00
using osuTK;
2020-03-04 13:41:21 +08:00
namespace osu.Game.Tests.Visual.UserInterface
{
public class TestSceneUserCard : OsuTestScene
{
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(UserCard),
typeof(UserGridCard),
2020-03-04 13:53:14 +08:00
typeof(UserListCard)
2020-03-04 13:41:21 +08:00
};
public TestSceneUserCard()
{
2020-03-04 13:53:14 +08:00
Add(new FillFlowContainer
2020-03-04 13:41:21 +08:00
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
2020-03-04 13:53:14 +08:00
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Spacing = new Vector2(0, 10),
Children = new Drawable[]
{
new UserGridCard(new User
{
Username = @"flyte",
Id = 3103765,
Country = new Country { FlagName = @"JP" },
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c6.jpg"
})
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
},
new UserListCard(new User
{
Username = @"peppy",
Id = 2,
Country = new Country { FlagName = @"AU" },
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg",
IsSupporter = true,
SupportLevel = 3,
})
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
}
}
2020-03-04 13:41:21 +08:00
});
}
}
}