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

Fix health animation affecting failing tint

This commit is contained in:
Dean Herbert 2023-10-07 01:03:41 +09:00
parent 1a60e6d76e
commit 58448d3dd9
No known key found for this signature in database
2 changed files with 8 additions and 1 deletions

View File

@ -29,6 +29,8 @@ namespace osu.Game.Screens.Play.HUD
/// </summary>
public readonly Bindable<bool> ShowHealth = new Bindable<bool>();
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;

View File

@ -25,6 +25,8 @@ namespace osu.Game.Screens.Play.HUD
[Resolved]
protected HealthProcessor HealthProcessor { get; private set; } = null!;
protected virtual bool PlayInitialIncreaseAnimation => true;
public Bindable<double> Current { get; } = new BindableDouble
{
MinValue = 0,
@ -74,7 +76,10 @@ namespace osu.Game.Screens.Play.HUD
// 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()