1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 21:53:21 +08:00

Update dependency

This commit is contained in:
Andrei Zavatski 2019-11-13 00:26:19 +03:00
parent 2719be7769
commit 99ec84ed38

View File

@ -54,13 +54,9 @@ namespace osu.Game.Overlays.BeatmapSet
modsContainer.Add(new ModButton(new NoMod()));
ruleset.NewValue.CreateInstance().GetAllMods().ForEach(mod =>
{
if (mod.Ranked)
modsContainer.Add(new ModButton(mod));
});
modsContainer.AddRange(ruleset.NewValue.CreateInstance().GetAllMods().Where(m => m.Ranked).Select(m => new ModButton(m)));
modsContainer.ForEach(button => button.OnSelectionChanged += selectionChanged);
modsContainer.ForEach(button => button.OnSelectionChanged = selectionChanged);
}
private void selectionChanged(Mod mod, bool selected)
@ -77,11 +73,7 @@ namespace osu.Game.Overlays.BeatmapSet
protected override bool OnHover(HoverEvent e)
{
if (!SelectedMods.Any())
modsContainer.ForEach(button =>
{
if (!button.IsHovered)
button.Highlighted.Value = false;
});
modsContainer.Children.Where(button => !button.IsHovered).ForEach(button => button.Highlighted.Value = false);
return base.OnHover(e);
}