added special mode to continue from hall of fame when pressing "space" key
[rocksndiamonds.git] / src / events.c
index 9b4d733cec07eef20603a36c6cf5d4c089b80d6b..7a6ff377fd91440277c9db4986ad1e591c3dd430 100644 (file)
@@ -1718,9 +1718,11 @@ void HandleButton(int mx, int my, int button, int button_nr)
   // when playing, only handle gadgets when using "follow finger" controls
   // or when using touch controls in combination with the MM game engine
   // or when using gadgets that do not overlap with virtual buttons
+  // or when touch controls are disabled (e.g., with mouse-only levels)
   handle_gadgets =
     (game_status != GAME_MODE_PLAYING ||
      level.game_engine_type == GAME_ENGINE_TYPE_MM ||
+     strEqual(setup.touch.control_type, TOUCH_CONTROL_OFF) ||
      strEqual(setup.touch.control_type, TOUCH_CONTROL_FOLLOW_FINGER) ||
      (strEqual(setup.touch.control_type, TOUCH_CONTROL_VIRTUAL_BUTTONS) &&
       !CheckVirtualButtonPressed(mx, my, button)));
@@ -2299,6 +2301,11 @@ void HandleKey(Key key, int key_status)
     HandleSoundButtonKeys(key);
   }
 
+  if (game_status == GAME_MODE_SCOREINFO)
+  {
+    HandleScreenGadgetKeys(key);
+  }
+
   if (game_status == GAME_MODE_PLAYING && !network_playing)
   {
     int centered_player_nr_next = -999;
@@ -2328,6 +2335,14 @@ void HandleKey(Key key, int key_status)
   if (HandleGadgetsKeyInput(key))
     return;            // do not handle already processed keys again
 
+  // special case: on "space" key, either continue playing or go to main menu
+  if (game_status == GAME_MODE_SCORES && key == KSYM_space)
+  {
+    HandleHallOfFame(0, 0, 0, 0, MB_MENU_CONTINUE);
+
+    return;
+  }
+
   switch (game_status)
   {
     case GAME_MODE_PSEUDO_TYPENAME: