mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 21:02:55 +08:00
Add highlightAll function to avoid duplication
This commit is contained in:
parent
86c9d5251f
commit
cf92d6b1b0
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user