From: Holger Schemel Date: Tue, 28 Nov 2017 08:50:26 +0000 (+0100) Subject: added option 'off' for touch controls (for non-Android platforms) X-Git-Tag: 4.1.0.0~41 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=0e98fc357c7de32acf995fdcfacb7e1517e8e60c;p=rocksndiamonds.git added option 'off' for touch controls (for non-Android platforms) --- diff --git a/src/events.c b/src/events.c index bbc21174..c7707c2f 100644 --- a/src/events.c +++ b/src/events.c @@ -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) diff --git a/src/libgame/system.h b/src/libgame/system.h index d11f71b4..871fcd89 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -83,11 +83,16 @@ #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 diff --git a/src/screens.c b/src/screens.c index 3eff48ed..680b2e62 100644 --- a/src/screens.c +++ b/src/screens.c @@ -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" },