mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 16:52:54 +08:00
Fix slider circles not being selected by default
This commit is contained in:
parent
811ddb02a4
commit
027778acc1
@ -41,14 +41,15 @@ namespace osu.Game.Rulesets.Edit
|
||||
protected SelectionBlueprint(HitObject hitObject)
|
||||
{
|
||||
HitObject = hitObject;
|
||||
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
AlwaysPresent = true;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
OnDeselected();
|
||||
AlwaysPresent = true;
|
||||
base.LoadComplete();
|
||||
updateState();
|
||||
}
|
||||
|
||||
private SelectionState state;
|
||||
@ -65,23 +66,29 @@ namespace osu.Game.Rulesets.Edit
|
||||
|
||||
state = value;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case SelectionState.Selected:
|
||||
OnSelected();
|
||||
Selected?.Invoke(this);
|
||||
break;
|
||||
|
||||
case SelectionState.NotSelected:
|
||||
OnDeselected();
|
||||
Deselected?.Invoke(this);
|
||||
break;
|
||||
}
|
||||
if (IsLoaded)
|
||||
updateState();
|
||||
|
||||
StateChanged?.Invoke(state);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateState()
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case SelectionState.Selected:
|
||||
OnSelected();
|
||||
Selected?.Invoke(this);
|
||||
break;
|
||||
|
||||
case SelectionState.NotSelected:
|
||||
OnDeselected();
|
||||
Deselected?.Invoke(this);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnDeselected() => Hide();
|
||||
|
||||
protected virtual void OnSelected() => Show();
|
||||
|
Loading…
Reference in New Issue
Block a user