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:
parent
571124669d
commit
3cd8bf2d7f
@ -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.
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user