added optional button to restart game (door, panel and touch variants)
[rocksndiamonds.git] / src / screens.c
index 47b37a34777ea812cc35ee3ff5bc94bf5aaaa31a..fc344373d34d7734a24d93d5bc79d49d828bba97 100644 (file)
 #define MENU_SCREEN_INFO_SPACE_BOTTOM  (menu.bottom_spacing_info[info_mode])
 #define MENU_SCREEN_INFO_SPACE_LINE    (menu.line_spacing_info[info_mode])
 #define MENU_SCREEN_INFO_SPACE_EXTRA   (menu.extra_spacing_info[info_mode])
-#define MENU_SCREEN_INFO_TILE_SIZE     (menu.tile_size_info[info_mode])
+#define MENU_SCREEN_INFO_TILE_SIZE_RAW (menu.tile_size_info[info_mode])
+#define MENU_SCREEN_INFO_TILE_SIZE     (MENU_SCREEN_INFO_TILE_SIZE_RAW > 0 ? \
+                                        MENU_SCREEN_INFO_TILE_SIZE_RAW : TILEY)
 #define MENU_SCREEN_INFO_ENTRY_SIZE_RAW        (menu.list_entry_size_info[info_mode])
 #define MENU_SCREEN_INFO_ENTRY_SIZE    (MAX(MENU_SCREEN_INFO_ENTRY_SIZE_RAW, \
                                             MENU_SCREEN_INFO_TILE_SIZE))
@@ -1790,6 +1792,9 @@ void DrawMainMenu(void)
   // store valid level series information
   leveldir_last_valid = leveldir_current;
 
+  // store first level of this level set for "level_nr" style animations
+  SetAnimationFirstLevel(leveldir_current->first_level);
+
   // needed if last screen (level choice) changed graphics, sounds or music
   ReloadCustomArtwork(0);
 
@@ -3593,6 +3598,51 @@ void HandleInfoScreen_Music(int dx, int dy, int button)
       ystart += ystep_head;
     }
 
+    if (!strEqual(list->played, UNKNOWN_NAME))
+    {
+      if (!strEqual(list->played_header, UNKNOWN_NAME))
+       DrawTextSCentered(ystart, font_head, list->played_header);
+      else
+       DrawTextSCentered(ystart, font_head, "played in");
+
+      ystart += ystep_head;
+
+      DrawTextFCentered(ystart, font_text, "%s", list->played);
+      ystart += ystep_head;
+    }
+    else if (!list->is_sound)
+    {
+      int music_level_nr = -1;
+      int i;
+
+      // check if this music is configured for a certain level
+      for (i = leveldir_current->first_level;
+          i <= leveldir_current->last_level; i++)
+      {
+       // (special case: "list->music" may be negative for unconfigured music)
+       if (levelset.music[i] != MUS_UNDEFINED &&
+           levelset.music[i] == list->music)
+       {
+         music_level_nr = i;
+
+         break;
+       }
+      }
+
+      if (music_level_nr != -1)
+      {
+       if (!strEqual(list->played_header, UNKNOWN_NAME))
+         DrawTextSCentered(ystart, font_head, list->played_header);
+       else
+         DrawTextSCentered(ystart, font_head, "played in");
+
+       ystart += ystep_head;
+
+       DrawTextFCentered(ystart, font_text, "level %03d", music_level_nr);
+       ystart += ystep_head;
+      }
+    }
+
     DrawTextSCentered(ybottom, font_foot, TEXT_NEXT_PAGE);
 
     if (button != MB_MENU_INITIALIZE)
@@ -7498,7 +7548,7 @@ static struct TokenInfo setup_info_graphics[] =
   { TYPE_SWITCH,       &setup.quick_switch,    "Quick Player Focus Switch:" },
   { TYPE_SWITCH,       &setup.quick_doors,     "Quick Menu Doors:"     },
   { TYPE_SWITCH,       &setup.show_titlescreen,"Show Title Screens:"   },
-  { TYPE_SWITCH,       &setup.toons,           "Show Menu Animations:" },
+  { TYPE_SWITCH,       &setup.toons,           "Show Toons:"           },
   { TYPE_SWITCH,       &setup.small_game_graphics, "Small Game Graphics:" },
   { TYPE_YES_NO_AUTO,  &setup.debug.xsn_mode,  debug_xsn_mode          },
   { TYPE_EMPTY,                NULL,                   ""                      },