Make retry button not look drunk.

This commit is contained in:
Unknown 2017-11-28 14:38:35 +05:30
parent e832f163e7
commit a30cd42ba2
1 changed files with 3 additions and 9 deletions

View File

@ -299,6 +299,7 @@ public RetryButton()
{
Icon = FontAwesome.fa_refresh,
Size = new Vector2(26),
Shadow = true,
},
};
}
@ -309,13 +310,10 @@ private void load(OsuColour colours)
this.colours = colours;
}
private bool rightWard;
protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes)
{
var duration = timingPoint.BeatLength / 2;
icon.RotateTo(rightWard ? 3 : -3, duration * 2, Easing.OutCubic);
icon.Animate(
i => i.MoveToY(-3, duration, Easing.Out),
i => i.ScaleTo(IsHovered ? 1.3f : 1.1f, duration, Easing.Out)
@ -323,8 +321,6 @@ protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint,
i => i.MoveToY(0, duration, Easing.In),
i => i.ScaleTo(IsHovered ? 1.4f : 1f, duration, Easing.In)
);
rightWard = !rightWard;
}
protected override bool OnHover(InputState state)
@ -342,15 +338,13 @@ protected override void OnHoverLost(InputState state)
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{
icon.ClearTransforms();
icon.FlashColour(colours.Yellow, 400);
icon.ScaleTo(0.8f, 400, Easing.InElastic);
icon.FadeColour(colours.Yellow, 400);
return base.OnMouseDown(state, args);
}
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
{
icon.ScaleTo(1.2f, 400, Easing.OutElastic);
icon.FadeColour(Color4.White, 400);
return base.OnMouseUp(state, args);
}
}