diff --git a/MLEM.Ui/UiControls.cs b/MLEM.Ui/UiControls.cs index f2af41e..5cfdc3b 100644 --- a/MLEM.Ui/UiControls.cs +++ b/MLEM.Ui/UiControls.cs @@ -256,5 +256,9 @@ namespace MLEM.Ui { this.SelectElement(this.ActiveRoot, next); } + public static void AddButtons(ref object[] controls, params object[] additional) { + controls = controls.Concat(additional).ToArray(); + } + } } \ No newline at end of file diff --git a/MLEM/Input/InputHandler.cs b/MLEM/Input/InputHandler.cs index 8ffbed1..2d40444 100644 --- a/MLEM/Input/InputHandler.cs +++ b/MLEM/Input/InputHandler.cs @@ -303,6 +303,18 @@ namespace MLEM.Input { throw new ArgumentException(nameof(control)); } + public bool IsAnyDown(params object[] control) { + return control.Any(c => this.IsDown(c)); + } + + public bool IsAnyUp(params object[] control) { + return control.Any(c => this.IsUp(c)); + } + + public bool IsAnyPressed(params object[] control) { + return control.Any(c => this.IsPressed(c)); + } + public static void EnableGestures(params GestureType[] gestures) { foreach (var gesture in gestures) TouchPanel.EnabledGestures |= gesture;