mirror of
https://github.com/ppy/osu
synced 2025-01-14 01:51:04 +00:00
Fix display not displaying correctly after initial load
This commit is contained in:
parent
04538a69e4
commit
f64226ded6
@ -51,6 +51,8 @@ namespace osu.Game.Screens.Play.HUD
|
||||
|
||||
private readonly CancellationTokenSource loadCancellationSource = new CancellationTokenSource();
|
||||
|
||||
private JudgementResult lastJudgement;
|
||||
|
||||
public PerformancePointsCounter()
|
||||
{
|
||||
Current.Value = DisplayedCount = 0;
|
||||
@ -65,7 +67,12 @@ namespace osu.Game.Screens.Play.HUD
|
||||
{
|
||||
var gameplayWorkingBeatmap = new GameplayWorkingBeatmap(gameplayState.Beatmap);
|
||||
difficultyCache.GetTimedDifficultyAttributesAsync(gameplayWorkingBeatmap, gameplayState.Ruleset, gameplayState.Mods.ToArray(), loadCancellationSource.Token)
|
||||
.ContinueWith(r => Schedule(() => timedAttributes = r.Result), TaskContinuationOptions.OnlyOnRanToCompletion);
|
||||
.ContinueWith(r => Schedule(() =>
|
||||
{
|
||||
timedAttributes = r.Result;
|
||||
if (lastJudgement != null)
|
||||
onNewJudgement(lastJudgement);
|
||||
}), TaskContinuationOptions.OnlyOnRanToCompletion);
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,6 +103,8 @@ namespace osu.Game.Screens.Play.HUD
|
||||
|
||||
private void onNewJudgement(JudgementResult judgement)
|
||||
{
|
||||
lastJudgement = judgement;
|
||||
|
||||
var attrib = getAttributeAtTime(judgement);
|
||||
|
||||
if (gameplayState == null || attrib == null)
|
||||
|
Loading…
Reference in New Issue
Block a user