X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fevents.c;h=3d1163638a24738f20af985e658300d3e8eedd10;hp=c40075e4d375faa0157249fbd68e9d909ba26b41;hb=40f85093a4a5f80c37d7a9847f5b10c230c76690;hpb=84b00c096ac7311cd019cc84969ff2d88353b3fa diff --git a/src/events.c b/src/events.c index c40075e4..3d116363 100644 --- a/src/events.c +++ b/src/events.c @@ -401,6 +401,10 @@ void SetPlayerMouseAction(int mx, int my, int button) { int lx = getLevelFromScreenX(mx); int ly = getLevelFromScreenY(my); + int new_button = (!local_player->mouse_action.button && button); + + if (local_player->mouse_action.button_hint) + button = local_player->mouse_action.button_hint; ClearPlayerMouseAction(); @@ -413,10 +417,12 @@ void SetPlayerMouseAction(int mx, int my, int button) if (tape.recording && tape.pausing && tape.use_mouse) { - /* prevent button release or motion events from un-pausing a paused game */ - if (button && !motion_status) - TapeTogglePause(TAPE_TOGGLE_MANUAL); + /* un-pause a paused game only if mouse button was newly pressed down */ + if (new_button) + TapeTogglePause(TAPE_TOGGLE_AUTOMATIC); } + + SetTileCursorXY(lx, ly); } void SleepWhileUnmapped() @@ -957,7 +963,16 @@ void HandleFingerEvent(FingerEvent *event) return; if (level.game_engine_type == GAME_ENGINE_TYPE_MM) + { + if (strEqual(setup.touch.control_type, TOUCH_CONTROL_OFF)) + local_player->mouse_action.button_hint = + (event->type == EVENT_FINGERRELEASE ? MB_NOT_PRESSED : + event->x < 0.5 ? MB_LEFTBUTTON : + event->x > 0.5 ? MB_RIGHTBUTTON : + MB_NOT_PRESSED); + return; + } if (strEqual(setup.touch.control_type, TOUCH_CONTROL_VIRTUAL_BUTTONS)) HandleFingerEvent_VirtualButtons(event); @@ -2340,7 +2355,12 @@ void HandleJoystick() return; } - if (tape.recording && tape.pausing && !tape.use_mouse) + if (tape.single_step && tape.recording && tape.pausing && !tape.use_mouse) + { + if (joystick & JOY_ACTION) + TapeTogglePause(TAPE_TOGGLE_AUTOMATIC); + } + else if (tape.recording && tape.pausing && !tape.use_mouse) { if (joystick & JOY_ACTION) TapeTogglePause(TAPE_TOGGLE_MANUAL);