added not using touch buttons if touch controls are disabled
authorHolger Schemel <info@artsoft.org>
Tue, 14 Jun 2022 23:40:06 +0000 (01:40 +0200)
committerHolger Schemel <info@artsoft.org>
Tue, 14 Jun 2022 23:40:06 +0000 (01:40 +0200)
src/game.c
src/screens.c
src/tools.c

index 3985ce1b47564ae57618bd167260cb80bc41a71b..68fb40c6e12dc3c2c27433c0955fb5ea7a4e086a 100644 (file)
@@ -16300,6 +16300,11 @@ void CreateGameButtons(void)
     int y = (is_touch_button ? pos->y : GDI_ACTIVE_POS(pos->y));
     int id = i;
 
+    // do not use touch buttons if touch controls are disabled
+    if (is_touch_button &&
+       strEqual(setup.touch.control_type, TOUCH_CONTROL_OFF))
+      continue;
+
     if (gfx->bitmap == NULL)
     {
       game_gadget[id] = NULL;
index d027efa27227ff95e00338bc6a1c8d457683932f..98c7b68ace401ba8fd957d093e854df88b90b466 100644 (file)
@@ -9745,6 +9745,11 @@ static void CreateScreenMenubuttons(void)
     int type = GD_TYPE_NORMAL_BUTTON;
     boolean checked = FALSE;
 
+    // do not use touch buttons if touch controls are disabled
+    if (is_touch_button &&
+       strEqual(setup.touch.control_type, TOUCH_CONTROL_OFF))
+      continue;
+
     event_mask = menubutton_info[i].event_mask;
 
     x = (is_touch_button ? pos->x : mSX + GDI_ACTIVE_POS(pos->x));
index bb6668d132352245bea54c643be154ea6c1b6ed3..912b18360309377682654e9b9d831604eaaf0005 100644 (file)
@@ -5857,6 +5857,11 @@ void CreateToolButtons(void)
     int y = pos->y;
     int id = i;
 
+    // do not use touch buttons if touch controls are disabled
+    if (is_touch_button &&
+       strEqual(setup.touch.control_type, TOUCH_CONTROL_OFF))
+      continue;
+
     if (global.use_envelope_request && !is_touch_button)
     {
       setRequestPosition(&base_x, &base_y, TRUE);