mirror of https://github.com/ppy/osu
Add login placeholder logic to OnlineOverlay
A perfect implementation of this would probably leave the filter/header content visible, but that requires some re-thinking and restructuring to how the content is displayed in these overlays (ie. the header component shouldn't be inside the `ScrollContainer` as it is fixed). Supersedes and closes #10774. Closes #933. Addresses most pieces of #7417.
This commit is contained in:
parent
58d8f0733c
commit
0bd1964d8e
|
@ -30,7 +30,7 @@ public class ChangelogOverlay : OnlineOverlay<ChangelogHeader>
|
|||
protected List<APIUpdateStream> Streams;
|
||||
|
||||
public ChangelogOverlay()
|
||||
: base(OverlayColourScheme.Purple)
|
||||
: base(OverlayColourScheme.Purple, false)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ public class NewsOverlay : OnlineOverlay<NewsHeader>
|
|||
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 @@ public abstract class OnlineOverlay<T> : FullscreenOverlay<T>
|
|||
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
|
||||
{
|
||||
|
@ -41,8 +48,10 @@ protected OnlineOverlay(OverlayColourScheme colourScheme)
|
|||
}
|
||||
}
|
||||
},
|
||||
Loading = new LoadingLayer(true)
|
||||
Loading = new LoadingLayer()
|
||||
});
|
||||
|
||||
base.Content.Add(mainContent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,8 +61,7 @@ protected void LoadDisplay(Drawable display)
|
|||
|
||||
LoadComponentAsync(display, loaded =>
|
||||
{
|
||||
if (API.IsLoggedIn)
|
||||
Loading.Hide();
|
||||
Loading.Hide();
|
||||
|
||||
Child = loaded;
|
||||
}, (cancellationToken = new CancellationTokenSource()).Token);
|
||||
|
|
Loading…
Reference in New Issue