mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 23:03:02 +08:00
Fix Scheduler.AddOnce
not working in one location
This commit is contained in:
parent
7e68b64526
commit
4674f63655
@ -142,18 +142,8 @@ namespace osu.Game.Screens.Play.HUD
|
||||
|
||||
Current.BindValueChanged(v =>
|
||||
{
|
||||
Scheduler.AddOnce(() =>
|
||||
{
|
||||
if (v.NewValue >= GlowBarValue)
|
||||
finishMissDisplay();
|
||||
|
||||
double time = v.NewValue > GlowBarValue ? 500 : 250;
|
||||
|
||||
// TODO: this should probably use interpolation in update.
|
||||
this.TransformTo(nameof(HealthBarValue), v.NewValue, time, Easing.OutQuint);
|
||||
if (resetMissBarDelegate == null)
|
||||
this.TransformTo(nameof(GlowBarValue), v.NewValue, time, Easing.OutQuint);
|
||||
});
|
||||
// For some reason making the delegate inline here doesn't work correctly.
|
||||
Scheduler.AddOnce(updateCurrent);
|
||||
}, true);
|
||||
|
||||
BarLength.BindValueChanged(l => Width = l.NewValue, true);
|
||||
@ -169,6 +159,17 @@ namespace osu.Game.Screens.Play.HUD
|
||||
return base.OnInvalidate(invalidation, source);
|
||||
}
|
||||
|
||||
private void updateCurrent()
|
||||
{
|
||||
if (Current.Value >= GlowBarValue) finishMissDisplay();
|
||||
|
||||
double time = Current.Value > GlowBarValue ? 500 : 250;
|
||||
|
||||
// TODO: this should probably use interpolation in update.
|
||||
this.TransformTo(nameof(HealthBarValue), Current.Value, time, Easing.OutQuint);
|
||||
if (resetMissBarDelegate == null) this.TransformTo(nameof(GlowBarValue), Current.Value, time, Easing.OutQuint);
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
Loading…
Reference in New Issue
Block a user