mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 04:53:29 +01:00
Remove all elements from a UiSystem when it is disposed
This commit is contained in:
parent
b2f457088d
commit
2463c27a5d
2 changed files with 9 additions and 0 deletions
|
@ -44,6 +44,7 @@ Improvements
|
|||
- Improved the SquishingGroup algorithm by prioritizing each element's final size
|
||||
- Allow specifying start and end indices when drawing a Paragraph
|
||||
- Allow elements with larger children to influence a panel's scrollable area
|
||||
- Remove all elements from a UiSystem when it is disposed
|
||||
|
||||
Fixes
|
||||
- Fixed images not updating their hidden state properly when the displayed texture changes
|
||||
|
|
|
@ -419,6 +419,14 @@ namespace MLEM.Ui {
|
|||
root.Element.AndChildren(action);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Dispose(bool disposing) {
|
||||
if (disposing) {
|
||||
while (this.rootElements.Count > 0)
|
||||
this.Remove(this.rootElements[0].Name);
|
||||
}
|
||||
}
|
||||
|
||||
internal void InvokeOnElementDrawn(Element element, GameTime time, SpriteBatch batch, float alpha) {
|
||||
this.OnElementDrawn?.Invoke(element, time, batch, alpha);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue