1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 05:52:54 +08:00

Create completion progress delegate immediately

This commit is contained in:
smoogipoo 2020-12-18 18:20:36 +09:00
parent 1369b75a86
commit 8826d01559

View File

@ -529,20 +529,37 @@ namespace osu.Game.Screens.Play
if (!showResults) return;
scoreSubmissionTask ??= SubmitScore(CreateScore());
scoreSubmissionTask.ContinueWith(t => Schedule(() =>
scoreSubmissionTask ??= Task.Run(async () =>
{
var score = CreateScore();
try
{
return await SubmitScore(score);
}
catch (Exception ex)
{
Logger.Error(ex, "Score submission failed!");
return score.ScoreInfo;
}
});
using (BeginDelayedSequence(RESULTS_DISPLAY_DELAY))
scheduleCompletion();
}
private void scheduleCompletion() => completionProgressDelegate = Schedule(() =>
{
completionProgressDelegate = Schedule(() =>
if (!scoreSubmissionTask.IsCompleted)
{
scheduleCompletion();
return;
}
// screen may be in the exiting transition phase.
if (this.IsCurrentScreen())
this.Push(CreateResults(t.Result));
this.Push(CreateResults(scoreSubmissionTask.Result));
});
}
}));
}
protected override bool OnScroll(ScrollEvent e) => mouseWheelDisabled.Value && !GameplayClockContainer.IsPaused.Value;