1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-17 17:33:02 +08:00

Move Schedule call to base implementation of error meter for extra safety

This commit is contained in:
Dean Herbert
2021-12-21 12:55:21 +09:00
Unverified
parent 28d6ff5d9c
commit 52db7b36fc
2 changed files with 8 additions and 3 deletions
@@ -53,13 +53,13 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
LayoutEasing = Easing.OutQuint;
}
public void Push(Color4 colour) => Schedule(() =>
public void Push(Color4 colour)
{
Add(new HitErrorCircle(colour, drawable_judgement_size));
if (Children.Count > max_available_judgements)
Children.FirstOrDefault(c => !c.IsRemoved)?.Remove();
});
}
}
internal class HitErrorCircle : Container
@@ -40,9 +40,14 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
if (gameplayClockContainer != null)
gameplayClockContainer.OnSeek += Clear;
processor.NewJudgement += OnNewJudgement;
// Scheduled as meter implementations are likely going to change/add drawables when reacting to this.
processor.NewJudgement += j => Schedule(() => OnNewJudgement(j));
}
/// <summary>
/// Fired when a new judgement arrives.
/// </summary>
/// <param name="judgement">The new judgement.</param>
protected abstract void OnNewJudgement(JudgementResult judgement);
protected Color4 GetColourForHitResult(HitResult result)