mirror of
https://github.com/osukey/osukey.git
synced 2025-06-09 21:37:59 +09: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 double floatingAverage;
|
||||||
private Container colourBars;
|
private Container colourBars;
|
||||||
|
|
||||||
|
private const int max_concurrent_judgements = 50;
|
||||||
|
|
||||||
public override void OnNewJudgement(JudgementResult judgement)
|
public override void OnNewJudgement(JudgementResult judgement)
|
||||||
{
|
{
|
||||||
if (!judgement.IsHit)
|
if (!judgement.IsHit)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (judgementsContainer.Count >= max_concurrent_judgements)
|
||||||
|
judgementsContainer.FirstOrDefault(j => j.LifetimeEnd > Clock.CurrentTime + 100)?.FadeOut(100).Expire();
|
||||||
|
|
||||||
judgementsContainer.Add(new JudgementLine
|
judgementsContainer.Add(new JudgementLine
|
||||||
{
|
{
|
||||||
Y = getRelativeJudgementPosition(judgement.TimeOffset),
|
Y = getRelativeJudgementPosition(judgement.TimeOffset),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user