mirror of
https://github.com/ppy/osu.git
synced 2025-01-18 14:52:56 +08:00
Only update combo information when any changes happened
This commit is contained in:
parent
fbfda2e044
commit
7c70dc4dc3
@ -111,20 +111,29 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
int currentBreak = 0;
|
int currentBreak = 0;
|
||||||
|
|
||||||
for (int i = 0; i < Beatmap.HitObjects.Count; ++i)
|
IHasComboInformation? lastObj = null;
|
||||||
{
|
bool comboInformationUpdateRequired = false;
|
||||||
var hitObject = Beatmap.HitObjects[i];
|
|
||||||
|
|
||||||
|
foreach (var hitObject in Beatmap.HitObjects)
|
||||||
|
{
|
||||||
if (hitObject is not IHasComboInformation hasCombo)
|
if (hitObject is not IHasComboInformation hasCombo)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (currentBreak < breakEnds.Count && hitObject.StartTime >= breakEnds[currentBreak])
|
if (currentBreak < breakEnds.Count && hitObject.StartTime >= breakEnds[currentBreak])
|
||||||
{
|
{
|
||||||
hasCombo.NewCombo = true;
|
if (!hasCombo.NewCombo)
|
||||||
|
{
|
||||||
|
hasCombo.NewCombo = true;
|
||||||
|
comboInformationUpdateRequired = true;
|
||||||
|
}
|
||||||
|
|
||||||
currentBreak += 1;
|
currentBreak += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
hasCombo.UpdateComboInformation(i > 0 ? Beatmap.HitObjects[i - 1] as IHasComboInformation : null);
|
if (comboInformationUpdateRequired)
|
||||||
|
hasCombo.UpdateComboInformation(lastObj);
|
||||||
|
|
||||||
|
lastObj = hasCombo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user