mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 08:32:57 +08:00
commit
d33a507d96
@ -7,6 +7,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Leaderboards;
|
||||
using osu.Game.Online.Placeholders;
|
||||
using osu.Game.Rulesets.Osu.Mods;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.Select.Leaderboards;
|
||||
|
@ -14,6 +14,7 @@ using osu.Framework.Threading;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.Placeholders;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
@ -150,7 +151,7 @@ namespace osu.Game.Online.Leaderboards
|
||||
break;
|
||||
|
||||
case PlaceholderState.NotLoggedIn:
|
||||
replacePlaceholder(new MessagePlaceholder(@"Please sign in to view online leaderboards!"));
|
||||
replacePlaceholder(new LoginPlaceholder());
|
||||
break;
|
||||
|
||||
case PlaceholderState.NotSupporter:
|
||||
|
@ -6,6 +6,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Online.Placeholders;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Online.Leaderboards
|
||||
|
46
osu.Game/Online/Placeholders/LoginPlaceholder.cs
Normal file
46
osu.Game/Online/Placeholders/LoginPlaceholder.cs
Normal file
@ -0,0 +1,46 @@
|
||||
// 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;
|
||||
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
|
||||
{
|
||||
[Resolved(CanBeNull = true)]
|
||||
private LoginOverlay login { get; set; }
|
||||
|
||||
public LoginPlaceholder()
|
||||
{
|
||||
AddIcon(FontAwesome.Solid.UserLock, cp =>
|
||||
{
|
||||
cp.Font = cp.Font.With(size: TEXT_SIZE);
|
||||
cp.Padding = new MarginPadding { Right = 10 };
|
||||
});
|
||||
|
||||
AddText(@"Please sign in to view online leaderboards!");
|
||||
}
|
||||
|
||||
protected override bool OnMouseDown(MouseDownEvent e)
|
||||
{
|
||||
this.ScaleTo(0.8f, 4000, Easing.OutQuint);
|
||||
return base.OnMouseDown(e);
|
||||
}
|
||||
|
||||
protected override bool OnMouseUp(MouseUpEvent e)
|
||||
{
|
||||
this.ScaleTo(1, 1000, Easing.OutElastic);
|
||||
return base.OnMouseUp(e);
|
||||
}
|
||||
|
||||
protected override bool OnClick(ClickEvent e)
|
||||
{
|
||||
login?.Show();
|
||||
return base.OnClick(e);
|
||||
}
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
|
||||
namespace osu.Game.Online.Leaderboards
|
||||
namespace osu.Game.Online.Placeholders
|
||||
{
|
||||
public class MessagePlaceholder : Placeholder
|
||||
{
|
@ -5,7 +5,7 @@ using System;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Online.Leaderboards
|
||||
namespace osu.Game.Online.Placeholders
|
||||
{
|
||||
public abstract class Placeholder : OsuTextFlowContainer, IEquatable<Placeholder>
|
||||
{
|
Loading…
Reference in New Issue
Block a user