mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 16:12:57 +08:00
Create completion progress delegate immediately
This commit is contained in:
parent
1369b75a86
commit
8826d01559
@ -529,21 +529,38 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
if (!showResults) return;
|
if (!showResults) return;
|
||||||
|
|
||||||
scoreSubmissionTask ??= SubmitScore(CreateScore());
|
scoreSubmissionTask ??= Task.Run(async () =>
|
||||||
scoreSubmissionTask.ContinueWith(t => Schedule(() =>
|
|
||||||
{
|
{
|
||||||
using (BeginDelayedSequence(RESULTS_DISPLAY_DELAY))
|
var score = CreateScore();
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
completionProgressDelegate = Schedule(() =>
|
return await SubmitScore(score);
|
||||||
{
|
|
||||||
// screen may be in the exiting transition phase.
|
|
||||||
if (this.IsCurrentScreen())
|
|
||||||
this.Push(CreateResults(t.Result));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}));
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.Error(ex, "Score submission failed!");
|
||||||
|
return score.ScoreInfo;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
using (BeginDelayedSequence(RESULTS_DISPLAY_DELAY))
|
||||||
|
scheduleCompletion();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void scheduleCompletion() => completionProgressDelegate = Schedule(() =>
|
||||||
|
{
|
||||||
|
if (!scoreSubmissionTask.IsCompleted)
|
||||||
|
{
|
||||||
|
scheduleCompletion();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// screen may be in the exiting transition phase.
|
||||||
|
if (this.IsCurrentScreen())
|
||||||
|
this.Push(CreateResults(scoreSubmissionTask.Result));
|
||||||
|
});
|
||||||
|
|
||||||
protected override bool OnScroll(ScrollEvent e) => mouseWheelDisabled.Value && !GameplayClockContainer.IsPaused.Value;
|
protected override bool OnScroll(ScrollEvent e) => mouseWheelDisabled.Value && !GameplayClockContainer.IsPaused.Value;
|
||||||
|
|
||||||
#region Fail Logic
|
#region Fail Logic
|
||||||
|
Loading…
Reference in New Issue
Block a user