mirror of
https://github.com/ppy/osu
synced 2024-12-14 19:06:07 +00:00
Fix health animation affecting failing tint
This commit is contained in:
parent
1a60e6d76e
commit
58448d3dd9
@ -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;
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user