mirror of https://github.com/ppy/osu
Baisc UserListCard implementation
This commit is contained in:
parent
f425233527
commit
1b5222f396
|
@ -4,8 +4,10 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Graphics.UserInterfaceV2.Users;
|
using osu.Game.Graphics.UserInterfaceV2.Users;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.UserInterface
|
namespace osu.Game.Tests.Visual.UserInterface
|
||||||
{
|
{
|
||||||
|
@ -15,11 +17,21 @@ public class TestSceneUserCard : OsuTestScene
|
||||||
{
|
{
|
||||||
typeof(UserCard),
|
typeof(UserCard),
|
||||||
typeof(UserGridCard),
|
typeof(UserGridCard),
|
||||||
|
typeof(UserListCard)
|
||||||
};
|
};
|
||||||
|
|
||||||
public TestSceneUserCard()
|
public TestSceneUserCard()
|
||||||
{
|
{
|
||||||
Add(new UserGridCard(new User
|
Add(new FillFlowContainer
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Spacing = new Vector2(0, 10),
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new UserGridCard(new User
|
||||||
{
|
{
|
||||||
Username = @"flyte",
|
Username = @"flyte",
|
||||||
Id = 3103765,
|
Id = 3103765,
|
||||||
|
@ -29,6 +41,21 @@ public TestSceneUserCard()
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = 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,
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
// 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 osu.Game.Users;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
|
||||||
|
namespace osu.Game.Graphics.UserInterfaceV2.Users
|
||||||
|
{
|
||||||
|
public class UserListCard : UserCard
|
||||||
|
{
|
||||||
|
public UserListCard(User user)
|
||||||
|
: base(user)
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
|
Height = 40;
|
||||||
|
CornerRadius = 6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue