From a75715607b3882c14ccab7984cc9ee4a97534522 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 14 Feb 2020 15:41:46 +0900 Subject: [PATCH] Move drawable load to asynchronous context --- osu.Game/Online/OnlineViewContainer.cs | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/osu.Game/Online/OnlineViewContainer.cs b/osu.Game/Online/OnlineViewContainer.cs index 83fbff733f..689c1c0afb 100644 --- a/osu.Game/Online/OnlineViewContainer.cs +++ b/osu.Game/Online/OnlineViewContainer.cs @@ -16,24 +16,30 @@ namespace osu.Game.Online /// public abstract class OnlineViewContainer : Container, IOnlineComponent { - private readonly Placeholder placeholder; - protected readonly LoadingAnimation LoadingAnimation; + protected LoadingAnimation LoadingAnimation { get; private set; } + + protected override Container Content { get; } = new Container { RelativeSizeAxes = Axes.Both }; + + private readonly string placeholderMessage; + + private Placeholder placeholder; private const double transform_duration = 300; - protected override Container 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 {