mirror of
https://github.com/ppy/osu
synced 2025-04-21 14:35:52 +00:00
Move null check to menu item addition
This commit is contained in:
parent
ac7252e152
commit
db6a9c9717
@ -376,8 +376,8 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
{
|
{
|
||||||
List<MenuItem> items = new List<MenuItem>();
|
List<MenuItem> items = new List<MenuItem>();
|
||||||
|
|
||||||
if (score.Mods.Length > 0 && modsContainer.Any(s => s.IsHovered))
|
if (score.Mods.Length > 0 && modsContainer.Any(s => s.IsHovered) && songSelect != null)
|
||||||
items.Add(new OsuMenuItem("Use these mods", MenuItemType.Highlighted, getMods));
|
items.Add(new OsuMenuItem("Use these mods", MenuItemType.Highlighted, () => songSelect.Mods.Value = score.Mods));
|
||||||
|
|
||||||
if (score.ID != 0)
|
if (score.ID != 0)
|
||||||
items.Add(new OsuMenuItem("Delete", MenuItemType.Destructive, () => dialogOverlay?.Push(new LocalScoreDeleteDialog(score))));
|
items.Add(new OsuMenuItem("Delete", MenuItemType.Destructive, () => dialogOverlay?.Push(new LocalScoreDeleteDialog(score))));
|
||||||
@ -385,11 +385,5 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
return items.ToArray();
|
return items.ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getMods()
|
|
||||||
{
|
|
||||||
if (songSelect != null)
|
|
||||||
songSelect.Mods.Value = score.Mods;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user