1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:07:25 +08:00

Improve formatting of panel creation code

This commit is contained in:
Dean Herbert 2017-07-13 12:52:51 +09:00
parent 8045e0566f
commit f142bd0dc0

View File

@ -185,7 +185,17 @@ namespace osu.Game.Overlays
private void recreatePanels(PanelDisplayStyle displayStyle)
{
if (BeatmapSets == null) return;
panels.ChildrenEnumerable = BeatmapSets.Select(b => displayStyle == PanelDisplayStyle.Grid ? (DirectPanel)new DirectGridPanel(b) { Width = 400 } : new DirectListPanel(b));
panels.ChildrenEnumerable = BeatmapSets.Select<BeatmapSetInfo, DirectPanel>(b =>
{
switch (displayStyle)
{
case PanelDisplayStyle.Grid:
return new DirectGridPanel(b) { Width = 400 };
default:
return new DirectListPanel(b);
}
});
}
private GetBeatmapSetsRequest getSetsRequest;