mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 09:27:18 +09: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 ScrollContainer scrollContainer;
|
||||||
private readonly FillFlowContainer<LeaderboardScore> scrollFlow;
|
private readonly FillFlowContainer<LeaderboardScore> scrollFlow;
|
||||||
|
|
||||||
|
public Action<Score> ScoreSelected;
|
||||||
|
|
||||||
private IEnumerable<Score> scores;
|
private IEnumerable<Score> scores;
|
||||||
public IEnumerable<Score> Scores
|
public IEnumerable<Score> Scores
|
||||||
{
|
{
|
||||||
@ -52,6 +54,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
var ls = new LeaderboardScore(s, 1 + i)
|
var ls = new LeaderboardScore(s, 1 + i)
|
||||||
{
|
{
|
||||||
AlwaysPresent = true,
|
AlwaysPresent = true,
|
||||||
|
Action = () => ScoreSelected?.Invoke(s),
|
||||||
State = Visibility.Hidden,
|
State = Visibility.Hidden,
|
||||||
};
|
};
|
||||||
scrollFlow.Add(ls);
|
scrollFlow.Add(ls);
|
||||||
|
@ -17,7 +17,7 @@ using osu.Game.Rulesets.Scoring;
|
|||||||
|
|
||||||
namespace osu.Game.Screens.Select.Leaderboards
|
namespace osu.Game.Screens.Select.Leaderboards
|
||||||
{
|
{
|
||||||
public class LeaderboardScore : Container, IStateful<Visibility>
|
public class LeaderboardScore : ClickableContainer, IStateful<Visibility>
|
||||||
{
|
{
|
||||||
public static readonly float HEIGHT = 60;
|
public static readonly float HEIGHT = 60;
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ using osu.Game.Graphics;
|
|||||||
using osu.Game.Overlays.Mods;
|
using osu.Game.Overlays.Mods;
|
||||||
using osu.Game.Screens.Edit;
|
using osu.Game.Screens.Edit;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
|
using osu.Game.Screens.Ranking;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Select
|
namespace osu.Game.Screens.Select
|
||||||
{
|
{
|
||||||
@ -35,6 +36,8 @@ namespace osu.Game.Screens.Select
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Padding = new MarginPadding { Top = 10, Right = 5 },
|
Padding = new MarginPadding { Top = 10, Right = 5 },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
beatmapDetails.Leaderboard.ScoreSelected += s => Push(new Results(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user