2020-01-05 04:09:40 +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.
|
|
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
2020-01-05 02:25:49 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
2020-03-05 00:01:37 +08:00
|
|
|
|
using osu.Game.Graphics.Containers;
|
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
2020-01-05 02:25:49 +08:00
|
|
|
|
using osu.Game.Overlays;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Online.Placeholders
|
|
|
|
|
{
|
|
|
|
|
public sealed class LoginPlaceholder : Placeholder
|
|
|
|
|
{
|
2020-01-12 22:50:35 +08:00
|
|
|
|
public LoginPlaceholder(string actionMessage)
|
2020-01-05 02:25:49 +08:00
|
|
|
|
{
|
2020-03-05 00:01:37 +08:00
|
|
|
|
AddArbitraryDrawable(new LoginButton(actionMessage));
|
2020-01-05 02:25:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
2020-03-05 00:01:37 +08:00
|
|
|
|
private class LoginButton : OsuAnimatedButton
|
2020-01-05 02:25:49 +08:00
|
|
|
|
{
|
2020-03-05 00:01:37 +08:00
|
|
|
|
[Resolved(CanBeNull = true)]
|
|
|
|
|
private LoginOverlay login { get; set; }
|
2020-01-05 02:25:49 +08:00
|
|
|
|
|
2020-03-05 00:01:37 +08:00
|
|
|
|
public LoginButton(string actionMessage)
|
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both;
|
2020-01-05 02:25:49 +08:00
|
|
|
|
|
2020-03-05 05:59:48 +08:00
|
|
|
|
var textFlowContainer = new OsuTextFlowContainer(cp => cp.Font = cp.Font.With(size: TEXT_SIZE))
|
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
|
Margin = new MarginPadding(5)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Child = textFlowContainer;
|
|
|
|
|
|
|
|
|
|
textFlowContainer.AddIcon(FontAwesome.Solid.UserLock, icon =>
|
|
|
|
|
{
|
|
|
|
|
icon.Padding = new MarginPadding { Right = 10 };
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
textFlowContainer.AddText(actionMessage);
|
2020-03-05 00:01:37 +08:00
|
|
|
|
|
|
|
|
|
Action = () => login?.Show();
|
|
|
|
|
}
|
2020-01-05 02:25:49 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|