1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-07 22:22:59 +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 float fontOverlap;
private readonly LegacyRollingCounter counter; private readonly LegacyRollingCounter counter;
private LegacyRollingCounter lastExplosion;
public LegacyComboCounter(ISkin skin, string fontName, float fontOverlap) 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 DisplayInitialCombo(int combo) => updateCombo(combo, null, true);
public void UpdateCombo(int combo, Color4? hitObjectColour) => updateCombo(combo, hitObjectColour, false); public void UpdateCombo(int combo, Color4? hitObjectColour) => updateCombo(combo, hitObjectColour, false);
private LegacyRollingCounter lastExplosion;
private void updateCombo(int combo, Color4? hitObjectColour, bool immediate) 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. // Combo fell to zero, roll down and fade out the counter.
if (combo == 0) if (combo == 0)
{ {
@ -83,8 +88,7 @@ namespace osu.Game.Rulesets.Catch.Skinning
return; return;
} }
// There may still be previous transforms being applied, finish them and remove explosion. // Remove last explosion to not conflict with the upcoming one.
FinishTransforms(true);
if (lastExplosion != null) if (lastExplosion != null)
RemoveInternal(lastExplosion); RemoveInternal(lastExplosion);