1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-20 05:56:42 +08:00

Move token request construction to LoadAsyncComplete to better allow DI usage

This commit is contained in:
Dean Herbert 2021-03-23 16:05:40 +09:00
parent 571124669d
commit 3cd8bf2d7f
2 changed files with 8 additions and 3 deletions

View File

@ -61,6 +61,11 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
LoadComponentAsync(leaderboard = new MultiplayerGameplayLeaderboard(ScoreProcessor, userIds), HUDOverlay.Add);
HUDOverlay.Add(loadingDisplay = new LoadingLayer(true) { Depth = float.MaxValue });
}
protected override void LoadAsyncComplete()
{
base.LoadAsyncComplete();
if (Token == null)
return; // Todo: Somehow handle token retrieval failure.

View File

@ -28,11 +28,11 @@ namespace osu.Game.Screens.Play
{
}
[BackgroundDependencyLoader]
private void load()
protected override void LoadAsyncComplete()
{
Token = null;
base.LoadAsyncComplete();
// Token request construction should happen post-load to allow derived classes to potentially prepare DI backings that are used to create the request.
bool failed = false;
var req = CreateTokenRequestRequest();