mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Move inside leaderboard
This commit is contained in:
@ -35,6 +35,10 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
|
|
||||||
private bool scoresLoadedOnce;
|
private bool scoresLoadedOnce;
|
||||||
|
|
||||||
|
private readonly Container content;
|
||||||
|
|
||||||
|
protected override Container<Drawable> Content => content;
|
||||||
|
|
||||||
private IEnumerable<ScoreInfo> scores;
|
private IEnumerable<ScoreInfo> scores;
|
||||||
|
|
||||||
public IEnumerable<ScoreInfo> Scores
|
public IEnumerable<ScoreInfo> Scores
|
||||||
@ -60,13 +64,13 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
// ensure placeholder is hidden when displaying scores
|
// ensure placeholder is hidden when displaying scores
|
||||||
PlaceholderState = PlaceholderState.Successful;
|
PlaceholderState = PlaceholderState.Successful;
|
||||||
|
|
||||||
var sf = CreateScoreFlow();
|
var scoreFlow = CreateScoreFlow();
|
||||||
sf.ChildrenEnumerable = scores.Select((s, index) => CreateDrawableScore(s, index + 1));
|
scoreFlow.ChildrenEnumerable = scores.Select((s, index) => CreateDrawableScore(s, index + 1));
|
||||||
|
|
||||||
// schedule because we may not be loaded yet (LoadComponentAsync complains).
|
// 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;
|
int i = 0;
|
||||||
|
|
||||||
@ -163,11 +167,34 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
protected Leaderboard()
|
protected Leaderboard()
|
||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new GridContainer
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
RowDimensions = new[]
|
||||||
|
{
|
||||||
|
new Dimension(),
|
||||||
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
|
},
|
||||||
|
Content = new[]
|
||||||
|
{
|
||||||
|
new Drawable[]
|
||||||
{
|
{
|
||||||
scrollContainer = new OsuScrollContainer
|
scrollContainer = new OsuScrollContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
ScrollbarVisible = false,
|
ScrollbarVisible = false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new Drawable[]
|
||||||
|
{
|
||||||
|
content = new Container
|
||||||
|
{
|
||||||
|
AutoSizeAxes = Axes.Y,
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
loading = new LoadingAnimation(),
|
loading = new LoadingAnimation(),
|
||||||
placeholderContainer = new Container
|
placeholderContainer = new Container
|
||||||
|
@ -80,6 +80,18 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
if (filterMods)
|
if (filterMods)
|
||||||
UpdateScores();
|
UpdateScores();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
TopScore.BindValueChanged(newTopScore);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void newTopScore(ValueChangedEvent<APILegacyUserTopScoreInfo> score)
|
||||||
|
{
|
||||||
|
Content.Clear();
|
||||||
|
|
||||||
|
if (score.NewValue != null)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool IsOnlineScope => Scope != BeatmapLeaderboardScope.Local;
|
protected override bool IsOnlineScope => Scope != BeatmapLeaderboardScope.Local;
|
||||||
|
Reference in New Issue
Block a user