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:
parent
4dd25b42ae
commit
7757a3a30b
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user