mirror of
https://github.com/ppy/osu.git
synced 2025-02-16 15:43:18 +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 =>
|
Current.BindValueChanged(v =>
|
||||||
{
|
{
|
||||||
Scheduler.AddOnce(() =>
|
// For some reason making the delegate inline here doesn't work correctly.
|
||||||
{
|
Scheduler.AddOnce(updateCurrent);
|
||||||
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);
|
|
||||||
});
|
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
BarLength.BindValueChanged(l => Width = l.NewValue, true);
|
BarLength.BindValueChanged(l => Width = l.NewValue, true);
|
||||||
@ -169,6 +159,17 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
return base.OnInvalidate(invalidation, source);
|
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()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
Loading…
Reference in New Issue
Block a user