#define TOOL_CTRL_ID_PLAYER_2 4
#define TOOL_CTRL_ID_PLAYER_3 5
#define TOOL_CTRL_ID_PLAYER_4 6
+#define TOOL_CTRL_ID_TOUCH_YES 7
+#define TOOL_CTRL_ID_TOUCH_NO 8
+#define TOOL_CTRL_ID_TOUCH_CONFIRM 9
-#define NUM_TOOL_BUTTONS 7
+#define NUM_TOOL_BUTTONS 10
// constants for number of doors and door parts
#define NUM_DOORS 2
AnimateEnvelope(envelope_nr, main_anim_mode, ACTION_OPENING);
if (tape.playing)
- Delay(wait_delay_value);
+ Delay_WithScreenUpdates(wait_delay_value);
else
WaitForEventToContinue();
{
MapGadget(tool_gadget[TOOL_CTRL_ID_YES]);
MapGadget(tool_gadget[TOOL_CTRL_ID_NO]);
+ MapGadget(tool_gadget[TOOL_CTRL_ID_TOUCH_YES]);
+ MapGadget(tool_gadget[TOOL_CTRL_ID_TOUCH_NO]);
}
else if (req_state & REQ_CONFIRM)
{
MapGadget(tool_gadget[TOOL_CTRL_ID_CONFIRM]);
+ MapGadget(tool_gadget[TOOL_CTRL_ID_TOUCH_CONFIRM]);
}
else if (req_state & REQ_PLAYER)
{
button_status = MB_RELEASED;
}
- if (HandleGlobalAnimClicks(mx, my, button_status, FALSE))
- {
- // do not handle this button event anymore
- continue; // force mouse event not to be handled at all
- }
-
// this sets 'request_gadget_id'
HandleGadgets(mx, my, button_status);
switch (request_gadget_id)
{
case TOOL_CTRL_ID_YES:
+ case TOOL_CTRL_ID_TOUCH_YES:
result = TRUE;
break;
case TOOL_CTRL_ID_NO:
+ case TOOL_CTRL_ID_TOUCH_NO:
result = FALSE;
break;
case TOOL_CTRL_ID_CONFIRM:
+ case TOOL_CTRL_ID_TOUCH_CONFIRM:
result = TRUE | FALSE;
break;
break;
default:
+ // only check clickable animations if no request gadget clicked
+ HandleGlobalAnimClicks(mx, my, button_status, FALSE);
break;
}
{
MapGadget(tool_gadget[TOOL_CTRL_ID_YES]);
MapGadget(tool_gadget[TOOL_CTRL_ID_NO]);
+ MapGadget(tool_gadget[TOOL_CTRL_ID_TOUCH_YES]);
+ MapGadget(tool_gadget[TOOL_CTRL_ID_TOUCH_NO]);
}
else if (req_state & REQ_CONFIRM)
{
MapGadget(tool_gadget[TOOL_CTRL_ID_CONFIRM]);
+ MapGadget(tool_gadget[TOOL_CTRL_ID_TOUCH_CONFIRM]);
}
else if (req_state & REQ_PLAYER)
{
int graphic;
struct TextPosInfo *pos;
int gadget_id;
+ boolean is_touch_button;
char *infotext;
} toolbutton_info[NUM_TOOL_BUTTONS] =
{
{
IMG_GFX_REQUEST_BUTTON_YES, &request.button.yes,
- TOOL_CTRL_ID_YES, "yes"
+ TOOL_CTRL_ID_YES, FALSE, "yes"
},
{
IMG_GFX_REQUEST_BUTTON_NO, &request.button.no,
- TOOL_CTRL_ID_NO, "no"
+ TOOL_CTRL_ID_NO, FALSE, "no"
},
{
IMG_GFX_REQUEST_BUTTON_CONFIRM, &request.button.confirm,
- TOOL_CTRL_ID_CONFIRM, "confirm"
+ TOOL_CTRL_ID_CONFIRM, FALSE, "confirm"
},
{
IMG_GFX_REQUEST_BUTTON_PLAYER_1, &request.button.player_1,
- TOOL_CTRL_ID_PLAYER_1, "player 1"
+ TOOL_CTRL_ID_PLAYER_1, FALSE, "player 1"
},
{
IMG_GFX_REQUEST_BUTTON_PLAYER_2, &request.button.player_2,
- TOOL_CTRL_ID_PLAYER_2, "player 2"
+ TOOL_CTRL_ID_PLAYER_2, FALSE, "player 2"
},
{
IMG_GFX_REQUEST_BUTTON_PLAYER_3, &request.button.player_3,
- TOOL_CTRL_ID_PLAYER_3, "player 3"
+ TOOL_CTRL_ID_PLAYER_3, FALSE, "player 3"
},
{
IMG_GFX_REQUEST_BUTTON_PLAYER_4, &request.button.player_4,
- TOOL_CTRL_ID_PLAYER_4, "player 4"
+ TOOL_CTRL_ID_PLAYER_4, FALSE, "player 4"
+ },
+ {
+ IMG_GFX_REQUEST_BUTTON_TOUCH_YES, &request.button.touch_yes,
+ TOOL_CTRL_ID_TOUCH_YES, TRUE, "yes"
+ },
+ {
+ IMG_GFX_REQUEST_BUTTON_TOUCH_NO, &request.button.touch_no,
+ TOOL_CTRL_ID_TOUCH_NO, TRUE, "no"
+ },
+ {
+ IMG_GFX_REQUEST_BUTTON_TOUCH_CONFIRM, &request.button.touch_confirm,
+ TOOL_CTRL_ID_TOUCH_CONFIRM, TRUE, "confirm"
}
};
Bitmap *deco_bitmap = None;
int deco_x = 0, deco_y = 0, deco_xpos = 0, deco_ypos = 0;
unsigned int event_mask = GD_EVENT_RELEASED;
- int dx = DX;
- int dy = DY;
+ boolean is_touch_button = toolbutton_info[i].is_touch_button;
+ int base_x = (is_touch_button ? 0 : DX);
+ int base_y = (is_touch_button ? 0 : DY);
int gd_x = gfx->src_x;
int gd_y = gfx->src_y;
int gd_xp = gfx->src_x + gfx->pressed_xoffset;
int y = pos->y;
int id = i;
- if (global.use_envelope_request)
+ if (global.use_envelope_request && !is_touch_button)
{
- setRequestPosition(&dx, &dy, TRUE);
+ setRequestPosition(&base_x, &base_y, TRUE);
// check if request buttons are outside of envelope and fix, if needed
if (x < 0 || x + gfx->width > request.width ||
gi = CreateGadget(GDI_CUSTOM_ID, id,
GDI_IMAGE_ID, graphic,
GDI_INFO_TEXT, toolbutton_info[i].infotext,
- GDI_X, dx + x,
- GDI_Y, dy + y,
+ GDI_X, base_x + x,
+ GDI_Y, base_y + y,
GDI_WIDTH, gfx->width,
GDI_HEIGHT, gfx->height,
GDI_TYPE, GD_TYPE_NORMAL_BUTTON,
GDI_DECORATION_SIZE, pos->size, pos->size,
GDI_DECORATION_SHIFTING, 1, 1,
GDI_DIRECT_DRAW, FALSE,
+ GDI_OVERLAY_TOUCH_BUTTON, is_touch_button,
GDI_EVENT_MASK, event_mask,
GDI_CALLBACK_ACTION, HandleToolButtons,
GDI_END);