added option 'off' for touch controls (for non-Android platforms)
authorHolger Schemel <info@artsoft.org>
Tue, 28 Nov 2017 08:50:26 +0000 (09:50 +0100)
committerHolger Schemel <info@artsoft.org>
Fri, 23 Mar 2018 22:21:17 +0000 (23:21 +0100)
src/events.c
src/libgame/system.h
src/screens.c

index bbc211745fd01ed7ce09ab5648d3c550d0edab80..c7707c2f6f9fcc7c3904003cac863a518fd66243 100644 (file)
@@ -676,7 +676,7 @@ void HandleFingerEvent(FingerEvent *event)
   if (game_status != GAME_MODE_PLAYING)
     return;
 
-  if (strEqual(setup.touch.control_type, TOUCH_CONTROL_FOLLOW_FINGER))
+  if (strEqual(setup.touch.control_type, TOUCH_CONTROL_OFF))
     return;
 
   if (strEqual(setup.touch.control_type, TOUCH_CONTROL_VIRTUAL_BUTTONS))
@@ -824,6 +824,9 @@ void HandleFingerEvent(FingerEvent *event)
     return;
   }
 
+  if (!strEqual(setup.touch.control_type, TOUCH_CONTROL_WIPE_GESTURES))
+    return;
+
   // use touch direction control
 
   if (event->type == EVENT_FINGERPRESS)
index d11f71b4bf56962f43c34efe73da8c9cd0230bf4..871fcd89c4d2a94c4c4a9210d1c1c27c46f5b9a0 100644 (file)
 #endif
 
 /* values for touch control */
+#define TOUCH_CONTROL_OFF              "off"
 #define TOUCH_CONTROL_VIRTUAL_BUTTONS  "virtual_buttons"
 #define TOUCH_CONTROL_WIPE_GESTURES    "wipe_gestures"
 #define TOUCH_CONTROL_FOLLOW_FINGER    "follow_finger"
 
+#if defined(PLATFORM_ANDROID)
 #define TOUCH_CONTROL_DEFAULT          TOUCH_CONTROL_VIRTUAL_BUTTONS
+#else
+#define TOUCH_CONTROL_DEFAULT          TOUCH_CONTROL_OFF
+#endif
 
 #define TOUCH_MOVE_DISTANCE_DEFAULT    2
 #define TOUCH_DROP_DISTANCE_DEFAULT    5
index 3eff48ed7c0cc40789d074ed428e6a969d522c24..680b2e62170e727c80e515b5bf1cb35925df6187 100644 (file)
@@ -421,6 +421,7 @@ static struct
   char *text;
 } touch_controls_list[] =
 {
+  {    TOUCH_CONTROL_OFF,              "Off"                   },
   {    TOUCH_CONTROL_VIRTUAL_BUTTONS,  "Virtual Buttons"       },
   {    TOUCH_CONTROL_WIPE_GESTURES,    "Wipe Gestures"         },
   {    TOUCH_CONTROL_FOLLOW_FINGER,    "Follow Finger"         },