Push results screen when clicking on top score

This commit is contained in:
Andrei Zavatski 2019-07-15 12:30:42 +03:00
parent 9c13ede5a8
commit 7e367dc397
2 changed files with 9 additions and 1 deletions

View File

@ -8,6 +8,8 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Leaderboards;
using osu.Game.Scoring;
using System;
namespace osu.Game.Screens.Select.Details
{
@ -21,6 +23,8 @@ namespace osu.Game.Screens.Select.Details
public Bindable<APILegacyUserTopScoreInfo> Score = new Bindable<APILegacyUserTopScoreInfo>();
public Action<ScoreInfo> ScoreSelected;
protected override bool StartHidden => true;
public UserTopScoreContainer()
@ -66,7 +70,10 @@ namespace osu.Game.Screens.Select.Details
if (score != null)
{
scoreContainer.Clear();
scoreContainer.Add(new LeaderboardScore(score.Score, score.Position));
scoreContainer.Add(new LeaderboardScore(score.Score, score.Position)
{
Action = () => ScoreSelected?.Invoke(score.Score)
});
Show();
}
else

View File

@ -216,6 +216,7 @@ namespace osu.Game.Screens.Select
}
BeatmapDetails.Leaderboard.ScoreSelected += s => this.Push(new SoloResults(s));
BeatmapDetails.TopScore.ScoreSelected += s => this.Push(new SoloResults(s));
}
[BackgroundDependencyLoader(true)]