mirror of
https://github.com/ppy/osu
synced 2024-12-23 07:15:46 +00:00
Allow creating OnlineViewContainers with no placeholder button
This commit is contained in:
parent
a5a19319cc
commit
933c4010da
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user