mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 18:42:56 +08:00
Merge pull request #9536 from Joehuu/select-mods-from-score
Add ability to select mods from a specific score in song select
This commit is contained in:
commit
744e695174
@ -170,7 +170,11 @@ namespace osu.Game.Online.Leaderboards
|
||||
{
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
new GridContainer
|
||||
new OsuContextMenuContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Masking = true,
|
||||
Child = new GridContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
RowDimensions = new[]
|
||||
@ -182,15 +186,11 @@ namespace osu.Game.Online.Leaderboards
|
||||
{
|
||||
new Drawable[]
|
||||
{
|
||||
new OsuContextMenuContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Child = scrollContainer = new OsuScrollContainer
|
||||
scrollContainer = new OsuScrollContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
ScrollbarVisible = false,
|
||||
}
|
||||
}
|
||||
},
|
||||
new Drawable[]
|
||||
{
|
||||
@ -202,6 +202,7 @@ namespace osu.Game.Online.Leaderboards
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
loading = new LoadingSpinner(),
|
||||
placeholderContainer = new Container
|
||||
{
|
||||
|
@ -58,6 +58,9 @@ namespace osu.Game.Online.Leaderboards
|
||||
[Resolved(CanBeNull = true)]
|
||||
private DialogOverlay dialogOverlay { get; set; }
|
||||
|
||||
[Resolved(CanBeNull = true)]
|
||||
private SongSelect songSelect { get; set; }
|
||||
|
||||
public LeaderboardScore(ScoreInfo score, int? rank, bool allowHighlight = true)
|
||||
{
|
||||
this.score = score;
|
||||
@ -373,6 +376,9 @@ namespace osu.Game.Online.Leaderboards
|
||||
{
|
||||
List<MenuItem> items = new List<MenuItem>();
|
||||
|
||||
if (score.Mods.Length > 0 && modsContainer.Any(s => s.IsHovered) && songSelect != null)
|
||||
items.Add(new OsuMenuItem("Use these mods", MenuItemType.Highlighted, () => songSelect.Mods.Value = score.Mods));
|
||||
|
||||
if (score.ID != 0)
|
||||
items.Add(new OsuMenuItem("Delete", MenuItemType.Destructive, () => dialogOverlay?.Push(new LocalScoreDeleteDialog(score))));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user