From: Holger Schemel Date: Tue, 14 Jun 2022 23:40:06 +0000 (+0200) Subject: added not using touch buttons if touch controls are disabled X-Git-Tag: 4.3.2.2~2 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=e5804efb99033c96d71c37ce89f60e1ee23b7004;p=rocksndiamonds.git added not using touch buttons if touch controls are disabled --- diff --git a/src/game.c b/src/game.c index 3985ce1b..68fb40c6 100644 --- a/src/game.c +++ b/src/game.c @@ -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; diff --git a/src/screens.c b/src/screens.c index d027efa2..98c7b68a 100644 --- a/src/screens.c +++ b/src/screens.c @@ -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)); diff --git a/src/tools.c b/src/tools.c index bb6668d1..912b1836 100644 --- a/src/tools.c +++ b/src/tools.c @@ -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);