added support for showing multiple lives for BD games in game panel
authorHolger Schemel <holger.schemel@virtion.de>
Sat, 4 Jan 2025 16:48:06 +0000 (17:48 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Sat, 4 Jan 2025 16:48:10 +0000 (17:48 +0100)
src/game.c

index d924477a7a58ee8dcb518140531731587aa707cc..c4af3361f2b071d8f91ce0e93cf61ccfe35db1f9 100644 (file)
@@ -2986,6 +2986,16 @@ static void DisplayGameControlValues(void)
                nr == GAME_PANEL_LEVEL_NAME ||
                nr == GAME_PANEL_LEVEL_AUTHOR)
       {
+        if (nr == GAME_PANEL_LEVEL_NAME &&
+            level.game_engine_type == GAME_ENGINE_TYPE_BD && setup.bd_multiple_lives)
+        {
+          static char *level_name_and_lives = NULL;
+
+          setStringPrint(&level_name_and_lives, "%s (%d)", s, game_bd.global_lives);
+
+          s = level_name_and_lives;
+        }
+
         // use alternative (narrow) font if text larger than specified size or game panel width
         if ((size > 0 && strlen(s) > size) || strlen(s) * getFontWidth(font) > DXSIZE)
           font = pos->font_alt;