From 58448d3dd95f64e7b1d0c43492516b64f34f6086 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 7 Oct 2023 01:03:41 +0900 Subject: [PATCH] Fix health animation affecting failing tint --- osu.Game/Screens/Play/HUD/FailingLayer.cs | 2 ++ osu.Game/Screens/Play/HUD/HealthDisplay.cs | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/HUD/FailingLayer.cs b/osu.Game/Screens/Play/HUD/FailingLayer.cs index 67e7ae8f3f1f..3954e23cbe31 100644 --- a/osu.Game/Screens/Play/HUD/FailingLayer.cs +++ b/osu.Game/Screens/Play/HUD/FailingLayer.cs @@ -29,6 +29,8 @@ public partial class FailingLayer : HealthDisplay /// public readonly Bindable ShowHealth = new Bindable(); + protected override bool PlayInitialIncreaseAnimation => false; + private const float max_alpha = 0.4f; private const int fade_time = 400; private const float gradient_size = 0.2f; diff --git a/osu.Game/Screens/Play/HUD/HealthDisplay.cs b/osu.Game/Screens/Play/HUD/HealthDisplay.cs index e4bb91e7ca96..24af3051e374 100644 --- a/osu.Game/Screens/Play/HUD/HealthDisplay.cs +++ b/osu.Game/Screens/Play/HUD/HealthDisplay.cs @@ -25,6 +25,8 @@ public abstract partial class HealthDisplay : CompositeDrawable [Resolved] protected HealthProcessor HealthProcessor { get; private set; } = null!; + protected virtual bool PlayInitialIncreaseAnimation => true; + public Bindable Current { get; } = new BindableDouble { MinValue = 0, @@ -74,7 +76,10 @@ protected override void LoadComplete() // this probably shouldn't be operating on `this.` showHealthBar.BindValueChanged(healthBar => this.FadeTo(healthBar.NewValue ? 1 : 0, HUDOverlay.FADE_DURATION, HUDOverlay.FADE_EASING), true); - startInitialAnimation(); + if (PlayInitialIncreaseAnimation) + startInitialAnimation(); + else + Current.Value = 1; } private void startInitialAnimation()