From 7757a3a30bb7cfe33c0def5fe4489cddf7949796 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Wed, 5 Feb 2020 23:06:13 +0300 Subject: [PATCH] Move spotlight layout to it's own method --- osu.Game/Overlays/RankingsOverlay.cs | 52 ++++++++++++++++------------ 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/osu.Game/Overlays/RankingsOverlay.cs b/osu.Game/Overlays/RankingsOverlay.cs index 084c8b6e5a..4fc94420a4 100644 --- a/osu.Game/Overlays/RankingsOverlay.cs +++ b/osu.Game/Overlays/RankingsOverlay.cs @@ -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();