Populate score with remaining "miss" statistics on fail/exit

This commit is contained in:
Salman Ahmed
2022-07-21 06:01:13 +03:00
parent c4089b71bd
commit 0f0b19da4a
2 changed files with 38 additions and 9 deletions

View File

@ -267,12 +267,7 @@ namespace osu.Game.Screens.Play
},
FailOverlay = new FailOverlay
{
SaveReplay = () =>
{
Score.ScoreInfo.Passed = false;
Score.ScoreInfo.Rank = ScoreRank.F;
return prepareAndImportScore();
},
SaveReplay = prepareAndImportScore,
OnRetry = Restart,
OnQuit = () => PerformExit(true),
},
@ -831,7 +826,6 @@ namespace osu.Game.Screens.Play
return false;
GameplayState.HasFailed = true;
Score.ScoreInfo.Passed = false;
updateGameplayState();
@ -849,9 +843,17 @@ namespace osu.Game.Screens.Play
return true;
}
// Called back when the transform finishes
/// <summary>
/// Invoked when the fail animation has finished.
/// </summary>
private void onFailComplete()
{
// fail completion is a good point to mark a score as failed,
// since the last judgement that caused the fail only applies to score processor after onFail.
// todo: this should probably be handled better.
Score.ScoreInfo.Passed = false;
ScoreProcessor.FailScore(Score.ScoreInfo);
GameplayClockContainer.Stop();
FailOverlay.Retries = RestartCount;
@ -1030,7 +1032,7 @@ namespace osu.Game.Screens.Play
if (prepareScoreForDisplayTask == null)
{
Score.ScoreInfo.Passed = false;
Score.ScoreInfo.Rank = ScoreRank.F;
ScoreProcessor.FailScore(Score.ScoreInfo);
}
// EndPlaying() is typically called from ReplayRecorder.Dispose(). Disposal is currently asynchronous.