1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 21:27:24 +08:00

Merge pull request #25673 from frenzibyte/fix-argon-initial-display

Fix `ArgonHealthDisplay` not displaying miss correctly during initial transition
This commit is contained in:
Dean Herbert 2023-12-13 22:16:34 +09:00 committed by GitHub
commit 76c4931f3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

View File

@ -212,6 +212,13 @@ namespace osu.Game.Screens.Play.HUD
glowBar.Alpha = (float)Interpolation.DampContinuously(glowBar.Alpha, GlowBarValue > 0 ? 1 : 0, 40, Time.Elapsed);
}
protected override void FinishInitialAnimation(double value)
{
base.FinishInitialAnimation(value);
this.TransformTo(nameof(HealthBarValue), value, 500, Easing.OutQuint);
this.TransformTo(nameof(GlowBarValue), value, 250, Easing.OutQuint);
}
protected override void Flash()
{
base.Flash();

View File

@ -58,7 +58,9 @@ namespace osu.Game.Screens.Play.HUD
health = HealthProcessor.Health.GetBoundCopy();
health.BindValueChanged(h =>
{
finishInitialAnimation();
if (initialIncrease != null)
FinishInitialAnimation(h.OldValue);
Current.Value = h.NewValue;
});
@ -90,16 +92,16 @@ namespace osu.Game.Screens.Play.HUD
Scheduler.AddOnce(Flash);
if (newValue >= health.Value)
finishInitialAnimation();
FinishInitialAnimation(health.Value);
}, increase_delay, true);
}
private void finishInitialAnimation()
protected virtual void FinishInitialAnimation(double value)
{
if (initialIncrease == null)
return;
initialIncrease?.Cancel();
initialIncrease.Cancel();
initialIncrease = null;
// aside from the repeating `initialIncrease` scheduled task,