mirror of
https://github.com/ppy/osu
synced 2025-01-18 20:10:49 +00:00
Clean up old judgement lines if too many are already present
This commit is contained in:
parent
5aa5a1bbdd
commit
3daa49f1bd
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user