mirror of https://github.com/ppy/osu
Implement updateHighlighted method
This commit is contained in:
parent
984ec11a78
commit
23fc7b1987
|
@ -64,24 +64,34 @@ private void selectionChanged(Mod mod, bool selected)
|
|||
else
|
||||
SelectedMods.Remove(mod);
|
||||
|
||||
if (!SelectedMods.Any() && !IsHovered)
|
||||
updateHighlighted();
|
||||
}
|
||||
|
||||
private void updateHighlighted()
|
||||
{
|
||||
if (SelectedMods.Any())
|
||||
return;
|
||||
|
||||
if (IsHovered)
|
||||
{
|
||||
modsContainer.Children.Where(button => !button.IsHovered).ForEach(button => button.Highlighted.Value = false);
|
||||
}
|
||||
else
|
||||
{
|
||||
highlightAll();
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool OnHover(HoverEvent e)
|
||||
{
|
||||
if (!SelectedMods.Any())
|
||||
modsContainer.Children.Where(button => !button.IsHovered).ForEach(button => button.Highlighted.Value = false);
|
||||
|
||||
updateHighlighted();
|
||||
return base.OnHover(e);
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(HoverLostEvent e)
|
||||
{
|
||||
base.OnHoverLost(e);
|
||||
|
||||
if (!SelectedMods.Any())
|
||||
highlightAll();
|
||||
updateHighlighted();
|
||||
}
|
||||
|
||||
public void DeselectAll() => modsContainer.ForEach(mod => mod.Selected.Value = false);
|
||||
|
|
Loading…
Reference in New Issue