2019-01-24 08:43:03 +00: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.
|
2018-12-04 11:33:29 +00:00
|
|
|
|
2018-12-06 02:58:09 +00:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
2019-03-22 02:55:35 +00:00
|
|
|
using osu.Framework.Allocation;
|
2019-09-13 08:15:33 +00:00
|
|
|
using osu.Framework.Bindables;
|
2019-03-22 02:55:35 +00:00
|
|
|
using osu.Framework.Graphics;
|
2018-12-04 11:33:29 +00:00
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Game.Overlays;
|
2018-12-06 02:58:09 +00:00
|
|
|
using osu.Game.Overlays.AccountCreation;
|
2019-03-22 02:55:35 +00:00
|
|
|
using osu.Game.Users;
|
2018-12-04 11:33:29 +00:00
|
|
|
|
2019-03-24 16:02:36 +00:00
|
|
|
namespace osu.Game.Tests.Visual.Online
|
2018-12-04 11:33:29 +00:00
|
|
|
{
|
2019-05-14 19:37:25 +00:00
|
|
|
public class TestSceneAccountCreationOverlay : OsuTestScene
|
2018-12-04 11:33:29 +00:00
|
|
|
{
|
2018-12-06 02:58:09 +00:00
|
|
|
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;
|
2019-03-22 02:55:35 +00:00
|
|
|
|
2019-09-13 08:15:33 +00:00
|
|
|
private Bindable<User> localUser;
|
|
|
|
|
2019-05-14 19:37:25 +00:00
|
|
|
public TestSceneAccountCreationOverlay()
|
2018-12-04 11:33:29 +00:00
|
|
|
{
|
2019-03-22 02:55:35 +00:00
|
|
|
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]
|
2019-09-13 08:15:33 +00:00
|
|
|
private void load()
|
2019-07-31 19:43:05 +00:00
|
|
|
{
|
2019-09-13 08:15:33 +00:00
|
|
|
API.Logout();
|
|
|
|
|
|
|
|
localUser = API.LocalUser.GetBoundCopy();
|
|
|
|
localUser.BindValueChanged(user => { userPanelArea.Child = new UserPanel(user.NewValue) { Width = 200 }; }, true);
|
2018-12-04 11:33:29 +00:00
|
|
|
|
2019-09-13 08:15:33 +00:00
|
|
|
AddStep("logout", API.Logout);
|
2018-12-04 11:33:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|