added support for more than five digits for score on game panel
authorHolger Schemel <info@artsoft.org>
Sun, 6 Feb 2022 23:07:11 +0000 (00:07 +0100)
committerHolger Schemel <info@artsoft.org>
Sun, 6 Feb 2022 23:07:11 +0000 (00:07 +0100)
src/conf_gfx.c
src/game.c

index c321bcf0eb00e4a5bba9510790a0fdf645bfdb76..d5bb9a554c33db4a1554837db972908d219b2cd0 100644 (file)
@@ -8749,8 +8749,9 @@ struct ConfigInfo image_config[] =
   { "game.panel.score.y",                      "159"                   },
   { "game.panel.score.align",                  "center"                },
   { "game.panel.score.valign",                 "top"                   },
-  { "game.panel.score.digits",                 "5"                     },
+  { "game.panel.score.digits",                 "-1"                    },
   { "game.panel.score.font",                   "font.text_2"           },
+  { "game.panel.score.font_narrow",            "font.text_1"           },
   { "game.panel.score.draw_masked",            "true"                  },
   { "game.panel.score.draw_order",             "0"                     },
   { "game.panel.score.class",                  "none"                  },
@@ -8760,8 +8761,9 @@ struct ConfigInfo image_config[] =
   { "game.panel.highscore.y",                  "-1"                    },
   { "game.panel.highscore.align",              "left"                  },
   { "game.panel.highscore.valign",             "top"                   },
-  { "game.panel.highscore.digits",             "5"                     },
+  { "game.panel.highscore.digits",             "-1"                    },
   { "game.panel.highscore.font",               "font.text_2"           },
+  { "game.panel.highscore.font_narrow",                "font.text_1"           },
   { "game.panel.highscore.draw_masked",                "true"                  },
   { "game.panel.highscore.draw_order",         "0"                     },
   { "game.panel.highscore.class",              "none"                  },
index 8422878aeff98cd52891afaa1411fa5300fabf9f..b2bb58f8f71618fd5901916f31a2df10fad3f316 100644 (file)
@@ -2682,15 +2682,24 @@ static void DisplayGameControlValues(void)
     {
       if (nr == GAME_PANEL_LEVEL_NUMBER ||
          nr == GAME_PANEL_INVENTORY_COUNT ||
+         nr == GAME_PANEL_SCORE ||
+         nr == GAME_PANEL_HIGHSCORE ||
          nr == GAME_PANEL_TIME)
       {
        boolean use_dynamic_size = (size == -1 ? TRUE : FALSE);
 
        if (use_dynamic_size)           // use dynamic number of digits
        {
-         int value_change = (nr == GAME_PANEL_LEVEL_NUMBER ? 100 : 1000);
-         int size1 = (nr == GAME_PANEL_LEVEL_NUMBER ? 2 : 3);
-         int size2 = size1 + 1;
+         int value_change = (nr == GAME_PANEL_LEVEL_NUMBER ? 100 :
+                             nr == GAME_PANEL_INVENTORY_COUNT ||
+                             nr == GAME_PANEL_TIME ? 1000 : 100000);
+         int size_add = (nr == GAME_PANEL_LEVEL_NUMBER ||
+                         nr == GAME_PANEL_INVENTORY_COUNT ||
+                         nr == GAME_PANEL_TIME ? 1 : 2);
+         int size1 = (nr == GAME_PANEL_LEVEL_NUMBER ? 2 :
+                      nr == GAME_PANEL_INVENTORY_COUNT ||
+                      nr == GAME_PANEL_TIME ? 3 : 5);
+         int size2 = size1 + size_add;
          int font1 = pos->font;
          int font2 = pos->font_alt;