Allow creating OnlineViewContainers with no placeholder button

This commit is contained in:
Dean Herbert 2021-04-06 16:17:20 +09:00
parent a5a19319cc
commit 933c4010da

View File

@ -23,13 +23,17 @@ namespace osu.Game.Online
private readonly string placeholderMessage;
private Placeholder placeholder;
private Drawable placeholder;
private const double transform_duration = 300;
[Resolved]
protected IAPIProvider API { get; private set; }
/// <summary>
/// Construct a new instance of an online view container.
/// </summary>
/// <param name="placeholderMessage">The message to display when not logged in. If empty, no button will display.</param>
public OnlineViewContainer(string placeholderMessage)
{
this.placeholderMessage = placeholderMessage;
@ -40,10 +44,10 @@ namespace osu.Game.Online
[BackgroundDependencyLoader]
private void load(IAPIProvider api)
{
InternalChildren = new Drawable[]
InternalChildren = new[]
{
Content,
placeholder = new LoginPlaceholder(placeholderMessage),
placeholder = string.IsNullOrEmpty(placeholderMessage) ? Empty() : new LoginPlaceholder(placeholderMessage),
LoadingSpinner = new LoadingSpinner
{
Alpha = 0,