1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:37:28 +08:00

Simplify and reformat rewind/transform logic

This commit is contained in:
Dean Herbert 2020-09-22 12:54:21 +09:00
parent ffd4874ac0
commit 1c58f568d6
2 changed files with 21 additions and 33 deletions

View File

@ -54,16 +54,14 @@ namespace osu.Game.Rulesets.Catch.Skinning
public void UpdateCombo(int combo, Color4? hitObjectColour = null)
{
bool immediate = Time.Elapsed < 0;
if (combo == lastDisplayedCombo)
return;
lastDisplayedCombo = combo;
// There may still be existing transforms to the counter (including value change after 250ms),
// finish them immediately before new transforms.
counter.FinishTransforms();
counter.SetCountWithoutRolling(lastDisplayedCombo);
lastDisplayedCombo = combo;
// Combo fell to zero, roll down and fade out the counter.
if (combo == 0)
@ -71,31 +69,27 @@ namespace osu.Game.Rulesets.Catch.Skinning
counter.Current.Value = 0;
explosion.Current.Value = 0;
this.FadeOut(immediate ? 0.0 : 400.0, Easing.Out);
return;
this.FadeOut(400, Easing.Out);
}
this.FadeIn().Delay(1000.0).FadeOut(300.0);
// For simplicity, in the case of rewinding we'll just set the counter to the current combo value.
immediate |= Time.Elapsed < 0;
if (immediate)
else
{
counter.SetCountWithoutRolling(combo);
return;
}
this.FadeInFromZero().Delay(1000).FadeOut(300);
counter.ScaleTo(1.5f).ScaleTo(0.8f, 250, Easing.Out)
counter.ScaleTo(1.5f)
.ScaleTo(0.8f, 250, Easing.Out)
.OnComplete(c => c.SetCountWithoutRolling(combo));
counter.Delay(250).ScaleTo(1f).ScaleTo(1.1f, 60).Then().ScaleTo(1f, 30);
counter.Delay(250)
.ScaleTo(1f)
.ScaleTo(1.1f, 60).Then().ScaleTo(1f, 30);
explosion.Colour = hitObjectColour ?? Color4.White;
explosion.SetCountWithoutRolling(combo);
explosion.ScaleTo(1.5f).ScaleTo(1.9f, 400, Easing.Out)
explosion.ScaleTo(1.5f)
.ScaleTo(1.9f, 400, Easing.Out)
.FadeOutFromOne(400);
}
}
}
}

View File

@ -50,12 +50,6 @@ namespace osu.Game.Rulesets.Catch.UI
if (!result.Judgement.AffectsCombo || !result.HasResult)
return;
if (result.Type == HitResult.Miss)
{
updateCombo(result.ComboAtJudgement, null);
return;
}
updateCombo(result.ComboAtJudgement, judgedObject.AccentColour.Value);
}