1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 19:22:54 +08:00

Handle scale back in a nicer way

This commit is contained in:
Dean Herbert 2018-05-22 16:44:37 +09:00
parent 7b770d03c5
commit 436067c01f

View File

@ -136,9 +136,7 @@ namespace osu.Game.Screens.Play.HUD
private void bind() private void bind()
{ {
circularProgress.Current.BindTo(Progress); circularProgress.Current.BindTo(Progress);
Progress.ValueChanged += v => icon.Scale = new Vector2(1 + (float)v * 0.2f);
Progress.ValueChanged += v => icon.Scale = new Vector2(1 + (float)v * 0.4f);
Progress.TriggerChange();
} }
private bool pendingAnimation; private bool pendingAnimation;
@ -155,15 +153,19 @@ namespace osu.Game.Screens.Play.HUD
overlayCircle.ScaleTo(0, 100) overlayCircle.ScaleTo(0, 100)
.Then().FadeOut().ScaleTo(1).FadeIn(500) .Then().FadeOut().ScaleTo(1).FadeIn(500)
.OnComplete(a => circularProgress.FadeOut(100).OnComplete(_ => .OnComplete(a =>
{ {
Progress.Value = 0; icon.ScaleTo(1, 100);
circularProgress.FadeOut(100).OnComplete(_ =>
{
Progress.Value = 0;
bind(); bind();
circularProgress.FadeIn(); circularProgress.FadeIn();
pendingAnimation = false; pendingAnimation = false;
})); });
});
} }
protected override bool OnHover(InputState state) protected override bool OnHover(InputState state)