added missing configurability of 'list_size' for info elements
authorHolger Schemel <info@artsoft.org>
Fri, 29 May 2015 09:27:38 +0000 (11:27 +0200)
committerHolger Schemel <info@artsoft.org>
Fri, 29 May 2015 09:27:38 +0000 (11:27 +0200)
src/conf_gfx.c
src/files.c
src/main.h
src/screens.c

index 8c3bc2d8d0a951020fa9603cabd46d46294a0431..b63cb9408a4476714e2bdc342abba6edab2ffc5d 100644 (file)
@@ -6229,6 +6229,7 @@ struct ConfigInfo image_config[] =
   { "menu.list_size.LEVELNR",                  "-1"                    },
   { "menu.list_size.SCORES",                   "-1"                    },
   { "menu.list_size.INFO",                     "-1"                    },
+  { "menu.list_size.INFO[ELEMENTS]",           "-1"                    },
   { "menu.list_size.SETUP",                    "-1"                    },
 
   { "main.button.name.x",                      "0"                     },
index aa44fc262827a1db45233cd0dd5c2728a427b0f5..184fbb0f111cba96c7f65dd9d7133a1c7d894214 100644 (file)
@@ -8862,6 +8862,14 @@ static void LoadMenuDesignSettingsFromFilename(char *filename)
       menu.draw_xoffset_info[i] = get_integer_from_string(value_1);
     if (value_2 != NULL)
       menu.draw_yoffset_info[i] = get_integer_from_string(value_2);
+
+    if (i == GFX_SPECIAL_ARG_INFO_ELEMENTS)
+    {
+      char *value_1 = getHashEntry(setup_file_hash, "menu.list_size.INFO");
+
+      if (value_1 != NULL)
+       menu.list_size_info[i] = get_integer_from_string(value_1);
+    }
   }
 
   /* special case: initialize with default values that may be overwritten */
index a75329ffe7924b025e6fe24d46537288983072bf..c0dbcd794864e41c5cbbec3150061cc0db539893 100644 (file)
@@ -2166,6 +2166,7 @@ struct MenuInfo
   int scrollbar_xoffset;
 
   int list_size[NUM_SPECIAL_GFX_ARGS];
+  int list_size_info[NUM_SPECIAL_GFX_INFO_ARGS];
 
   struct TitleFadingInfo enter_menu;
   struct TitleFadingInfo leave_menu;
index c9c2ba4a29799f65f8be8025408f260e9e4ee051..869daaeddf8129255edc5f76a43831a6a1549bdc 100644 (file)
                                         MENU_SCREEN_INFO_YSTART2 -     \
                                         TILEY / 2)
 #define MAX_INFO_ELEMENTS_ON_SCREEN    128
-#define NUM_INFO_ELEMENTS_ON_SCREEN    MIN(MENU_SCREEN_INFO_YSIZE /    \
-                                            MENU_SCREEN_INFO_YSTEP,    \
-                                            MAX_INFO_ELEMENTS_ON_SCREEN)
+#define STD_INFO_ELEMENTS_ON_SCREEN    (MENU_SCREEN_INFO_YSIZE /       \
+                                        MENU_SCREEN_INFO_YSTEP)
+#define NUM_INFO_ELEMENTS_FROM_CONF    \
+  (menu.list_size_info[GFX_SPECIAL_ARG_INFO_ELEMENTS] > 0 ?            \
+   menu.list_size_info[GFX_SPECIAL_ARG_INFO_ELEMENTS] :                        \
+   MAX_MENU_ENTRIES_ON_SCREEN)
+#define NUM_INFO_ELEMENTS_ON_SCREEN    MIN(MIN(STD_INFO_ELEMENTS_ON_SCREEN, \
+                                                MAX_INFO_ELEMENTS_ON_SCREEN), \
+                                           NUM_INFO_ELEMENTS_FROM_CONF)
 #define MAX_MENU_ENTRIES_ON_SCREEN     (SCR_FIELDY - MENU_SCREEN_START_YPOS)
 #define MAX_MENU_TEXT_LENGTH_BIG       13
 #define MAX_MENU_TEXT_LENGTH_MEDIUM    (MAX_MENU_TEXT_LENGTH_BIG * 2)