1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 03:27:24 +08:00

Clean up old judgement lines if too many are already present

This commit is contained in:
Dean Herbert 2020-02-23 03:39:12 +09:00
parent 5aa5a1bbdd
commit 3daa49f1bd

View File

@ -207,11 +207,16 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
private double floatingAverage;
private Container colourBars;
private const int max_concurrent_judgements = 50;
public override void OnNewJudgement(JudgementResult judgement)
{
if (!judgement.IsHit)
return;
if (judgementsContainer.Count >= max_concurrent_judgements)
judgementsContainer.FirstOrDefault(j => j.LifetimeEnd > Clock.CurrentTime + 100)?.FadeOut(100).Expire();
judgementsContainer.Add(new JudgementLine
{
Y = getRelativeJudgementPosition(judgement.TimeOffset),