diff --git a/osu.Game/Screens/Play/HUD/ArgonComboCounter.cs b/osu.Game/Screens/Play/HUD/ArgonComboCounter.cs index 36194d787b..b75d4268fc 100644 --- a/osu.Game/Screens/Play/HUD/ArgonComboCounter.cs +++ b/osu.Game/Screens/Play/HUD/ArgonComboCounter.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; @@ -9,11 +10,14 @@ using osu.Framework.Localisation; using osu.Game.Configuration; using osu.Game.Rulesets.Scoring; using osuTK; +using osuTK.Graphics; namespace osu.Game.Screens.Play.HUD { public partial class ArgonComboCounter : ComboCounter { + private ArgonCounterTextComponent text = null!; + protected override double RollingDuration => 500; protected override Easing RollingEasing => Easing.OutQuint; @@ -32,14 +36,24 @@ namespace osu.Game.Screens.Play.HUD 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); + bool wasMiss = combo.OldValue > 1 && combo.NewValue == 0; + + float newScale = Math.Clamp(text.NumberContainer.Scale.X * (wasIncrease ? 1.1f : 0.8f), 0.6f, 1.4f); + + float duration = wasMiss ? 2000 : 300; + + text.NumberContainer + .ScaleTo(new Vector2(newScale)) + .ScaleTo(Vector2.One, duration, Easing.OutQuint); + + if (wasMiss) + text.FlashColour(Color4.Red, duration, Easing.OutQuint); }); } protected override LocalisableString FormatCount(int count) => $@"{count}x"; - protected override IHasText CreateText() => new ArgonCounterTextComponent(Anchor.TopLeft, "COMBO") + protected override IHasText CreateText() => text = new ArgonCounterTextComponent(Anchor.TopLeft, "COMBO") { WireframeOpacity = { BindTarget = WireframeOpacity }, }; diff --git a/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs b/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs index dbeafe5b59..56f60deae1 100644 --- a/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs +++ b/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs @@ -27,6 +27,8 @@ namespace osu.Game.Screens.Play.HUD public IBindable WireframeOpacity { get; } = new BindableFloat(); public Bindable RequiredDisplayDigits { get; } = new BindableInt(); + public Container NumberContainer { get; private set; } + public LocalisableString Text { get => textPart.Text; @@ -59,7 +61,7 @@ namespace osu.Game.Screens.Play.HUD Font = OsuFont.Torus.With(size: 12, weight: FontWeight.Bold), Margin = new MarginPadding { Left = 2.5f }, }, - new Container + NumberContainer = new Container { AutoSizeAxes = Axes.Both, Children = new[]