added support to show level set name in game panel
authorHolger Schemel <holger.schemel@virtion.de>
Sat, 4 Jan 2025 16:16:34 +0000 (17:16 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Sat, 4 Jan 2025 16:16:34 +0000 (17:16 +0100)
src/conf_gfx.c
src/game.c
src/game.h

index cc9b0615e41fb8be0534af8279e2515c0f48ddcf..034873ae8da893026db6490a34a094df668f6cfc 100644 (file)
@@ -11017,6 +11017,17 @@ struct ConfigInfo image_config[] =
   { "game.panel.player_name.class",                    "none"                          },
   { "game.panel.player_name.style",                    "none"                          },
 
+  { "game.panel.levelset_name.x",                      "-1"                            },
+  { "game.panel.levelset_name.y",                      "-1"                            },
+  { "game.panel.levelset_name.align",                  "left"                          },
+  { "game.panel.levelset_name.valign",                 "top"                           },
+  { "game.panel.levelset_name.chars",                  "-1"                            },
+  { "game.panel.levelset_name.font",                   "font.text_2"                   },
+  { "game.panel.levelset_name.draw_masked",            "true"                          },
+  { "game.panel.levelset_name.draw_order",             "0"                             },
+  { "game.panel.levelset_name.class",                  "none"                          },
+  { "game.panel.levelset_name.style",                  "none"                          },
+
   { "game.panel.level_name.x",                         "-1"                            },
   { "game.panel.level_name.y",                         "-1"                            },
   { "game.panel.level_name.align",                     "left"                          },
@@ -11027,6 +11038,7 @@ struct ConfigInfo image_config[] =
   { "game.panel.level_name.draw_order",                        "0"                             },
   { "game.panel.level_name.class",                     "none"                          },
   { "game.panel.level_name.style",                     "none"                          },
+
   { "game.panel.level_author.x",                       "-1"                            },
   { "game.panel.level_author.y",                       "-1"                            },
   { "game.panel.level_author.align",                   "left"                          },
index 3a6662c3faa12b067591a900ef4aac29fba68d51..66935e7f948dec39f32617b7102bbbe721d26ece 100644 (file)
 #define GAME_PANEL_CE_SCORE_7_ELEMENT          115
 #define GAME_PANEL_CE_SCORE_8_ELEMENT          116
 #define GAME_PANEL_PLAYER_NAME                 117
-#define GAME_PANEL_LEVEL_NAME                  118
-#define GAME_PANEL_LEVEL_AUTHOR                        119
+#define GAME_PANEL_LEVELSET_NAME               118
+#define GAME_PANEL_LEVEL_NAME                  119
+#define GAME_PANEL_LEVEL_AUTHOR                        120
 
-#define NUM_GAME_PANEL_CONTROLS                        120
+#define NUM_GAME_PANEL_CONTROLS                        121
 
 struct GamePanelOrderInfo
 {
@@ -831,6 +832,11 @@ static struct GamePanelControlInfo game_panel_controls[] =
     &game.panel.player_name,
     TYPE_STRING,
   },
+  {
+    GAME_PANEL_LEVELSET_NAME,
+    &game.panel.levelset_name,
+    TYPE_STRING,
+  },
   {
     GAME_PANEL_LEVEL_NAME,
     &game.panel.level_name,
@@ -2642,6 +2648,7 @@ static void UpdateGameControlValues(void)
        EL_UNDEFINED);
 
   game_panel_controls[GAME_PANEL_PLAYER_NAME].value = 0;
+  game_panel_controls[GAME_PANEL_LEVELSET_NAME].value = 0;
   game_panel_controls[GAME_PANEL_LEVEL_NAME].value = 0;
   game_panel_controls[GAME_PANEL_LEVEL_AUTHOR].value = 0;
 
@@ -2955,6 +2962,7 @@ static void DisplayGameControlValues(void)
       char *state = (active ? state_active : state_normal);
       char *s = (nr == GAME_PANEL_GRAVITY_STATE ? state :
                 nr == GAME_PANEL_PLAYER_NAME   ? setup.player_name :
+                nr == GAME_PANEL_LEVELSET_NAME ? leveldir_current->name :
                 nr == GAME_PANEL_LEVEL_NAME    ? level.name :
                 nr == GAME_PANEL_LEVEL_AUTHOR  ? level.author : NULL);
 
index 430e37756ea6d8a06e0a206d18318cbc909dc2ec..41f7931c652a01db65853e524b9f75d8949826d7 100644 (file)
@@ -106,6 +106,7 @@ struct GamePanelInfo
   struct TextPosInfo ce_score[NUM_PANEL_CE_SCORE];
   struct TextPosInfo ce_score_element[NUM_PANEL_CE_SCORE];
   struct TextPosInfo player_name;
+  struct TextPosInfo levelset_name;
   struct TextPosInfo level_name;
   struct TextPosInfo level_author;