1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 09:02:55 +08:00

Fix keyboard controls not respecting search filter.

This commit is contained in:
Dean Herbert 2017-02-02 19:37:35 +09:00
parent 0c887d3a46
commit 966121a438

View File

@ -275,23 +275,35 @@ namespace osu.Game.Screens.Select
break;
}
if (direction != 0)
{
int index = SelectedGroup.BeatmapPanels.IndexOf(SelectedPanel) + direction;
if (direction == 0)
return base.OnKeyDown(state, args);
if (!skipDifficulties && index >= 0 && index < SelectedGroup.BeatmapPanels.Count)
if (!skipDifficulties)
{
int i = SelectedGroup.BeatmapPanels.IndexOf(SelectedPanel) + direction;
if (i >= 0 && i < SelectedGroup.BeatmapPanels.Count)
{
//changing difficulty panel, not set.
SelectGroup(SelectedGroup, SelectedGroup.BeatmapPanels[index]);
else
{
index = (groups.IndexOf(SelectedGroup) + direction + groups.Count) % groups.Count;
SelectBeatmap(groups[index].BeatmapPanels.First().Beatmap);
}
SelectGroup(SelectedGroup, SelectedGroup.BeatmapPanels[i]);
return true;
}
}
return base.OnKeyDown(state, args);
int startIndex = groups.IndexOf(SelectedGroup);
int index = startIndex;
do
{
index = (index + direction + groups.Count) % groups.Count;
if (groups[index].State != BeatmapGroupState.Hidden)
{
SelectBeatmap(groups[index].BeatmapPanels.First().Beatmap);
return true;
}
} while (index != startIndex);
return true;
}
public void SelectRandom()