osu/osu.Game.Tests/Visual/Online/TestSceneAccountCreationOve...

63 lines
1.8 KiB
C#
Raw Normal View History

// 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.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Overlays;
using osu.Game.Overlays.AccountCreation;
using osu.Game.Users;
2019-03-24 16:02:36 +00:00
namespace osu.Game.Tests.Visual.Online
{
public class TestSceneAccountCreationOverlay : OsuTestScene
{
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(ErrorTextFlowContainer),
typeof(AccountCreationBackground),
typeof(ScreenEntry),
typeof(ScreenWarning),
typeof(ScreenWelcome),
typeof(AccountCreationScreen),
};
2019-07-31 19:43:05 +00:00
private readonly Container userPanelArea;
private Bindable<User> localUser;
public TestSceneAccountCreationOverlay()
{
AccountCreationOverlay accountCreation;
Children = new Drawable[]
{
accountCreation = new AccountCreationOverlay(),
userPanelArea = new Container
{
Padding = new MarginPadding(10),
AutoSizeAxes = Axes.Both,
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
},
};
2019-07-31 19:43:05 +00:00
AddStep("show", () => accountCreation.Show());
}
[BackgroundDependencyLoader]
private void load()
2019-07-31 19:43:05 +00:00
{
API.Logout();
localUser = API.LocalUser.GetBoundCopy();
localUser.BindValueChanged(user => { userPanelArea.Child = new UserPanel(user.NewValue) { Width = 200 }; }, true);
AddStep("logout", API.Logout);
}
}
}