1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 00:42:55 +08:00

Use interpolation for health bar opacity instead of transforms

This commit is contained in:
Salman Ahmed 2023-10-01 15:25:23 +03:00
parent 8d389accf8
commit 7825bea959

View File

@ -131,15 +131,18 @@ namespace osu.Game.Screens.Play.HUD
resetMissBarDelegate = null; resetMissBarDelegate = null;
} }
if (v.NewValue == 0)
healthBar.FadeOut(300, Easing.OutQuint);
else if (healthBar.Alpha < 1)
healthBar.FadeIn(300, Easing.OutQuint);
this.TransformTo(nameof(HealthBarValue), v.NewValue, 300, Easing.OutQuint); this.TransformTo(nameof(HealthBarValue), v.NewValue, 300, Easing.OutQuint);
}, true); }, true);
} }
protected override void Update()
{
base.Update();
float targetAlpha = Current.Value > 0 ? 1 : 0;
healthBar.Alpha = (float)Interpolation.DampContinuously(healthBar.Alpha, targetAlpha, 50.0, Time.Elapsed);
}
private ScheduledDelegate? resetMissBarDelegate; private ScheduledDelegate? resetMissBarDelegate;
protected override void Miss(JudgementResult result) protected override void Miss(JudgementResult result)