added using setup option for displaying overlay touch buttons
[rocksndiamonds.git] / src / game.c
index ca2fa98e521542e1b723fc73479e592c76a6744b..abf350ce93311d668bc344cc1301affb90fa0a1e 100644 (file)
@@ -5050,6 +5050,9 @@ void GameEnd(void)
 
     if (setup.auto_play_next_level)
     {
+      scores.continue_playing = TRUE;
+      scores.next_level_nr = level_nr;
+
       LoadLevel(level_nr);
 
       SaveLevelSetup_SeriesInfo();
@@ -5062,9 +5065,7 @@ void GameEnd(void)
 
     DrawHallOfFame(last_level_nr);
   }
-  else if (setup.auto_play_next_level && setup.increment_levels &&
-          last_level_nr < leveldir_current->last_level &&
-          !network_playing)
+  else if (scores.continue_playing)
   {
     StartGameActions(network.enabled, setup.autorecord, level.random_seed);
   }
@@ -15691,6 +15692,7 @@ void RequestQuitGameExt(boolean skip_request, boolean quick_quit, char *message)
     {
       // prevent short reactivation of overlay buttons while closing door
       SetOverlayActive(FALSE);
+      UnmapGameButtons();
 
       // door may still be open due to skipped or envelope style request
       CloseDoor(score_info_tape_play ? DOOR_CLOSE_ALL : DOOR_CLOSE_1);
@@ -16298,6 +16300,10 @@ void CreateGameButtons(void)
     int y = (is_touch_button ? pos->y : GDI_ACTIVE_POS(pos->y));
     int id = i;
 
+    // do not use touch buttons if overlay touch buttons are disabled
+    if (is_touch_button && !setup.touch.overlay_buttons)
+      continue;
+
     if (gfx->bitmap == NULL)
     {
       game_gadget[id] = NULL;