1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 15:52:54 +08:00

Add UI support for redirecting the user to web registration

This commit is contained in:
Dean Herbert 2023-01-13 15:36:45 +09:00
parent a7327b02a2
commit 4d58e6d8d2

View File

@ -47,6 +47,9 @@ namespace osu.Game.Overlays.AccountCreation
[Resolved]
private GameHost host { get; set; }
[Resolved]
private OsuGame game { get; set; }
[BackgroundDependencyLoader]
private void load()
{
@ -193,11 +196,22 @@ namespace osu.Game.Overlays.AccountCreation
if (!success)
{
if (errors != null)
{
if (errors.User != null)
{
usernameDescription.AddErrors(errors.User.Username);
emailAddressDescription.AddErrors(errors.User.Email);
passwordDescription.AddErrors(errors.User.Password);
}
if (!string.IsNullOrEmpty(errors.Redirect))
{
if (!string.IsNullOrEmpty(errors.Message))
passwordDescription.AddErrors(new[] { errors.Message });
game.OpenUrlExternally(errors.Redirect);
}
}
else
{
passwordDescription.AddErrors(new[] { "Something happened... but we're not sure what." });