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

Merge pull request #778 from peppy/song-select-selection-fixes

Fix song select reverting to first difficulty of current group on entering
This commit is contained in:
Dean Herbert 2017-05-17 23:31:24 +09:00 committed by GitHub
commit 0242e37bb3
4 changed files with 17 additions and 9 deletions

View File

@ -107,6 +107,8 @@ namespace osu.Game.Screens.Select
return;
}
if (beatmap == SelectedBeatmap) return;
foreach (BeatmapGroup group in groups)
{
var panel = group.BeatmapPanels.FirstOrDefault(p => p.Beatmap.Equals(beatmap));
@ -204,7 +206,7 @@ namespace osu.Game.Screens.Select
if (selectedGroup == null || selectedGroup.State == BeatmapGroupState.Hidden)
SelectNext();
else
selectGroup(selectedGroup);
selectGroup(selectedGroup, selectedPanel);
};
filterTask?.Cancel();
@ -339,6 +341,8 @@ namespace osu.Game.Screens.Select
selectedGroup.State = BeatmapGroupState.Collapsed;
group.State = BeatmapGroupState.Expanded;
group.SelectedPanel = panel;
panel.State = PanelSelectedState.Selected;
if (selectedPanel == panel) return;

View File

@ -49,6 +49,8 @@ namespace osu.Game.Screens.Select
get { return beatmap; }
set
{
if (beatmap == value) return;
beatmap = value;
pendingBeatmapSwitch?.Cancel();

View File

@ -100,6 +100,8 @@ namespace osu.Game.Screens.Select.Leaderboards
get { return beatmap; }
set
{
if (beatmap == value) return;
beatmap = value;
Scores = null;

View File

@ -313,15 +313,15 @@ namespace osu.Game.Screens.Select
{
bool beatmapSetChange = false;
if (!beatmap.Equals(Beatmap?.BeatmapInfo))
if (beatmap.Equals(Beatmap?.BeatmapInfo))
return;
if (beatmap.BeatmapSetInfoID == selectionChangeNoBounce?.BeatmapSetInfoID)
sampleChangeDifficulty.Play();
else
{
if (beatmap.BeatmapSetInfoID == selectionChangeNoBounce?.BeatmapSetInfoID)
sampleChangeDifficulty.Play();
else
{
sampleChangeBeatmap.Play();
beatmapSetChange = true;
}
sampleChangeBeatmap.Play();
beatmapSetChange = true;
}
selectionChangeNoBounce = beatmap;