1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-29 00:32:57 +08:00

Minor improvements to combo counters

This commit is contained in:
Adonais Romero González 2016-10-29 18:26:12 -05:00
parent cd5ad5a05c
commit ef9d2b5b3c
3 changed files with 14 additions and 4 deletions

View File

@ -31,6 +31,8 @@ namespace osu.Game.GameModes.Play
protected virtual EasingTypes PopOutEasing => EasingTypes.None; protected virtual EasingTypes PopOutEasing => EasingTypes.None;
protected virtual float PopOutInitialAlpha => 0.75f; protected virtual float PopOutInitialAlpha => 0.75f;
protected virtual double FadeOutDuration => 100;
/// <summary> /// <summary>
/// Duration in milliseconds for the counter roll-up animation for each element. /// Duration in milliseconds for the counter roll-up animation for each element.
/// </summary> /// </summary>
@ -60,7 +62,6 @@ namespace osu.Game.GameModes.Play
} }
} }
protected ulong prevCount;
protected ulong count; protected ulong count;
/// <summary> /// <summary>
@ -204,7 +205,7 @@ namespace osu.Game.GameModes.Play
private void updateCount(ulong value, bool rolling = false) private void updateCount(ulong value, bool rolling = false)
{ {
prevCount = count; ulong prevCount = count;
count = value; count = value;
if (!rolling) if (!rolling)
{ {

View File

@ -92,6 +92,11 @@ namespace osu.Game.GameModes.Play.Osu
protected override void OnCountRolling(ulong currentValue, ulong newValue) protected override void OnCountRolling(ulong currentValue, ulong newValue)
{ {
ScheduledPopOutCurrentId++; 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); base.OnCountRolling(currentValue, newValue);
} }
@ -116,13 +121,17 @@ namespace osu.Game.GameModes.Play.Osu
protected override void OnCountChange(ulong currentValue, ulong newValue) protected override void OnCountChange(ulong currentValue, ulong newValue)
{ {
ScheduledPopOutCurrentId++; ScheduledPopOutCurrentId++;
if (newValue == 0)
DisplayedCountSpriteText.FadeOut();
base.OnCountChange(currentValue, newValue); base.OnCountChange(currentValue, newValue);
} }
protected override void OnDisplayedCountRolling(ulong currentValue, ulong newValue) protected override void OnDisplayedCountRolling(ulong currentValue, ulong newValue)
{ {
if (newValue == 0) if (newValue == 0)
DisplayedCountSpriteText.FadeOut(PopOutDuration); DisplayedCountSpriteText.FadeOut(FadeOutDuration);
else else
DisplayedCountSpriteText.Show(); DisplayedCountSpriteText.Show();

View File

@ -43,7 +43,7 @@ namespace osu.Game.GameModes.Play.Taiko
protected override void OnDisplayedCountRolling(ulong currentValue, ulong newValue) protected override void OnDisplayedCountRolling(ulong currentValue, ulong newValue)
{ {
if (newValue == 0) if (newValue == 0)
DisplayedCountSpriteText.FadeOut(AnimationDuration); DisplayedCountSpriteText.FadeOut(FadeOutDuration);
else else
DisplayedCountSpriteText.Show(); DisplayedCountSpriteText.Show();