Implement the freemod selection overlay

This commit is contained in:
smoogipoo
2021-02-02 21:14:38 +09:00
parent 8b3a85daa7
commit 643c0605d8
4 changed files with 165 additions and 10 deletions

View File

@ -94,7 +94,20 @@ namespace osu.Game.Overlays.Mods
return base.OnKeyDown(e);
}
public void DeselectAll() => DeselectTypes(buttons.Select(b => b.SelectedMod?.GetType()).Where(t => t != null));
/// <summary>
/// Selects all mods.
/// </summary>
public void SelectAll()
{
foreach (var button in buttons.Where(b => !b.Selected))
button.SelectAt(0);
}
/// <summary>
/// Deselects all mods.
/// </summary>
/// <param name="immediate">Set to true to bypass animations and update selections immediately.</param>
public void DeselectAll(bool immediate = false) => DeselectTypes(buttons.Select(b => b.SelectedMod?.GetType()).Where(t => t != null), immediate);
/// <summary>
/// Deselect one or more mods in this section.