mirror of
https://github.com/ppy/osu
synced 2025-03-25 04:18:03 +00:00
Merge pull request #13425 from Joehuu/score-panel-kb-navigation
This commit is contained in:
commit
2b4649a3ea
@ -8,9 +8,11 @@ using System.Linq;
|
|||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
using osuTK.Input;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Ranking
|
namespace osu.Game.Screens.Ranking
|
||||||
{
|
{
|
||||||
@ -263,6 +265,26 @@ namespace osu.Game.Screens.Ranking
|
|||||||
container.Attach();
|
container.Attach();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool OnKeyDown(KeyDownEvent e)
|
||||||
|
{
|
||||||
|
var expandedPanelIndex = flow.GetPanelIndex(expandedPanel.Score);
|
||||||
|
|
||||||
|
switch (e.Key)
|
||||||
|
{
|
||||||
|
case Key.Left:
|
||||||
|
if (expandedPanelIndex > 0)
|
||||||
|
SelectedScore.Value = flow.Children[expandedPanelIndex - 1].Panel.Score;
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case Key.Right:
|
||||||
|
if (expandedPanelIndex < flow.Count - 1)
|
||||||
|
SelectedScore.Value = flow.Children[expandedPanelIndex + 1].Panel.Score;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return base.OnKeyDown(e);
|
||||||
|
}
|
||||||
|
|
||||||
private class Flow : FillFlowContainer<ScorePanelTrackingContainer>
|
private class Flow : FillFlowContainer<ScorePanelTrackingContainer>
|
||||||
{
|
{
|
||||||
public override IEnumerable<Drawable> FlowingChildren => applySorting(AliveInternalChildren);
|
public override IEnumerable<Drawable> FlowingChildren => applySorting(AliveInternalChildren);
|
||||||
|
Loading…
Reference in New Issue
Block a user