added constant text value
[rocksndiamonds.git] / src / screens.c
index dbbdf0c9d6344e4795ab7032af987ccda8605871..3ad1096be0decb5fb111dbe7e467f48d19dc1da4 100644 (file)
 
 #define TEXT_NEXT_PAGE                 "Press any key or button for next page"
 #define TEXT_INFO_MENU                 "Press any key or button for info menu"
+#define TEXT_MAIN_MENU                 "Press any key or button for main menu"
 
 // for input setup functions
 #define SETUPINPUT_SCREEN_POS_START    0
@@ -318,6 +319,8 @@ static struct GadgetInfo *screen_gadget[NUM_SCREEN_GADGETS];
 static int info_mode = INFO_MODE_MAIN;
 static int setup_mode = SETUP_MODE_MAIN;
 
+static boolean info_screens_from_main = FALSE;
+
 static TreeInfo *window_sizes = NULL;
 static TreeInfo *window_size_current = NULL;
 
@@ -2537,6 +2540,18 @@ static void DrawInfoScreen_Main(void)
   int fade_mask = REDRAW_FIELD;
   int i;
 
+  // (needed after displaying info sub-screens directly from main menu)
+  if (info_screens_from_main)
+  {
+    info_screens_from_main = FALSE;
+
+    SetGameStatus(GAME_MODE_MAIN);
+
+    DrawMainMenu();
+
+    return;
+  }
+
   if (redraw_mask & REDRAW_ALL)
     fade_mask = REDRAW_ALL;
 
@@ -3846,6 +3861,23 @@ static void DrawInfoScreen(void)
     PlayMenuSoundsAndMusic();
 }
 
+void DrawInfoScreen_FromMainMenu(int nr)
+{
+  if (nr < INFO_MODE_MAIN || nr >= MAX_INFO_MODES)
+    return;
+
+  CloseDoor(DOOR_CLOSE_2);
+
+  SetGameStatus(GAME_MODE_INFO);
+
+  info_mode = nr;
+  info_screens_from_main = TRUE;
+
+  FadeSetEnterScreen();
+
+  DrawInfoScreen();
+}
+
 void HandleInfoScreen(int mx, int my, int dx, int dy, int button)
 {
   if (info_mode == INFO_MODE_TITLE)
@@ -4486,7 +4518,7 @@ static void drawChooseTreeScreen_Scores_NotAvailable(void)
   char *text_info = "HighScores of Level %d";
   char *text_title = "Score information:";
   char *text_error = "No scores for this level.";
-  char *text_foot = "Press any key or button for main menu";
+  char *text_foot = TEXT_MAIN_MENU;
   int font_info = FONT_TITLE_2;
   int font_title = FONT_INITIAL_3;
   int font_error = FONT_INITIAL_4;