1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 19:22:54 +08:00

Fix slider circles not being selected by default

This commit is contained in:
smoogipoo 2020-01-24 17:51:24 +09:00
parent 811ddb02a4
commit 027778acc1

View File

@ -41,14 +41,15 @@ namespace osu.Game.Rulesets.Edit
protected SelectionBlueprint(HitObject hitObject) protected SelectionBlueprint(HitObject hitObject)
{ {
HitObject = hitObject; HitObject = hitObject;
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
AlwaysPresent = true;
} }
[BackgroundDependencyLoader] protected override void LoadComplete()
private void load()
{ {
OnDeselected(); base.LoadComplete();
AlwaysPresent = true; updateState();
} }
private SelectionState state; private SelectionState state;
@ -65,23 +66,29 @@ namespace osu.Game.Rulesets.Edit
state = value; state = value;
switch (state) if (IsLoaded)
{ updateState();
case SelectionState.Selected:
OnSelected();
Selected?.Invoke(this);
break;
case SelectionState.NotSelected:
OnDeselected();
Deselected?.Invoke(this);
break;
}
StateChanged?.Invoke(state); 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 OnDeselected() => Hide();
protected virtual void OnSelected() => Show(); protected virtual void OnSelected() => Show();