mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 16:52:54 +08:00
Apply review suggestions
This commit is contained in:
parent
0422b326ad
commit
f00938971e
@ -26,7 +26,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
Child = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Child = onlineView = new OnlineViewContainer(@"Please login to view dummy test content")
|
||||
Child = onlineView = new OnlineViewContainer(@"view dummy test content")
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
|
@ -23,6 +23,9 @@ namespace osu.Game.Online
|
||||
|
||||
protected override Container<Drawable> Content => content;
|
||||
|
||||
[Resolved]
|
||||
protected IAPIProvider API { get; private set; }
|
||||
|
||||
public OnlineViewContainer(string placeholderMessage)
|
||||
{
|
||||
InternalChildren = new Drawable[]
|
||||
@ -35,12 +38,12 @@ namespace osu.Game.Online
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Alpha = 0,
|
||||
Child = placeholder = new LoginPlaceholder(placeholderMessage)
|
||||
Child = placeholder = new LoginPlaceholder($@"Please sign in to {placeholderMessage}")
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
public void APIStateChanged(IAPIProvider api, APIState state)
|
||||
public virtual void APIStateChanged(IAPIProvider api, APIState state)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
@ -70,10 +73,16 @@ namespace osu.Game.Online
|
||||
}
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(IAPIProvider api)
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
api.Register(this);
|
||||
API?.Register(this);
|
||||
base.LoadComplete();
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
API?.Unregister(this);
|
||||
base.Dispose(isDisposing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user