1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:52:53 +08:00

Make leaderboard scores clickable.

This commit is contained in:
Dean Herbert 2017-04-11 14:01:47 +09:00
parent d51b37cb44
commit 7d32cc85c8
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
3 changed files with 7 additions and 1 deletions

View File

@ -23,6 +23,8 @@ namespace osu.Game.Screens.Select.Leaderboards
private readonly ScrollContainer scrollContainer;
private readonly FillFlowContainer<LeaderboardScore> scrollFlow;
public Action<Score> ScoreSelected;
private IEnumerable<Score> scores;
public IEnumerable<Score> Scores
{
@ -52,6 +54,7 @@ namespace osu.Game.Screens.Select.Leaderboards
var ls = new LeaderboardScore(s, 1 + i)
{
AlwaysPresent = true,
Action = () => ScoreSelected?.Invoke(s),
State = Visibility.Hidden,
};
scrollFlow.Add(ls);

View File

@ -17,7 +17,7 @@ using osu.Game.Rulesets.Scoring;
namespace osu.Game.Screens.Select.Leaderboards
{
public class LeaderboardScore : Container, IStateful<Visibility>
public class LeaderboardScore : ClickableContainer, IStateful<Visibility>
{
public static readonly float HEIGHT = 60;

View File

@ -12,6 +12,7 @@ using osu.Game.Graphics;
using osu.Game.Overlays.Mods;
using osu.Game.Screens.Edit;
using osu.Game.Screens.Play;
using osu.Game.Screens.Ranking;
namespace osu.Game.Screens.Select
{
@ -35,6 +36,8 @@ namespace osu.Game.Screens.Select
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Top = 10, Right = 5 },
});
beatmapDetails.Leaderboard.ScoreSelected += s => Push(new Results(s));
}
[BackgroundDependencyLoader]