mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 20:53:04 +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);
|
LoadComponentAsync(leaderboard = new MultiplayerGameplayLeaderboard(ScoreProcessor, userIds), HUDOverlay.Add);
|
||||||
|
|
||||||
HUDOverlay.Add(loadingDisplay = new LoadingLayer(true) { Depth = float.MaxValue });
|
HUDOverlay.Add(loadingDisplay = new LoadingLayer(true) { Depth = float.MaxValue });
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadAsyncComplete()
|
||||||
|
{
|
||||||
|
base.LoadAsyncComplete();
|
||||||
|
|
||||||
if (Token == null)
|
if (Token == null)
|
||||||
return; // Todo: Somehow handle token retrieval failure.
|
return; // Todo: Somehow handle token retrieval failure.
|
||||||
|
@ -28,11 +28,11 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
protected override void LoadAsyncComplete()
|
||||||
private void load()
|
|
||||||
{
|
{
|
||||||
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;
|
bool failed = false;
|
||||||
|
|
||||||
var req = CreateTokenRequestRequest();
|
var req = CreateTokenRequestRequest();
|
||||||
|
Loading…
Reference in New Issue
Block a user