mirror of https://github.com/ppy/osu
Move event subscription to LoadComplete
Prevents attempting to read from the `colours` field before it is actually injected.
This commit is contained in:
parent
6627e7e459
commit
b1029a124c
|
@ -113,7 +113,6 @@ public ControlGroupAttributes(ControlPointGroup group)
|
|||
};
|
||||
|
||||
controlPoints = group.ControlPoints.GetBoundCopy();
|
||||
controlPoints.CollectionChanged += (_, __) => createChildren();
|
||||
}
|
||||
|
||||
[Resolved]
|
||||
|
@ -125,6 +124,12 @@ private void load()
|
|||
createChildren();
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
controlPoints.CollectionChanged += (_, __) => createChildren();
|
||||
}
|
||||
|
||||
private void createChildren()
|
||||
{
|
||||
fill.ChildrenEnumerable = controlPoints.Select(createAttribute).Where(c => c != null);
|
||||
|
|
Loading…
Reference in New Issue