1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 12:42:54 +08:00

Add ability to toggle extended statistics using space or enter

This commit is contained in:
Joehu 2020-10-10 18:30:13 -07:00
parent f10c8b20d0
commit 8faa86b048

View File

@ -10,9 +10,11 @@ using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Bindings;
using osu.Framework.Screens;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
using osu.Game.Input.Bindings;
using osu.Game.Online.API;
using osu.Game.Scoring;
using osu.Game.Screens.Backgrounds;
@ -22,7 +24,7 @@ using osuTK;
namespace osu.Game.Screens.Ranking
{
public abstract class ResultsScreen : OsuScreen
public abstract class ResultsScreen : OsuScreen, IKeyBindingHandler<GlobalAction>
{
protected const float BACKGROUND_BLUR = 20;
private static readonly float screen_height = 768 - TwoLayerButton.SIZE_EXTENDED.Y;
@ -314,6 +316,22 @@ namespace osu.Game.Screens.Ranking
}
}
public bool OnPressed(GlobalAction action)
{
switch (action)
{
case GlobalAction.Select:
statisticsPanel.ToggleVisibility();
return true;
}
return false;
}
public void OnReleased(GlobalAction action)
{
}
private class VerticalScrollContainer : OsuScrollContainer
{
protected override Container<Drawable> Content => content;