2020-01-04 20:09:40 +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.
|
|
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
2020-01-04 18:25:49 +00:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
|
using osu.Framework.Input.Events;
|
|
|
|
|
using osu.Game.Overlays;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Online.Placeholders
|
|
|
|
|
{
|
|
|
|
|
public sealed class LoginPlaceholder : Placeholder
|
|
|
|
|
{
|
2020-01-05 13:33:44 +00:00
|
|
|
|
[Resolved(CanBeNull = true)]
|
2020-01-04 18:25:49 +00:00
|
|
|
|
private LoginOverlay login { get; set; }
|
|
|
|
|
|
2020-01-08 08:22:51 +00:00
|
|
|
|
public LoginPlaceholder()
|
2020-01-04 18:25:49 +00:00
|
|
|
|
{
|
|
|
|
|
AddIcon(FontAwesome.Solid.UserLock, cp =>
|
|
|
|
|
{
|
|
|
|
|
cp.Font = cp.Font.With(size: TEXT_SIZE);
|
|
|
|
|
cp.Padding = new MarginPadding { Right = 10 };
|
|
|
|
|
});
|
|
|
|
|
|
2020-01-08 08:22:51 +00:00
|
|
|
|
AddText(@"Please sign in to view online leaderboards!");
|
2020-01-04 18:25:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override bool OnMouseDown(MouseDownEvent e)
|
|
|
|
|
{
|
|
|
|
|
this.ScaleTo(0.8f, 4000, Easing.OutQuint);
|
|
|
|
|
return base.OnMouseDown(e);
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-20 09:17:21 +00:00
|
|
|
|
protected override void OnMouseUp(MouseUpEvent e)
|
2020-01-04 18:25:49 +00:00
|
|
|
|
{
|
|
|
|
|
this.ScaleTo(1, 1000, Easing.OutElastic);
|
2020-01-20 09:17:21 +00:00
|
|
|
|
base.OnMouseUp(e);
|
2020-01-04 18:25:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override bool OnClick(ClickEvent e)
|
|
|
|
|
{
|
|
|
|
|
login?.Show();
|
|
|
|
|
return base.OnClick(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|