mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Tidy shit up; reduce number of unnecssesary events being fired.
This commit is contained in:
@ -180,8 +180,13 @@ namespace osu.Game.GameModes.Play
|
||||
beatmapSetFlow.Children.Cast<BeatmapGroup>().First(b =>
|
||||
{
|
||||
var panel = b.BeatmapPanels.FirstOrDefault(p => p.Beatmap.Equals(beatmap));
|
||||
panel?.TriggerClick();
|
||||
return panel != null;
|
||||
if (panel != null)
|
||||
{
|
||||
panel.State = PanelSelectedState.Selected;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
@ -228,8 +233,20 @@ namespace osu.Game.GameModes.Play
|
||||
{
|
||||
var group = new BeatmapGroup(beatmapSet) { SelectionChanged = selectionChanged };
|
||||
beatmapSetFlow.Add(group);
|
||||
if (beatmapSetFlow.Children.Count() == 1)
|
||||
group.State = BeatmapGroupState.Expanded;
|
||||
if (Beatmap == null)
|
||||
{
|
||||
if (beatmapSetFlow.Children.Count() == 1)
|
||||
group.State = BeatmapGroupState.Expanded;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (selectedBeatmapInfo?.Equals(Beatmap.BeatmapInfo) != true)
|
||||
{
|
||||
var panel = group.BeatmapPanels.FirstOrDefault(p => p.Beatmap.Equals(Beatmap.BeatmapInfo));
|
||||
if (panel != null)
|
||||
panel.State = PanelSelectedState.Selected;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user