1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:07:52 +08:00

Merge pull request #11823 from peppy/online-overlay-login-placeholder

Add login placeholder logic to OnlineOverlay
This commit is contained in:
Dan Balasescu 2021-02-19 11:53:04 +09:00 committed by GitHub
commit f32a2739ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 6 deletions

View File

@ -30,7 +30,7 @@ namespace osu.Game.Overlays
protected List<APIUpdateStream> Streams;
public ChangelogOverlay()
: base(OverlayColourScheme.Purple)
: base(OverlayColourScheme.Purple, false)
{
}

View File

@ -14,7 +14,7 @@ namespace osu.Game.Overlays
private readonly Bindable<string> article = new Bindable<string>(null);
public NewsOverlay()
: base(OverlayColourScheme.Purple)
: base(OverlayColourScheme.Purple, false)
{
}

View File

@ -4,6 +4,7 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online;
namespace osu.Game.Overlays
{
@ -16,10 +17,16 @@ namespace osu.Game.Overlays
protected readonly LoadingLayer Loading;
private readonly Container content;
protected OnlineOverlay(OverlayColourScheme colourScheme)
protected OnlineOverlay(OverlayColourScheme colourScheme, bool requiresSignIn = true)
: base(colourScheme)
{
base.Content.AddRange(new Drawable[]
var mainContent = requiresSignIn
? new OnlineViewContainer($"Sign in to view the {Header.Title.Title}")
: new Container();
mainContent.RelativeSizeAxes = Axes.Both;
mainContent.AddRange(new Drawable[]
{
ScrollFlow = new OverlayScrollContainer
{
@ -43,6 +50,8 @@ namespace osu.Game.Overlays
},
Loading = new LoadingLayer(true)
});
base.Content.Add(mainContent);
}
}
}

View File

@ -61,8 +61,7 @@ namespace osu.Game.Overlays
LoadComponentAsync(display, loaded =>
{
if (API.IsLoggedIn)
Loading.Hide();
Loading.Hide();
Child = loaded;
}, (cancellationToken = new CancellationTokenSource()).Token);