1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:52:53 +08:00

Finish internal counter transformation regardless of the combo

This commit is contained in:
Salman Ahmed 2020-08-22 12:20:50 +03:00
parent deb5cc752b
commit 7ae45b29db

View File

@ -27,7 +27,6 @@ namespace osu.Game.Rulesets.Catch.Skinning
private readonly float fontOverlap;
private readonly LegacyRollingCounter counter;
private LegacyRollingCounter lastExplosion;
public LegacyComboCounter(ISkin skin, string fontName, float fontOverlap)
{
@ -70,8 +69,14 @@ namespace osu.Game.Rulesets.Catch.Skinning
public void DisplayInitialCombo(int combo) => updateCombo(combo, null, true);
public void UpdateCombo(int combo, Color4? hitObjectColour) => updateCombo(combo, hitObjectColour, false);
private LegacyRollingCounter lastExplosion;
private void updateCombo(int combo, Color4? hitObjectColour, bool immediate)
{
// There may still be existing transforms to the counter (including value change after 250ms),
// finish them immediately before new transforms.
counter.FinishTransforms();
// Combo fell to zero, roll down and fade out the counter.
if (combo == 0)
{
@ -83,8 +88,7 @@ namespace osu.Game.Rulesets.Catch.Skinning
return;
}
// There may still be previous transforms being applied, finish them and remove explosion.
FinishTransforms(true);
// Remove last explosion to not conflict with the upcoming one.
if (lastExplosion != null)
RemoveInternal(lastExplosion);