1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-19 00:37:20 +08:00

Applied suggestions

This commit is contained in:
EVAST9919 2017-07-31 14:20:12 +03:00
parent 1ce4966644
commit 700c7753c3

View File

@ -129,11 +129,10 @@ namespace osu.Game.Screens.Select
Right = left_area_padding,
},
});
Add(new ActionContainer
Add(new ResetScrollContainer(() => carousel.ScrollToSelected())
{
RelativeSizeAxes = Axes.Y,
Width = 250,
OnHoverAction = () => carousel.ScrollToSelected(),
});
if (ShowFooter)
@ -416,13 +415,18 @@ namespace osu.Game.Screens.Select
return base.OnKeyDown(state, args);
}
private class ActionContainer : Container
private class ResetScrollContainer : Container
{
public Action OnHoverAction;
private readonly Action onHoverAction;
public ResetScrollContainer(Action onHoverAction)
{
this.onHoverAction = onHoverAction;
}
protected override bool OnHover(InputState state)
{
OnHoverAction?.Invoke();
onHoverAction?.Invoke();
return base.OnHover(state);
}
}