2019-01-24 16:43:03 +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.
|
2018-12-04 19:33:29 +08:00
|
|
|
|
2018-12-06 10:58:09 +08:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
2019-03-22 10:55:35 +08:00
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
2018-12-04 19:33:29 +08:00
|
|
|
using osu.Framework.Graphics.Containers;
|
2019-03-22 10:55:35 +08:00
|
|
|
using osu.Game.Online.API;
|
2018-12-04 19:33:29 +08:00
|
|
|
using osu.Game.Overlays;
|
2018-12-06 10:58:09 +08:00
|
|
|
using osu.Game.Overlays.AccountCreation;
|
2019-03-22 10:55:35 +08:00
|
|
|
using osu.Game.Users;
|
2018-12-04 19:33:29 +08:00
|
|
|
|
2019-03-25 00:02:36 +08:00
|
|
|
namespace osu.Game.Tests.Visual.Online
|
2018-12-04 19:33:29 +08:00
|
|
|
{
|
2019-05-15 03:37:25 +08:00
|
|
|
public class TestSceneAccountCreationOverlay : OsuTestScene
|
2018-12-04 19:33:29 +08:00
|
|
|
{
|
2018-12-06 10:58:09 +08:00
|
|
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
|
|
|
{
|
|
|
|
typeof(ErrorTextFlowContainer),
|
|
|
|
typeof(AccountCreationBackground),
|
|
|
|
typeof(ScreenEntry),
|
|
|
|
typeof(ScreenWarning),
|
|
|
|
typeof(ScreenWelcome),
|
|
|
|
typeof(AccountCreationScreen),
|
|
|
|
};
|
|
|
|
|
2019-08-01 03:43:05 +08:00
|
|
|
private readonly Container userPanelArea;
|
2019-03-22 10:55:35 +08:00
|
|
|
|
2019-05-15 03:37:25 +08:00
|
|
|
public TestSceneAccountCreationOverlay()
|
2018-12-04 19:33:29 +08:00
|
|
|
{
|
2019-03-22 10:55:35 +08: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-08-01 03:43:05 +08:00
|
|
|
AddStep("show", () => accountCreation.Show());
|
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load(IAPIProvider api)
|
|
|
|
{
|
2019-03-22 10:55:35 +08:00
|
|
|
api.Logout();
|
|
|
|
api.LocalUser.BindValueChanged(user => { userPanelArea.Child = new UserPanel(user.NewValue) { Width = 200 }; }, true);
|
2018-12-04 19:33:29 +08:00
|
|
|
|
2019-08-01 03:43:05 +08:00
|
|
|
AddStep("logout", api.Logout);
|
2018-12-04 19:33:29 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|