mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-29 15:58:33 +01:00
added some more element events
This commit is contained in:
parent
026b79b61e
commit
ae4ced1cc1
1 changed files with 6 additions and 0 deletions
|
@ -69,6 +69,8 @@ namespace MLEM.Ui.Elements {
|
||||||
public Rectangle ChildPaddedArea => this.UnscrolledArea.Shrink(this.ScaledChildPadding);
|
public Rectangle ChildPaddedArea => this.UnscrolledArea.Shrink(this.ScaledChildPadding);
|
||||||
public Point ScaledChildPadding => this.childPadding.Multiply(this.Scale);
|
public Point ScaledChildPadding => this.childPadding.Multiply(this.Scale);
|
||||||
|
|
||||||
|
public DrawCallback OnDrawn;
|
||||||
|
public TimeCallback OnUpdated;
|
||||||
public GenericCallback OnPressed;
|
public GenericCallback OnPressed;
|
||||||
public GenericCallback OnSecondaryPressed;
|
public GenericCallback OnSecondaryPressed;
|
||||||
public GenericCallback OnSelected;
|
public GenericCallback OnSelected;
|
||||||
|
@ -420,6 +422,8 @@ namespace MLEM.Ui.Elements {
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Update(GameTime time) {
|
public virtual void Update(GameTime time) {
|
||||||
|
this.System.OnElementUpdated?.Invoke(this, time);
|
||||||
|
|
||||||
foreach (var child in this.GetRelevantChildren())
|
foreach (var child in this.GetRelevantChildren())
|
||||||
child.Update(time);
|
child.Update(time);
|
||||||
}
|
}
|
||||||
|
@ -470,6 +474,8 @@ namespace MLEM.Ui.Elements {
|
||||||
|
|
||||||
public delegate void DrawCallback(Element element, GameTime time, SpriteBatch batch, float alpha);
|
public delegate void DrawCallback(Element element, GameTime time, SpriteBatch batch, float alpha);
|
||||||
|
|
||||||
|
public delegate void TimeCallback(Element element, GameTime time);
|
||||||
|
|
||||||
public delegate Element TabNextElementCallback(bool backward, Element usualNext);
|
public delegate Element TabNextElementCallback(bool backward, Element usualNext);
|
||||||
|
|
||||||
public delegate Element GamepadNextElementCallback(Direction2 dir, Element usualNext);
|
public delegate Element GamepadNextElementCallback(Direction2 dir, Element usualNext);
|
||||||
|
|
Loading…
Reference in a new issue