fixed name of element 'polarisator' to 'polarizer'
[rocksndiamonds.git] / src / events.c
index 4755d51ff57dc975ba1a27f91d45f02f7847fe2f..7a3f9987d4b09a80ebdc48c970c8eb118f3b4727 100644 (file)
@@ -304,7 +304,8 @@ void HandleMouseCursor()
        cursor_inside_playfield &&
        DelayReached(&special_cursor_delay, special_cursor_delay_value))
     {
-      if (level.game_engine_type != GAME_ENGINE_TYPE_MM)
+      if (level.game_engine_type != GAME_ENGINE_TYPE_MM ||
+         tile_cursor.enabled)
        SetMouseCursor(CURSOR_PLAYFIELD);
     }
   }
@@ -400,6 +401,7 @@ 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);
 
   ClearPlayerMouseAction();
 
@@ -412,10 +414,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()
@@ -2339,7 +2343,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);