1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 12:45:09 +08:00

Update other events to have matching return types (and animate more)

This commit is contained in:
Dean Herbert 2023-01-08 22:28:19 +09:00
parent bae3a6851b
commit 750b55d9b7

View File

@ -365,7 +365,7 @@ namespace osu.Game.Screens.Menu
protected override bool OnMouseDown(MouseDownEvent e) protected override bool OnMouseDown(MouseDownEvent e)
{ {
if (Action == null || e.Button != MouseButton.Left) return false; if (e.Button != MouseButton.Left) return true;
logoBounceContainer.ScaleTo(0.9f, 1000, Easing.Out); logoBounceContainer.ScaleTo(0.9f, 1000, Easing.Out);
return true; return true;
@ -380,22 +380,21 @@ namespace osu.Game.Screens.Menu
protected override bool OnClick(ClickEvent e) protected override bool OnClick(ClickEvent e)
{ {
if (Action == null) return false;
if (Action.Invoke())
sampleClick.Play();
flashLayer.ClearTransforms(); flashLayer.ClearTransforms();
flashLayer.Alpha = 0.4f; flashLayer.Alpha = 0.4f;
flashLayer.FadeOut(1500, Easing.OutExpo); flashLayer.FadeOut(1500, Easing.OutExpo);
if (Action?.Invoke() == true)
sampleClick.Play();
return true; return true;
} }
protected override bool OnHover(HoverEvent e) protected override bool OnHover(HoverEvent e)
{ {
if (Action == null) return true; if (Action != null)
logoHoverContainer.ScaleTo(1.1f, 500, Easing.OutElastic);
logoHoverContainer.ScaleTo(1.1f, 500, Easing.OutElastic);
return true; return true;
} }