added setup option to start game in pause mode
[rocksndiamonds.git] / src / game.c
index 43a0b8c2eeb12fb2086795b6f2903a68a81e9ebc..1c493508a290286f096830ed58ae3de7ec219057 100644 (file)
@@ -2681,15 +2681,25 @@ static void DisplayGameControlValues(void)
     if (type == TYPE_INTEGER)
     {
       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;
 
@@ -5094,7 +5104,14 @@ static int addScoreEntry(struct ScoreInfo *list, struct ScoreEntry *new_entry,
     // (special case: historic score entries have an empty tape basename entry)
     if (strEqual(new_entry->tape_basename, entry->tape_basename) &&
        !strEqual(new_entry->tape_basename, UNDEFINED_FILENAME))
+    {
+      // special case: use server score instead of local score value if higher
+      // (historic scores might have been truncated to 16-bit values locally)
+      if (score_is_better)
+       entry->score = new_entry->score;
+
       return -1;
+    }
 
     if (is_better || entry_is_empty)
     {
@@ -11754,6 +11771,9 @@ void StartGameActions(boolean init_network_game, boolean record_tape,
   if (record_tape)
     TapeStartRecording(new_random_seed);
 
+  if (setup.auto_pause_on_start && !tape.pausing)
+    TapeTogglePause(TAPE_TOGGLE_MANUAL);
+
   if (init_network_game)
   {
     SendToServer_LevelFile();