1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

Move spotlight layout to it's own method

This commit is contained in:
Andrei Zavatski 2020-02-05 23:06:13 +03:00
parent 4dd25b42ae
commit 7757a3a30b

View File

@ -218,34 +218,40 @@ namespace osu.Game.Overlays
return new CountriesTable(1, countryRequest.Result.Countries);
case GetSpotlightRankingsRequest spotlightRequest:
header.SpotlightSelector.ShowInfo(spotlightRequest.Result);
return new FillFlowContainer
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 20),
Children = new Drawable[]
{
new ScoresTable(1, spotlightRequest.Result.Users),
new FillFlowContainer
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Spacing = new Vector2(10),
Children = spotlightRequest.Result.BeatmapSets.Select(b => new DirectGridPanel(b.ToBeatmapSet(rulesets))
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
}).ToList()
}
}
};
return getSpotlightContent(spotlightRequest.Result);
}
return null;
}
private Drawable getSpotlightContent(GetSpotlightRankingsResponse response)
{
header.SpotlightSelector.ShowInfo(response);
return new FillFlowContainer
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 20),
Children = new Drawable[]
{
new ScoresTable(1, response.Users),
new FillFlowContainer
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Spacing = new Vector2(10),
Children = response.BeatmapSets.Select(b => new DirectGridPanel(b.ToBeatmapSet(rulesets))
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
}).ToList()
}
}
};
}
private void loadContent(Drawable content)
{
scrollFlow.ScrollToStart();