From b237c0fcc4ed8cbdebcdd8eaf39eb02bf7ee742d Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 31 May 2020 21:10:01 +0200 Subject: [PATCH] added SetGesturesEnabled --- MLEM/Input/InputHandler.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/MLEM/Input/InputHandler.cs b/MLEM/Input/InputHandler.cs index ab2cb72..4cd8910 100644 --- a/MLEM/Input/InputHandler.cs +++ b/MLEM/Input/InputHandler.cs @@ -512,5 +512,20 @@ namespace MLEM.Input { TouchPanel.EnabledGestures &= ~gesture; } + /// + /// Helper function to enable or disable the given gestures for a easily. + /// This method is equivalent to calling if the enabled value is true and calling if it is false. + /// Note that, if other gestures were previously enabled, they will not get overridden. + /// + /// Whether to enable or disable the gestures + /// The gestures to enable or disable + public static void SetGesturesEnabled(bool enabled, params GestureType[] gestures) { + if (enabled) { + EnableGestures(gestures); + } else { + DisableGestures(gestures); + } + } + } } \ No newline at end of file