mirror of
https://github.com/ppy/osu.git
synced 2026-05-28 04:14:26 +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:
@@ -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}")));
|
||||
|
||||
Reference in New Issue
Block a user