1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

Fix auto mod results not displaying correctly

This commit is contained in:
Dean Herbert 2020-03-29 22:51:28 +09:00
parent de969c07ea
commit 4f5557096c
2 changed files with 40 additions and 30 deletions

View File

@ -637,28 +637,19 @@ namespace osu.Game.Screens.Play
return base.OnExiting(next); return base.OnExiting(next);
} }
private void fadeOut(bool instant = false) protected virtual void GotoRanking()
{
float fadeOutDuration = instant ? 0 : 250;
this.FadeOut(fadeOutDuration);
Background.EnableUserDim.Value = false;
storyboardReplacesBackground.Value = false;
}
private void scheduleGotoRanking()
{
completionProgressDelegate?.Cancel();
completionProgressDelegate = Schedule(delegate
{ {
if (DrawableRuleset.ReplayScore != null) if (DrawableRuleset.ReplayScore != null)
this.Push(CreateResults(DrawableRuleset.ReplayScore.ScoreInfo));
else
{ {
var score = new Score { ScoreInfo = CreateScore() }; // if a replay is present, we likely don't want to import into the local database.
this.Push(CreateResults(CreateScore()));
return;
}
LegacyByteArrayReader replayReader = null; LegacyByteArrayReader replayReader = null;
var score = new Score { ScoreInfo = CreateScore() };
if (recordingReplay?.Frames.Count > 0) if (recordingReplay?.Frames.Count > 0)
{ {
score.Replay = recordingReplay; score.Replay = recordingReplay;
@ -678,7 +669,20 @@ namespace osu.Game.Screens.Play
this.Push(CreateResults(imported.Result)); this.Push(CreateResults(imported.Result));
})); }));
} }
});
private void fadeOut(bool instant = false)
{
float fadeOutDuration = instant ? 0 : 250;
this.FadeOut(fadeOutDuration);
Background.EnableUserDim.Value = false;
storyboardReplacesBackground.Value = false;
}
private void scheduleGotoRanking()
{
completionProgressDelegate?.Cancel();
completionProgressDelegate = Schedule(GotoRanking);
} }
#endregion #endregion

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Screens;
using osu.Game.Scoring; using osu.Game.Scoring;
namespace osu.Game.Screens.Play namespace osu.Game.Screens.Play
@ -23,6 +24,11 @@ namespace osu.Game.Screens.Play
DrawableRuleset?.SetReplayScore(score); DrawableRuleset?.SetReplayScore(score);
} }
protected override void GotoRanking()
{
this.Push(CreateResults(DrawableRuleset.ReplayScore.ScoreInfo));
}
protected override ScoreInfo CreateScore() => score.ScoreInfo; protected override ScoreInfo CreateScore() => score.ScoreInfo;
} }
} }