From 7c3a626f4b2a1706cfc46295770b8673b374aee4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 10 Nov 2023 15:06:07 +0900 Subject: [PATCH] Add basic animation for combo counter --- osu.Game/Screens/Play/HUD/ArgonComboCounter.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/osu.Game/Screens/Play/HUD/ArgonComboCounter.cs b/osu.Game/Screens/Play/HUD/ArgonComboCounter.cs index 6a7d5ff665..36194d787b 100644 --- a/osu.Game/Screens/Play/HUD/ArgonComboCounter.cs +++ b/osu.Game/Screens/Play/HUD/ArgonComboCounter.cs @@ -8,11 +8,15 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; using osu.Game.Configuration; using osu.Game.Rulesets.Scoring; +using osuTK; namespace osu.Game.Screens.Play.HUD { public partial class ArgonComboCounter : ComboCounter { + protected override double RollingDuration => 500; + protected override Easing RollingEasing => Easing.OutQuint; + [SettingSource("Wireframe opacity", "Controls the opacity of the wire frames behind the digits.")] public BindableFloat WireframeOpacity { get; } = new BindableFloat(0.4f) { @@ -25,6 +29,12 @@ namespace osu.Game.Screens.Play.HUD private void load(ScoreProcessor scoreProcessor) { Current.BindTo(scoreProcessor.Combo); + Current.BindValueChanged(combo => + { + bool wasIncrease = combo.NewValue > combo.OldValue; + DrawableCount.ScaleTo(new Vector2(1, wasIncrease ? 1.2f : 0.8f)) + .ScaleTo(Vector2.One, 600, Easing.OutQuint); + }); } protected override LocalisableString FormatCount(int count) => $@"{count}x";