From ef9d2b5b3c10c5a093eed7a7a2a1f97d6c5f0865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adonais=20Romero=20Gonz=C3=A1lez?= Date: Sat, 29 Oct 2016 18:26:12 -0500 Subject: [PATCH] Minor improvements to combo counters --- osu.Game/GameModes/Play/ComboCounter.cs | 5 +++-- osu.Game/GameModes/Play/Osu/OsuComboCounter.cs | 11 ++++++++++- osu.Game/GameModes/Play/Taiko/TaikoComboCounter.cs | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/osu.Game/GameModes/Play/ComboCounter.cs b/osu.Game/GameModes/Play/ComboCounter.cs index ebc89c102e..ffeed048f0 100644 --- a/osu.Game/GameModes/Play/ComboCounter.cs +++ b/osu.Game/GameModes/Play/ComboCounter.cs @@ -31,6 +31,8 @@ namespace osu.Game.GameModes.Play protected virtual EasingTypes PopOutEasing => EasingTypes.None; protected virtual float PopOutInitialAlpha => 0.75f; + protected virtual double FadeOutDuration => 100; + /// /// Duration in milliseconds for the counter roll-up animation for each element. /// @@ -60,7 +62,6 @@ namespace osu.Game.GameModes.Play } } - protected ulong prevCount; protected ulong count; /// @@ -204,7 +205,7 @@ namespace osu.Game.GameModes.Play private void updateCount(ulong value, bool rolling = false) { - prevCount = count; + ulong prevCount = count; count = value; if (!rolling) { diff --git a/osu.Game/GameModes/Play/Osu/OsuComboCounter.cs b/osu.Game/GameModes/Play/Osu/OsuComboCounter.cs index 253d1c7f8e..c1f76b2632 100644 --- a/osu.Game/GameModes/Play/Osu/OsuComboCounter.cs +++ b/osu.Game/GameModes/Play/Osu/OsuComboCounter.cs @@ -92,6 +92,11 @@ namespace osu.Game.GameModes.Play.Osu protected override void OnCountRolling(ulong currentValue, ulong newValue) { ScheduledPopOutCurrentId++; + + // Hides displayed count if was increasing from 0 to 1 but didn't finish + if (currentValue == 0 && newValue == 0) + DisplayedCountSpriteText.FadeOut(FadeOutDuration); + base.OnCountRolling(currentValue, newValue); } @@ -116,13 +121,17 @@ namespace osu.Game.GameModes.Play.Osu protected override void OnCountChange(ulong currentValue, ulong newValue) { ScheduledPopOutCurrentId++; + + if (newValue == 0) + DisplayedCountSpriteText.FadeOut(); + base.OnCountChange(currentValue, newValue); } protected override void OnDisplayedCountRolling(ulong currentValue, ulong newValue) { if (newValue == 0) - DisplayedCountSpriteText.FadeOut(PopOutDuration); + DisplayedCountSpriteText.FadeOut(FadeOutDuration); else DisplayedCountSpriteText.Show(); diff --git a/osu.Game/GameModes/Play/Taiko/TaikoComboCounter.cs b/osu.Game/GameModes/Play/Taiko/TaikoComboCounter.cs index bd12d35315..70afd31988 100644 --- a/osu.Game/GameModes/Play/Taiko/TaikoComboCounter.cs +++ b/osu.Game/GameModes/Play/Taiko/TaikoComboCounter.cs @@ -43,7 +43,7 @@ namespace osu.Game.GameModes.Play.Taiko protected override void OnDisplayedCountRolling(ulong currentValue, ulong newValue) { if (newValue == 0) - DisplayedCountSpriteText.FadeOut(AnimationDuration); + DisplayedCountSpriteText.FadeOut(FadeOutDuration); else DisplayedCountSpriteText.Show();