mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Add non-hiding selection state
This commit is contained in:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user