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:
parent
d51b37cb44
commit
7d32cc85c8
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user