mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 05:52:54 +08:00
Extended the length of replay at the end of map
This commit is contained in:
parent
9bcc6bf6da
commit
f58534f60c
@ -613,6 +613,8 @@ namespace osu.Game.Screens.Play
|
|||||||
// if an exit has been requested, cancel any pending completion (the user has shown intention to exit).
|
// if an exit has been requested, cancel any pending completion (the user has shown intention to exit).
|
||||||
resultsDisplayDelegate?.Cancel();
|
resultsDisplayDelegate?.Cancel();
|
||||||
|
|
||||||
|
beginScoreImport();
|
||||||
|
|
||||||
// The actual exit is performed if
|
// The actual exit is performed if
|
||||||
// - the pause / fail dialog was not requested
|
// - the pause / fail dialog was not requested
|
||||||
// - the pause / fail dialog was requested but is already displayed (user showing intention to exit).
|
// - the pause / fail dialog was requested but is already displayed (user showing intention to exit).
|
||||||
@ -735,14 +737,9 @@ namespace osu.Game.Screens.Play
|
|||||||
// is no chance that a user could return to the (already completed) Player instance from a child screen.
|
// is no chance that a user could return to the (already completed) Player instance from a child screen.
|
||||||
ValidForResume = false;
|
ValidForResume = false;
|
||||||
|
|
||||||
// Ensure we are not writing to the replay any more, as we are about to consume and store the score.
|
|
||||||
DrawableRuleset.SetRecordTarget(null);
|
|
||||||
|
|
||||||
if (!Configuration.ShowResults)
|
if (!Configuration.ShowResults)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
prepareScoreForDisplayTask ??= Task.Run(prepareAndImportScore);
|
|
||||||
|
|
||||||
bool storyboardHasOutro = DimmableStoryboard.ContentDisplayed && !DimmableStoryboard.HasStoryboardEnded.Value;
|
bool storyboardHasOutro = DimmableStoryboard.ContentDisplayed && !DimmableStoryboard.HasStoryboardEnded.Value;
|
||||||
|
|
||||||
if (storyboardHasOutro)
|
if (storyboardHasOutro)
|
||||||
@ -756,6 +753,56 @@ namespace osu.Game.Screens.Play
|
|||||||
progressToResults(true);
|
progressToResults(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Queue the results screen for display.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// A final display will only occur once all work is completed in <see cref="PrepareScoreForResultsAsync"/>. This means that even after calling this method, the results screen will never be shown until <see cref="JudgementProcessor.HasCompleted">ScoreProcessor.HasCompleted</see> becomes <see langword="true"/>.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="withDelay">Whether a minimum delay (<see cref="RESULTS_DISPLAY_DELAY"/>) should be added before the screen is displayed.</param>
|
||||||
|
private void progressToResults(bool withDelay)
|
||||||
|
{
|
||||||
|
resultsDisplayDelegate?.Cancel();
|
||||||
|
|
||||||
|
double delay = withDelay ? RESULTS_DISPLAY_DELAY : 0;
|
||||||
|
|
||||||
|
resultsDisplayDelegate = new ScheduledDelegate(() =>
|
||||||
|
{
|
||||||
|
if (prepareScoreForDisplayTask == null)
|
||||||
|
{
|
||||||
|
beginScoreImport();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!prepareScoreForDisplayTask.IsCompleted)
|
||||||
|
// If the asynchronous preparation has not completed, keep repeating this delegate.
|
||||||
|
return;
|
||||||
|
|
||||||
|
resultsDisplayDelegate?.Cancel();
|
||||||
|
|
||||||
|
if (!this.IsCurrentScreen())
|
||||||
|
// This player instance may already be in the process of exiting.
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.Push(CreateResults(prepareScoreForDisplayTask.GetResultSafely()));
|
||||||
|
}, Time.Current + delay, 50);
|
||||||
|
|
||||||
|
Scheduler.Add(resultsDisplayDelegate);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void beginScoreImport()
|
||||||
|
{
|
||||||
|
// We do not want to import the score in cases where we don't show results
|
||||||
|
bool canShowResults = Configuration.ShowResults && ScoreProcessor.HasCompleted.Value && GameplayState.HasPassed;
|
||||||
|
if (!canShowResults)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Ensure we are not writing to the replay any more, as we are about to consume and store the score.
|
||||||
|
DrawableRuleset.SetRecordTarget(null);
|
||||||
|
|
||||||
|
prepareScoreForDisplayTask ??= Task.Run(prepareAndImportScore);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Asynchronously run score preparation operations (database import, online submission etc.).
|
/// Asynchronously run score preparation operations (database import, online submission etc.).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -785,37 +832,6 @@ namespace osu.Game.Screens.Play
|
|||||||
return scoreCopy.ScoreInfo;
|
return scoreCopy.ScoreInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Queue the results screen for display.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// A final display will only occur once all work is completed in <see cref="PrepareScoreForResultsAsync"/>. This means that even after calling this method, the results screen will never be shown until <see cref="JudgementProcessor.HasCompleted">ScoreProcessor.HasCompleted</see> becomes <see langword="true"/>.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="withDelay">Whether a minimum delay (<see cref="RESULTS_DISPLAY_DELAY"/>) should be added before the screen is displayed.</param>
|
|
||||||
private void progressToResults(bool withDelay)
|
|
||||||
{
|
|
||||||
resultsDisplayDelegate?.Cancel();
|
|
||||||
|
|
||||||
double delay = withDelay ? RESULTS_DISPLAY_DELAY : 0;
|
|
||||||
|
|
||||||
resultsDisplayDelegate = new ScheduledDelegate(() =>
|
|
||||||
{
|
|
||||||
if (prepareScoreForDisplayTask?.IsCompleted != true)
|
|
||||||
// If the asynchronous preparation has not completed, keep repeating this delegate.
|
|
||||||
return;
|
|
||||||
|
|
||||||
resultsDisplayDelegate?.Cancel();
|
|
||||||
|
|
||||||
if (!this.IsCurrentScreen())
|
|
||||||
// This player instance may already be in the process of exiting.
|
|
||||||
return;
|
|
||||||
|
|
||||||
this.Push(CreateResults(prepareScoreForDisplayTask.GetResultSafely()));
|
|
||||||
}, Time.Current + delay, 50);
|
|
||||||
|
|
||||||
Scheduler.Add(resultsDisplayDelegate);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool OnScroll(ScrollEvent e)
|
protected override bool OnScroll(ScrollEvent e)
|
||||||
{
|
{
|
||||||
// During pause, allow global volume adjust regardless of settings.
|
// During pause, allow global volume adjust regardless of settings.
|
||||||
|
Loading…
Reference in New Issue
Block a user