mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Add back immediate deselection flow to ensure user selections can occur without contention
This commit is contained in:
@ -158,7 +158,8 @@ namespace osu.Game.Overlays.Mods
|
|||||||
/// Deselect one or more mods in this section.
|
/// Deselect one or more mods in this section.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="modTypes">The types of <see cref="Mod"/>s which should be deselected.</param>
|
/// <param name="modTypes">The types of <see cref="Mod"/>s which should be deselected.</param>
|
||||||
public void DeselectTypes(IEnumerable<Type> modTypes)
|
/// <param name="immediate">Whether the deselection should happen immediately. Should only be used when required to ensure correct selection flow.</param>
|
||||||
|
public void DeselectTypes(IEnumerable<Type> modTypes, bool immediate = false)
|
||||||
{
|
{
|
||||||
foreach (var button in buttons)
|
foreach (var button in buttons)
|
||||||
{
|
{
|
||||||
@ -167,7 +168,12 @@ namespace osu.Game.Overlays.Mods
|
|||||||
foreach (var type in modTypes)
|
foreach (var type in modTypes)
|
||||||
{
|
{
|
||||||
if (type.IsInstanceOfType(button.SelectedMod))
|
if (type.IsInstanceOfType(button.SelectedMod))
|
||||||
pendingSelectionOperations.Enqueue(button.Deselect);
|
{
|
||||||
|
if (immediate)
|
||||||
|
button.Deselect();
|
||||||
|
else
|
||||||
|
pendingSelectionOperations.Enqueue(button.Deselect);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
base.OnModSelected(mod);
|
base.OnModSelected(mod);
|
||||||
|
|
||||||
foreach (var section in ModSectionsContainer.Children)
|
foreach (var section in ModSectionsContainer.Children)
|
||||||
section.DeselectTypes(mod.IncompatibleMods);
|
section.DeselectTypes(mod.IncompatibleMods, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user