added (optional) menu buttons to select level number and first/last level
authorHolger Schemel <info@artsoft.org>
Tue, 12 Jun 2018 00:10:22 +0000 (02:10 +0200)
committerHolger Schemel <info@artsoft.org>
Tue, 12 Jun 2018 00:10:22 +0000 (02:10 +0200)
src/conf_gfx.c
src/main.h
src/screens.c

index 2d3d99eb276ce711efb401fcd6ba59c709f290c0..ba530b3d903a8a9a08f1101b2a8855a3e87fc924 100644 (file)
@@ -6079,6 +6079,13 @@ struct ConfigInfo image_config[] =
   { "menu.button_quit.active",                 UNDEFINED_FILENAME      },
   { "menu.button_quit.active.clone_from",      "menu.button.active"    },
 
+  { "menu.button_first_level",                 UNDEFINED_FILENAME      },
+  { "menu.button_first_level.active",          UNDEFINED_FILENAME      },
+  { "menu.button_last_level",                  UNDEFINED_FILENAME      },
+  { "menu.button_last_level.active",           UNDEFINED_FILENAME      },
+  { "menu.button_level_number",                        UNDEFINED_FILENAME      },
+  { "menu.button_level_number.active",         UNDEFINED_FILENAME      },
+
   { "menu.scrollbar",                          "RocksDC.png"           },
   { "menu.scrollbar.xpos",                     "8"                     },
   { "menu.scrollbar.ypos",                     "10"                    },
@@ -7887,6 +7894,13 @@ struct ConfigInfo image_config[] =
   { "main.button.quit.x",                      "0"                     },
   { "main.button.quit.y",                      "288"                   },
 
+  { "main.button.first_level.x",               "-1"                    },
+  { "main.button.first_level.y",               "-1"                    },
+  { "main.button.last_level.x",                        "-1"                    },
+  { "main.button.last_level.y",                        "-1"                    },
+  { "main.button.level_number.x",              "-1"                    },
+  { "main.button.level_number.y",              "-1"                    },
+
   { "main.button.prev_level.x",                        "320"                   },
   { "main.button.prev_level.y",                        "96"                    },
   { "main.button.next_level.x",                        "448"                   },
index d688627d87903d2bc41555f757dea25c38ebfc37..224c3513cdeddfb96303230415a396f7a5f137a0 100644 (file)
@@ -2636,6 +2636,10 @@ struct MenuMainButtonInfo
 
   struct MenuPosInfo prev_level;
   struct MenuPosInfo next_level;
+
+  struct MenuPosInfo first_level;
+  struct MenuPosInfo last_level;
+  struct MenuPosInfo level_number;
 };
 
 struct MenuMainTextInfo
index 9562c08cf5c58f9ae14eeb993615fe2442f693d3..ad21972ceafc8d89c377d84bab1276dc86913785 100644 (file)
@@ -749,19 +749,19 @@ static struct MainControlInfo main_controls[] =
 #endif
   {
     MAIN_CONTROL_FIRST_LEVEL,
-    NULL,                              -1,
+    &menu.main.button.first_level,     IMG_MENU_BUTTON_FIRST_LEVEL,
     &menu.main.text.first_level,       &main_text_first_level,
     NULL,                              NULL,
   },
   {
     MAIN_CONTROL_LAST_LEVEL,
-    NULL,                              -1,
+    &menu.main.button.last_level,      IMG_MENU_BUTTON_LAST_LEVEL,
     &menu.main.text.last_level,                &main_text_last_level,
     NULL,                              NULL,
   },
   {
     MAIN_CONTROL_LEVEL_NUMBER,
-    NULL,                              -1,
+    &menu.main.button.level_number,    IMG_MENU_BUTTON_LEVEL_NUMBER,
     &menu.main.text.level_number,      &main_text_level_number,
     NULL,                              NULL,
   },
@@ -1148,8 +1148,8 @@ static void InitializeMainControls()
 
     if (pos_text != NULL)              /* (x/y may be -1/-1 here) */
     {
-      /* calculate size for non-clickable text -- needed for text alignment */
-      boolean calculate_text_size = (pos_button == NULL && text != NULL);
+      /* calculate text size -- needed for text alignment */
+      boolean calculate_text_size = (text != NULL);
 
       if (pos_text->width == -1 || calculate_text_size)
        pos_text->width = text_width;