fixed default graphics for growing or exploding BD engine elements
[rocksndiamonds.git] / src / screens.c
index 1c4e14a15d9ea32d5c2fae14a7d18836efc59544..2f53800c361200168aa221401a9564bd047d17e8 100644 (file)
@@ -1929,7 +1929,7 @@ void DrawMainMenu(void)
   SetAnimationFirstLevel(leveldir_current->first_level);
 
   // level_nr may have been set to value over handicap with level editor
-  if (setup.handicap && level_nr > leveldir_current->handicap_level)
+  if (setup.allow_skipping_levels != STATE_TRUE && level_nr > leveldir_current->handicap_level)
     level_nr = leveldir_current->handicap_level;
 
   LoadLevel(level_nr);
@@ -2286,13 +2286,14 @@ static void HandleMainMenu_SelectLevel(int step, int direction,
   if (new_level_nr > leveldir_current->last_level)
     new_level_nr = leveldir_current->last_level;
 
-  if (setup.handicap && new_level_nr > leveldir_current->handicap_level)
+  if (setup.allow_skipping_levels != STATE_TRUE && new_level_nr > leveldir_current->handicap_level)
   {
     // skipping levels is only allowed when trying to skip single level
     // (also, skipping BD style intermission levels is always possible)
     if (new_level_nr == old_level_nr + 1 &&
        (level.bd_intermission ||
-        (setup.skip_levels && Request("Level still unsolved! Skip it anyway?", REQ_ASK))))
+        (setup.allow_skipping_levels == STATE_ASK &&
+         Request("Level still unsolved! Skip it anyway?", REQ_ASK))))
     {
       leveldir_current->handicap_level++;
       SaveLevelSetup_SeriesInfo();
@@ -2633,6 +2634,7 @@ static int getMenuTextFont(int type)
   if (type & (TYPE_SWITCH      |
              TYPE_YES_NO       |
              TYPE_YES_NO_AUTO  |
+             TYPE_YES_NO_ASK   |
              TYPE_STRING       |
              TYPE_PLAYER       |
              TYPE_ECS_AGA      |
@@ -3079,6 +3081,7 @@ static void HandleMenuScreen(int mx, int my, int dx, int dy, int button,
       if (menu_info[choice].type & menu_navigation_type ||
          menu_info[choice].type & TYPE_BOOLEAN_STYLE ||
          menu_info[choice].type & TYPE_YES_NO_AUTO ||
+         menu_info[choice].type & TYPE_YES_NO_ASK ||
          menu_info[choice].type & TYPE_PLAYER)
        button = MB_MENU_CHOICE;
     }
@@ -5717,7 +5720,7 @@ static void HandleHallOfFame_SelectLevel(int step, int direction)
   if (new_level_nr > leveldir_current->last_level)
     new_level_nr = leveldir_current->last_level;
 
-  if (setup.handicap && new_level_nr > leveldir_current->handicap_level)
+  if (setup.allow_skipping_levels != STATE_TRUE && new_level_nr > leveldir_current->handicap_level)
     new_level_nr = leveldir_current->handicap_level;
 
   if (new_level_nr != old_level_nr)
@@ -7943,8 +7946,12 @@ static struct TokenInfo setup_info_game[] =
   { TYPE_SWITCH,       &setup.multiple_users,          "Multiple Users/Teams:"         },
   { TYPE_YES_NO,       &setup.input_on_focus,          "Only Move Focussed Player:"    },
   { TYPE_SWITCH,       &setup.time_limit,              "Time Limit:"                   },
+#if 1
+  { TYPE_YES_NO_ASK,   &setup.allow_skipping_levels,   "Allow Skipping Levels:"        },
+#else
   { TYPE_SWITCH,       &setup.handicap,                "Force Solving Levels:"         },
   { TYPE_SWITCH,       &setup.skip_levels,             "Allow Skipping Levels:"        },
+#endif
   { TYPE_SWITCH,       &setup.increment_levels,        "Increment Solved Levels:"      },
   { TYPE_SWITCH,       &setup.auto_play_next_level,    "Auto-play Next Level:"         },
   { TYPE_SWITCH,       &setup.count_score_after_game,  "Count Score After Game:"       },
@@ -8379,8 +8386,11 @@ static int getSetupValueFont(int type, void *value)
   else if (type & TYPE_BOOLEAN_STYLE)
     return (*(boolean *)value ? FONT_OPTION_ON : FONT_OPTION_OFF);
   else if (type & TYPE_YES_NO_AUTO)
-    return (*(int *)value == MODE_AUTO  ? FONT_OPTION_ON :
-           *(int *)value == FALSE ? FONT_OPTION_OFF : FONT_OPTION_ON);
+    return (*(int *)value == STATE_AUTO  ? FONT_OPTION_ON :
+           *(int *)value == STATE_FALSE ? FONT_OPTION_OFF : FONT_OPTION_ON);
+  else if (type & TYPE_YES_NO_ASK)
+    return (*(int *)value == STATE_ASK   ? FONT_OPTION_ON :
+           *(int *)value == STATE_FALSE ? FONT_OPTION_OFF : FONT_OPTION_ON);
   else if (type & TYPE_PLAYER)
     return FONT_VALUE_1;
   else
@@ -8524,10 +8534,19 @@ static void changeSetupValue(int screen_pos, int setup_info_pos_raw, int dx)
   {
     *(int *)si->value =
       (dx == -1 ?
-       (*(int *)si->value == MODE_AUTO ? TRUE :
-       *(int *)si->value == TRUE ? FALSE : MODE_AUTO) :
-       (*(int *)si->value == TRUE ? MODE_AUTO :
-       *(int *)si->value == MODE_AUTO ? FALSE : TRUE));
+       (*(int *)si->value == STATE_AUTO ? STATE_TRUE :
+       *(int *)si->value == STATE_TRUE ? STATE_FALSE : STATE_AUTO) :
+       (*(int *)si->value == STATE_TRUE ? STATE_AUTO :
+       *(int *)si->value == STATE_AUTO ? STATE_FALSE : STATE_TRUE));
+  }
+  else if (si->type & TYPE_YES_NO_ASK)
+  {
+    *(int *)si->value =
+      (dx == -1 ?
+       (*(int *)si->value == STATE_ASK  ? STATE_TRUE :
+       *(int *)si->value == STATE_TRUE ? STATE_FALSE : STATE_ASK) :
+       (*(int *)si->value == STATE_TRUE ? STATE_ASK :
+       *(int *)si->value == STATE_ASK  ? STATE_FALSE : STATE_TRUE));
   }
   else if (si->type & TYPE_KEY)
   {