1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 15:26:07 +08:00

Hide children of SelectionBlueprint when not selected

This commit is contained in:
Dean Herbert 2020-10-09 14:03:13 +09:00
parent 02d45529fc
commit beec0e4193

View File

@ -89,9 +89,23 @@ namespace osu.Game.Rulesets.Edit
}
}
protected virtual void OnDeselected() => Hide();
protected virtual void OnDeselected()
{
// selection blueprints are AlwaysPresent while the related DrawableHitObject is visible
// set the body piece's alpha directly to avoid arbitrarily rendering frame buffers etc. of children.
foreach (var d in InternalChildren)
d.Hide();
protected virtual void OnSelected() => Show();
Hide();
}
protected virtual void OnSelected()
{
foreach (var d in InternalChildren)
d.Show();
Show();
}
// When not selected, input is only required for the blueprint itself to receive IsHovering
protected override bool ShouldBeConsideredForInput(Drawable child) => State == SelectionState.Selected;