1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 05:02:56 +08:00

Make retry button not look drunk.

This commit is contained in:
Unknown 2017-11-28 14:38:35 +05:30
parent e832f163e7
commit a30cd42ba2

View File

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