1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 18:52:55 +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); 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() protected override void Flash()
{ {
base.Flash(); base.Flash();

View File

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