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-06 02:58:09 +00:00
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2018-12-06 06:49:06 +00:00
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
using osu.Framework.Graphics.Textures;
|
2018-12-06 07:54:08 +00:00
|
|
|
using osu.Framework.Screens;
|
2018-12-06 02:58:09 +00:00
|
|
|
using osu.Game.Graphics;
|
|
|
|
using osu.Game.Graphics.Containers;
|
|
|
|
using osu.Game.Graphics.Sprites;
|
|
|
|
using osu.Game.Online.API;
|
|
|
|
using osu.Game.Overlays.Settings;
|
|
|
|
using osu.Game.Screens.Menu;
|
|
|
|
using osuTK;
|
|
|
|
using osuTK.Graphics;
|
2023-01-16 18:31:01 +00:00
|
|
|
using osu.Game.Localisation;
|
2018-12-06 02:58:09 +00:00
|
|
|
|
|
|
|
namespace osu.Game.Overlays.AccountCreation
|
|
|
|
{
|
|
|
|
public partial class ScreenWarning : AccountCreationScreen
|
|
|
|
{
|
2024-02-02 05:54:18 +00:00
|
|
|
private OsuTextFlowContainer multiAccountExplanationText = null!;
|
|
|
|
private LinkFlowContainer furtherAssistance = null!;
|
2020-02-14 13:14:00 +00:00
|
|
|
|
2024-02-02 05:54:18 +00:00
|
|
|
[Resolved]
|
|
|
|
private IAPIProvider? api { get; set; }
|
2018-12-06 02:58:09 +00:00
|
|
|
|
2024-02-02 05:54:18 +00:00
|
|
|
[Resolved]
|
|
|
|
private OsuGame? game { get; set; }
|
2021-05-18 21:23:22 +00:00
|
|
|
|
2018-12-06 03:17:08 +00:00
|
|
|
private const string help_centre_url = "/help/wiki/Help_Centre#login";
|
2018-12-06 02:58:09 +00:00
|
|
|
|
2022-04-21 15:52:44 +00:00
|
|
|
public override void OnEntering(ScreenTransitionEvent e)
|
2018-12-06 07:54:08 +00:00
|
|
|
{
|
2021-05-19 21:06:21 +00:00
|
|
|
if (string.IsNullOrEmpty(api?.ProvidedUsername) || game?.UseDevelopmentServer == true)
|
2018-12-06 07:54:08 +00:00
|
|
|
{
|
2019-01-23 11:52:00 +00:00
|
|
|
this.FadeOut();
|
|
|
|
this.Push(new ScreenEntry());
|
2018-12-06 07:54:08 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-04-21 15:52:44 +00:00
|
|
|
base.OnEntering(e);
|
2018-12-06 07:54:08 +00:00
|
|
|
}
|
|
|
|
|
2018-12-06 02:58:09 +00:00
|
|
|
[BackgroundDependencyLoader(true)]
|
2021-05-18 21:32:56 +00:00
|
|
|
private void load(OsuColour colours, TextureStore textures)
|
2018-12-06 02:58:09 +00:00
|
|
|
{
|
2020-11-14 13:48:48 +00:00
|
|
|
if (string.IsNullOrEmpty(api?.ProvidedUsername))
|
2018-12-22 08:54:04 +00:00
|
|
|
return;
|
|
|
|
|
2019-01-23 11:52:00 +00:00
|
|
|
InternalChildren = new Drawable[]
|
2018-12-06 02:58:09 +00:00
|
|
|
{
|
2018-12-06 06:49:06 +00:00
|
|
|
new Sprite
|
2018-12-06 02:58:09 +00:00
|
|
|
{
|
2018-12-06 06:49:06 +00:00
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
Texture = textures.Get(@"Menu/dev-build-footer"),
|
|
|
|
},
|
|
|
|
new Sprite
|
|
|
|
{
|
|
|
|
Anchor = Anchor.BottomCentre,
|
|
|
|
Origin = Anchor.BottomCentre,
|
|
|
|
Texture = textures.Get(@"Menu/dev-build-footer"),
|
|
|
|
},
|
|
|
|
new FillFlowContainer
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
Padding = new MarginPadding(20),
|
|
|
|
Spacing = new Vector2(0, 5),
|
|
|
|
Children = new Drawable[]
|
2018-12-06 02:58:09 +00:00
|
|
|
{
|
2018-12-06 06:49:06 +00:00
|
|
|
new Container
|
2018-12-06 03:53:35 +00:00
|
|
|
{
|
2018-12-06 06:49:06 +00:00
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
Height = 150,
|
|
|
|
Child = new OsuLogo
|
|
|
|
{
|
|
|
|
Scale = new Vector2(0.1f),
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Triangles = false,
|
|
|
|
},
|
2018-12-06 03:53:35 +00:00
|
|
|
},
|
2018-12-06 06:49:06 +00:00
|
|
|
new OsuSpriteText
|
|
|
|
{
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
Colour = Color4.Red,
|
2019-02-12 04:04:46 +00:00
|
|
|
Font = OsuFont.GetFont(size: 28, weight: FontWeight.Light),
|
2018-12-06 06:49:06 +00:00
|
|
|
Text = "Warning! 注意!",
|
|
|
|
},
|
2019-02-20 10:32:30 +00:00
|
|
|
multiAccountExplanationText = new OsuTextFlowContainer(cp => cp.Font = cp.Font.With(size: 12))
|
2018-12-06 06:49:06 +00:00
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
AutoSizeAxes = Axes.Y
|
|
|
|
},
|
|
|
|
new SettingsButton
|
|
|
|
{
|
2023-06-14 14:40:26 +00:00
|
|
|
Text = AccountCreationStrings.MultiAccountWarningHelp,
|
2018-12-06 06:49:06 +00:00
|
|
|
Margin = new MarginPadding { Top = 50 },
|
|
|
|
Action = () => game?.OpenUrlExternally(help_centre_url)
|
|
|
|
},
|
|
|
|
new DangerousSettingsButton
|
|
|
|
{
|
2023-06-14 14:40:26 +00:00
|
|
|
Text = AccountCreationStrings.MultiAccountWarningAccept,
|
2019-01-23 11:52:00 +00:00
|
|
|
Action = () => this.Push(new ScreenEntry())
|
2018-12-06 06:49:06 +00:00
|
|
|
},
|
2019-02-20 10:32:30 +00:00
|
|
|
furtherAssistance = new LinkFlowContainer(cp => cp.Font = cp.Font.With(size: 12))
|
2018-12-06 06:49:06 +00:00
|
|
|
{
|
|
|
|
Margin = new MarginPadding { Top = 20 },
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
AutoSizeAxes = Axes.Both
|
|
|
|
},
|
|
|
|
}
|
2018-12-06 02:58:09 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
multiAccountExplanationText.AddText("Are you ");
|
|
|
|
multiAccountExplanationText.AddText(api.ProvidedUsername, cp => cp.Colour = colours.BlueLight);
|
|
|
|
multiAccountExplanationText.AddText("? osu! has a policy of ");
|
|
|
|
multiAccountExplanationText.AddText("one account per person!", cp => cp.Colour = colours.Yellow);
|
|
|
|
multiAccountExplanationText.AddText(" Please be aware that creating more than one account per person may result in ");
|
2019-10-15 06:07:06 +00:00
|
|
|
multiAccountExplanationText.AddText("permanent deactivation of accounts", cp => cp.Colour = colours.Yellow);
|
2018-12-06 02:58:09 +00:00
|
|
|
multiAccountExplanationText.AddText(".");
|
|
|
|
|
|
|
|
furtherAssistance.AddText("Need further assistance? Contact us via our ");
|
|
|
|
furtherAssistance.AddLink("support system", help_centre_url);
|
|
|
|
furtherAssistance.AddText(".");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|