1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-23 10:47:24 +08:00
osu-lazer/osu.Desktop.Tests/Visual/TestCaseUserPanel.cs

55 lines
2.2 KiB
C#
Raw Normal View History

2017-05-22 14:11:42 +08:00
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Users;
using OpenTK;
2017-05-22 14:11:42 +08:00
namespace osu.Desktop.Tests.Visual
2017-05-22 14:11:42 +08:00
{
internal class TestCaseUserPanel : OsuTestCase
2017-05-22 14:37:36 +08:00
{
public override string Description => @"Panels for displaying a user's status";
public TestCaseUserPanel()
2017-05-22 14:11:42 +08:00
{
UserPanel flyte;
UserPanel peppy;
Add(new FillFlowContainer
2017-05-22 14:11:42 +08:00
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
AutoSizeAxes = Axes.Both,
Spacing = new Vector2(10f),
Children = new[]
{
flyte = new UserPanel(new User
{
Username = @"flyte",
Id = 3103765,
Country = new Country { FlagName = @"JP" },
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c6.jpg"
}) { Width = 300 },
peppy = new UserPanel(new User
{
Username = @"peppy",
Id = 2,
Country = new Country { FlagName = @"AU" },
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg"
}) { Width = 300 },
},
2017-05-22 14:11:42 +08:00
});
flyte.Status.Value = new UserStatusOnline();
peppy.Status.Value = new UserStatusSoloGame();
2017-05-22 14:11:42 +08:00
AddStep(@"spectating", () => { flyte.Status.Value = new UserStatusSpectating(); });
AddStep(@"multiplaying", () => { flyte.Status.Value = new UserStatusMultiplayerGame(); });
AddStep(@"modding", () => { flyte.Status.Value = new UserStatusModding(); });
2017-05-22 14:32:02 +08:00
AddStep(@"offline", () => { flyte.Status.Value = new UserStatusOffline(); });
2017-05-24 11:45:56 +08:00
AddStep(@"null status", () => { flyte.Status.Value = null; });
2017-05-22 14:11:42 +08:00
}
}
}