1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-28 01:05:52 +08:00

Fix "use these mods" option showing if it can't do anything

Closes https://github.com/ppy/osu/issues/32230.
This commit is contained in:
Bartłomiej Dach
2025-03-05 09:40:11 +01:00
Unverified
parent 097dd70139
commit 0ac3a80406
2 changed files with 10 additions and 11 deletions
@@ -452,11 +452,11 @@ namespace osu.Game.Online.Leaderboards
{
List<MenuItem> items = new List<MenuItem>();
if (Score.Mods.Length > 0 && songSelect != null)
{
// system mods should never be copied across regardless of anything.
items.Add(new OsuMenuItem("Use these mods", MenuItemType.Highlighted, () => songSelect.Mods.Value = Score.Mods.Where(m => m.Type != ModType.System).ToArray()));
}
// system mods should never be copied across regardless of anything.
var copyableMods = Score.Mods.Where(m => m.Type != ModType.System).ToArray();
if (copyableMods.Length > 0 && songSelect != null)
items.Add(new OsuMenuItem("Use these mods", MenuItemType.Highlighted, () => songSelect.Mods.Value = copyableMods));
if (Score.OnlineID > 0)
items.Add(new OsuMenuItem(CommonStrings.CopyLink, MenuItemType.Standard, () => clipboard?.SetText($@"{api.Endpoints.WebsiteUrl}/scores/{Score.OnlineID}")));
@@ -780,12 +780,11 @@ namespace osu.Game.Screens.SelectV2.Leaderboards
{
List<MenuItem> items = new List<MenuItem>();
if (score.Mods.Length > 0)
{
// system mods should never be copied across regardless of anything.
items.Add(new OsuMenuItem("Use these mods", MenuItemType.Highlighted,
() => SelectedMods.Value = score.Mods.Where(m => IsValidMod.Invoke(m) && m.Type != ModType.System).ToArray()));
}
// system mods should never be copied across regardless of anything.
var copyableMods = score.Mods.Where(m => IsValidMod.Invoke(m) && m.Type != ModType.System).ToArray();
if (copyableMods.Length > 0)
items.Add(new OsuMenuItem("Use these mods", MenuItemType.Highlighted, () => SelectedMods.Value = copyableMods));
if (score.OnlineID > 0)
items.Add(new OsuMenuItem(CommonStrings.CopyLink, MenuItemType.Standard, () => clipboard?.SetText($@"{api.Endpoints.WebsiteUrl}/scores/{score.OnlineID}")));