mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 04:53:29 +01:00
cleaned up element ui addition order (0fab7fe
)
This commit is contained in:
parent
0fab7fe859
commit
a233477b1e
2 changed files with 3 additions and 8 deletions
|
@ -588,10 +588,7 @@ namespace MLEM.Ui.Elements {
|
|||
index = this.children.Count;
|
||||
this.children.Insert(index, element);
|
||||
element.Parent = this;
|
||||
element.AndChildren(e => {
|
||||
e.SetAreaDirty();
|
||||
e.AddedToUi(this.System, this.Root);
|
||||
});
|
||||
element.AndChildren(e => e.AddedToUi(this.System, this.Root));
|
||||
this.OnChildAdded?.Invoke(this, element);
|
||||
this.SetSortedChildrenDirty();
|
||||
return element;
|
||||
|
@ -1344,6 +1341,7 @@ namespace MLEM.Ui.Elements {
|
|||
protected internal virtual void AddedToUi(UiSystem system, RootElement root) {
|
||||
this.Root = root;
|
||||
this.System = system;
|
||||
this.SetAreaDirty();
|
||||
this.OnAddedToUi?.Invoke(this);
|
||||
root?.InvokeOnElementAdded(this);
|
||||
}
|
||||
|
|
|
@ -351,10 +351,7 @@ namespace MLEM.Ui {
|
|||
return null;
|
||||
var root = new RootElement(name, element, this);
|
||||
this.rootElements.Add(root);
|
||||
root.Element.AndChildren(e => {
|
||||
e.SetAreaDirty();
|
||||
e.AddedToUi(this, root);
|
||||
});
|
||||
root.Element.AndChildren(e => e.AddedToUi(this, root));
|
||||
this.OnRootAdded?.Invoke(root);
|
||||
root.InvokeOnAddedToUi(this);
|
||||
this.SortRoots();
|
||||
|
|
Loading…
Reference in a new issue