Move inside leaderboard

This commit is contained in:
Dean Herbert 2019-09-19 14:52:31 +09:00
parent a7b6895d4c
commit 4967ffd8e5
2 changed files with 45 additions and 6 deletions

View File

@ -35,6 +35,10 @@ namespace osu.Game.Online.Leaderboards
private bool scoresLoadedOnce;
private readonly Container content;
protected override Container<Drawable> Content => content;
private IEnumerable<ScoreInfo> scores;
public IEnumerable<ScoreInfo> Scores
@ -60,13 +64,13 @@ namespace osu.Game.Online.Leaderboards
// ensure placeholder is hidden when displaying scores
PlaceholderState = PlaceholderState.Successful;
var sf = CreateScoreFlow();
sf.ChildrenEnumerable = scores.Select((s, index) => CreateDrawableScore(s, index + 1));
var scoreFlow = CreateScoreFlow();
scoreFlow.ChildrenEnumerable = scores.Select((s, index) => CreateDrawableScore(s, index + 1));
// schedule because we may not be loaded yet (LoadComponentAsync complains).
showScoresDelegate = Schedule(() => LoadComponentAsync(sf, _ =>
showScoresDelegate = Schedule(() => LoadComponentAsync(scoreFlow, _ =>
{
scrollContainer.Add(scrollFlow = sf);
scrollContainer.Add(scrollFlow = scoreFlow);
int i = 0;
@ -164,10 +168,33 @@ namespace osu.Game.Online.Leaderboards
{
Children = new Drawable[]
{
scrollContainer = new OsuScrollContainer
new GridContainer
{
RelativeSizeAxes = Axes.Both,
ScrollbarVisible = false,
RowDimensions = new[]
{
new Dimension(),
new Dimension(GridSizeMode.AutoSize),
},
Content = new[]
{
new Drawable[]
{
scrollContainer = new OsuScrollContainer
{
RelativeSizeAxes = Axes.Both,
ScrollbarVisible = false,
}
},
new Drawable[]
{
content = new Container
{
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
},
}
},
},
loading = new LoadingAnimation(),
placeholderContainer = new Container

View File

@ -80,6 +80,18 @@ namespace osu.Game.Screens.Select.Leaderboards
if (filterMods)
UpdateScores();
};
TopScore.BindValueChanged(newTopScore);
}
private void newTopScore(ValueChangedEvent<APILegacyUserTopScoreInfo> score)
{
Content.Clear();
if (score.NewValue != null)
{
}
}
protected override bool IsOnlineScope => Scope != BeatmapLeaderboardScope.Local;