Remember mod selection when re-entering song select

Removes mod application when exiting back to main menu.

Alternative to #1968.
Closes #1961.
This commit is contained in:
Dean Herbert
2018-01-26 19:30:29 +09:00
parent 545a4bd082
commit 7852015db3
5 changed files with 74 additions and 32 deletions

View File

@ -113,6 +113,23 @@ namespace osu.Game.Overlays.Mods
}
}
/// <summary>
/// Select one or more mods in this section.
/// </summary>
/// <param name="mods">The types of <see cref="Mod"/>s which should be deselected.</param>
public void SelectTypes(IEnumerable<Mod> mods)
{
foreach (var button in buttons)
{
for (int i = 0; i < button.Mods.Length; i++)
{
foreach (var mod in mods)
if (mod.GetType().IsInstanceOfType(button.Mods[i]))
button.SelectAt(i);
}
}
}
protected ModSection()
{
AutoSizeAxes = Axes.Y;