Move drawable load to asynchronous context

This commit is contained in:
Dean Herbert 2020-02-14 15:41:46 +09:00
parent 720ceca78a
commit a75715607b
1 changed files with 14 additions and 8 deletions

View File

@ -16,24 +16,30 @@ namespace osu.Game.Online
/// </summary>
public abstract class OnlineViewContainer : Container, IOnlineComponent
{
private readonly Placeholder placeholder;
protected readonly LoadingAnimation LoadingAnimation;
protected LoadingAnimation LoadingAnimation { get; private set; }
protected override Container<Drawable> Content { get; } = new Container { RelativeSizeAxes = Axes.Both };
private readonly string placeholderMessage;
private Placeholder placeholder;
private const double transform_duration = 300;
protected override Container<Drawable> Content { get; }
[Resolved]
protected IAPIProvider API { get; private set; }
protected OnlineViewContainer(string placeholderMessage)
{
this.placeholderMessage = placeholderMessage;
}
[BackgroundDependencyLoader]
private void load()
{
InternalChildren = new Drawable[]
{
Content = new Container
{
RelativeSizeAxes = Axes.Both,
},
Content,
placeholder = new LoginPlaceholder(placeholderMessage),
LoadingAnimation = new LoadingAnimation
{