Add non-hiding selection state

This commit is contained in:
Dean Herbert
2020-01-21 14:21:00 +09:00
parent 53fe0ce790
commit 8f16c1cb04
2 changed files with 14 additions and 4 deletions

View File

@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Edit
RelativeSizeAxes = Axes.Both;
AlwaysPresent = true;
Alpha = 0;
OnDeselected();
}
private SelectionState state;
@ -64,12 +64,12 @@ namespace osu.Game.Rulesets.Edit
switch (state)
{
case SelectionState.Selected:
Show();
OnSelected();
Selected?.Invoke(this);
break;
case SelectionState.NotSelected:
Hide();
OnDeselected();
Deselected?.Invoke(this);
break;
}
@ -78,6 +78,10 @@ namespace osu.Game.Rulesets.Edit
}
}
protected virtual void OnDeselected() => Hide();
protected virtual void OnSelected() => Show();
// When not selected, input is only required for the blueprint itself to receive IsHovering
protected override bool ShouldBeConsideredForInput(Drawable child) => State == SelectionState.Selected;