1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 00:33:21 +08:00

Add highlightAll function to avoid duplication

This commit is contained in:
Andrei Zavatski 2019-08-12 16:32:04 +03:00
parent 86c9d5251f
commit cf92d6b1b0

View File

@ -76,7 +76,7 @@ namespace osu.Game.Overlays.BeatmapSet
mods.Remove(mod);
if (!mods.Any() && !IsHovered)
modsContainer.ForEach(button => button.Highlighted.Value = true);
highlightAll();
SelectedMods.Value = mods;
}
@ -98,11 +98,13 @@ namespace osu.Game.Overlays.BeatmapSet
base.OnHoverLost(e);
if (!SelectedMods.Value.Any())
modsContainer.ForEach(mod => mod.Highlighted.Value = true);
highlightAll();
}
public void DeselectAll() => modsContainer.ForEach(mod => mod.Selected.Value = false);
private void highlightAll() => modsContainer.ForEach(mod => mod.Highlighted.Value = true);
private class ModButton : ModIcon
{
private const float mod_scale = 0.4f;