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:
commit
f32a2739ec
@ -30,7 +30,7 @@ namespace osu.Game.Overlays
|
||||
protected List<APIUpdateStream> Streams;
|
||||
|
||||
public ChangelogOverlay()
|
||||
: base(OverlayColourScheme.Purple)
|
||||
: base(OverlayColourScheme.Purple, false)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -61,8 +61,7 @@ namespace osu.Game.Overlays
|
||||
|
||||
LoadComponentAsync(display, loaded =>
|
||||
{
|
||||
if (API.IsLoggedIn)
|
||||
Loading.Hide();
|
||||
Loading.Hide();
|
||||
|
||||
Child = loaded;
|
||||
}, (cancellationToken = new CancellationTokenSource()).Token);
|
||||
|
Loading…
Reference in New Issue
Block a user