mirror of
https://github.com/ppy/osu.git
synced 2025-02-28 20:13:00 +08: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 readonly CancellationTokenSource loadCancellationSource = new CancellationTokenSource();
|
||||||
|
|
||||||
|
private JudgementResult lastJudgement;
|
||||||
|
|
||||||
public PerformancePointsCounter()
|
public PerformancePointsCounter()
|
||||||
{
|
{
|
||||||
Current.Value = DisplayedCount = 0;
|
Current.Value = DisplayedCount = 0;
|
||||||
@ -65,7 +67,12 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
{
|
{
|
||||||
var gameplayWorkingBeatmap = new GameplayWorkingBeatmap(gameplayState.Beatmap);
|
var gameplayWorkingBeatmap = new GameplayWorkingBeatmap(gameplayState.Beatmap);
|
||||||
difficultyCache.GetTimedDifficultyAttributesAsync(gameplayWorkingBeatmap, gameplayState.Ruleset, gameplayState.Mods.ToArray(), loadCancellationSource.Token)
|
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)
|
private void onNewJudgement(JudgementResult judgement)
|
||||||
{
|
{
|
||||||
|
lastJudgement = judgement;
|
||||||
|
|
||||||
var attrib = getAttributeAtTime(judgement);
|
var attrib = getAttributeAtTime(judgement);
|
||||||
|
|
||||||
if (gameplayState == null || attrib == null)
|
if (gameplayState == null || attrib == null)
|
||||||
|
Loading…
Reference in New Issue
Block a user