added setup option to enable/disable auto-incrementing solved levels
authorHolger Schemel <info@artsoft.org>
Wed, 1 Feb 2017 20:24:52 +0000 (21:24 +0100)
committerHolger Schemel <info@artsoft.org>
Wed, 1 Feb 2017 20:24:52 +0000 (21:24 +0100)
src/files.c
src/game.c
src/libgame/system.h
src/screens.c

index 9a769335fd40cabd8dd10eedf4da418464aa1e5e..4cdb8199bae0f5ecf8cb21eba1a953a3dc0f3263 100644 (file)
@@ -7945,34 +7945,35 @@ void SaveScore(int nr)
 #define SETUP_TOKEN_TEAM_MODE                  14
 #define SETUP_TOKEN_HANDICAP                   15
 #define SETUP_TOKEN_SKIP_LEVELS                        16
-#define SETUP_TOKEN_TIME_LIMIT                 17
-#define SETUP_TOKEN_FULLSCREEN                 18
-#define SETUP_TOKEN_WINDOW_SCALING_PERCENT     19
-#define SETUP_TOKEN_WINDOW_SCALING_QUALITY     20
-#define SETUP_TOKEN_SCREEN_RENDERING_MODE      21
-#define SETUP_TOKEN_ASK_ON_ESCAPE              22
-#define SETUP_TOKEN_ASK_ON_ESCAPE_EDITOR       23
-#define SETUP_TOKEN_QUICK_SWITCH               24
-#define SETUP_TOKEN_INPUT_ON_FOCUS             25
-#define SETUP_TOKEN_PREFER_AGA_GRAPHICS                26
-#define SETUP_TOKEN_GAME_FRAME_DELAY           27
-#define SETUP_TOKEN_SP_SHOW_BORDER_ELEMENTS    28
-#define SETUP_TOKEN_SMALL_GAME_GRAPHICS                29
-#define SETUP_TOKEN_SHOW_SNAPSHOT_BUTTONS      30
-#define SETUP_TOKEN_GRAPHICS_SET               31
-#define SETUP_TOKEN_SOUNDS_SET                 32
-#define SETUP_TOKEN_MUSIC_SET                  33
-#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS    34
-#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS      35
-#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC       36
-#define SETUP_TOKEN_VOLUME_SIMPLE              37
-#define SETUP_TOKEN_VOLUME_LOOPS               38
-#define SETUP_TOKEN_VOLUME_MUSIC               39
-#define SETUP_TOKEN_TOUCH_CONTROL_TYPE         40
-#define SETUP_TOKEN_TOUCH_MOVE_DISTANCE                41
-#define SETUP_TOKEN_TOUCH_DROP_DISTANCE                42
-
-#define NUM_GLOBAL_SETUP_TOKENS                        43
+#define SETUP_TOKEN_INCREMENT_LEVELS           17
+#define SETUP_TOKEN_TIME_LIMIT                 18
+#define SETUP_TOKEN_FULLSCREEN                 19
+#define SETUP_TOKEN_WINDOW_SCALING_PERCENT     20
+#define SETUP_TOKEN_WINDOW_SCALING_QUALITY     21
+#define SETUP_TOKEN_SCREEN_RENDERING_MODE      22
+#define SETUP_TOKEN_ASK_ON_ESCAPE              23
+#define SETUP_TOKEN_ASK_ON_ESCAPE_EDITOR       24
+#define SETUP_TOKEN_QUICK_SWITCH               25
+#define SETUP_TOKEN_INPUT_ON_FOCUS             26
+#define SETUP_TOKEN_PREFER_AGA_GRAPHICS                27
+#define SETUP_TOKEN_GAME_FRAME_DELAY           28
+#define SETUP_TOKEN_SP_SHOW_BORDER_ELEMENTS    29
+#define SETUP_TOKEN_SMALL_GAME_GRAPHICS                30
+#define SETUP_TOKEN_SHOW_SNAPSHOT_BUTTONS      31
+#define SETUP_TOKEN_GRAPHICS_SET               32
+#define SETUP_TOKEN_SOUNDS_SET                 33
+#define SETUP_TOKEN_MUSIC_SET                  34
+#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS    35
+#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS      36
+#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC       37
+#define SETUP_TOKEN_VOLUME_SIMPLE              38
+#define SETUP_TOKEN_VOLUME_LOOPS               39
+#define SETUP_TOKEN_VOLUME_MUSIC               40
+#define SETUP_TOKEN_TOUCH_CONTROL_TYPE         41
+#define SETUP_TOKEN_TOUCH_MOVE_DISTANCE                42
+#define SETUP_TOKEN_TOUCH_DROP_DISTANCE                43
+
+#define NUM_GLOBAL_SETUP_TOKENS                        44
 
 /* editor setup */
 #define SETUP_TOKEN_EDITOR_EL_CLASSIC          0
@@ -8137,6 +8138,7 @@ static struct TokenInfo global_setup_tokens[] =
   { TYPE_SWITCH, &si.team_mode,               "team_mode"              },
   { TYPE_SWITCH, &si.handicap,                "handicap"               },
   { TYPE_SWITCH, &si.skip_levels,             "skip_levels"            },
+  { TYPE_SWITCH, &si.increment_levels,        "increment_levels"       },
   { TYPE_SWITCH, &si.time_limit,              "time_limit"             },
   { TYPE_SWITCH, &si.fullscreen,              "fullscreen"             },
   { TYPE_INTEGER,&si.window_scaling_percent,  "window_scaling_percent" },
@@ -8335,6 +8337,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
   si->team_mode = FALSE;
   si->handicap = TRUE;
   si->skip_levels = TRUE;
+  si->increment_levels = TRUE;
   si->time_limit = TRUE;
   si->fullscreen = FALSE;
   si->window_scaling_percent = STD_WINDOW_SCALING_PERCENT;
index b543e6d2e14132d345e14aca528e069efdc98e54..8d2ed466dc3be327c5fc1a22de7dfcbff5b8bc59 100644 (file)
@@ -4461,7 +4461,8 @@ void GameEnd()
     SaveLevelSetup_SeriesInfo();
   }
 
-  if (level_nr < leveldir_current->last_level)
+  if (setup.increment_levels &&
+      level_nr < leveldir_current->last_level)
     raise_level = TRUE;                        /* advance to next level */
 
   if ((hi_pos = NewHiScore()) >= 0) 
index dd007f7f283450c8c433afbe3e2dc8f3df3f8bca..6816b0cacf4128e4ca725156bb4260e908e4df80 100644 (file)
@@ -1092,6 +1092,7 @@ struct SetupInfo
   boolean team_mode;
   boolean handicap;
   boolean skip_levels;
+  boolean increment_levels;
   boolean time_limit;
   boolean fullscreen;
   int window_scaling_percent;
index c1f16489bb517140b3a8a9ea554370ef76d5ed9c..0f47d876b7471443eaee95800dc63ba9dbe1ed12 100644 (file)
@@ -5326,9 +5326,10 @@ static struct TokenInfo setup_info_game[] =
 {
   { TYPE_SWITCH,       &setup.team_mode,       "Team-Mode (Multi-Player):" },
   { TYPE_YES_NO,       &setup.input_on_focus,  "Only Move Focussed Player:" },
+  { TYPE_SWITCH,       &setup.time_limit,      "Time Limit:"           },
   { TYPE_SWITCH,       &setup.handicap,        "Handicap:"             },
   { TYPE_SWITCH,       &setup.skip_levels,     "Skip Unsolved Levels:" },
-  { TYPE_SWITCH,       &setup.time_limit,      "Time Limit:"           },
+  { TYPE_SWITCH,       &setup.increment_levels,"Increment Solved Levels:" },
   { TYPE_SWITCH,       &setup.autorecord,      "Auto-Record Tapes:"    },
   { TYPE_ENTER_LIST,   execSetupChooseGameSpeed, "Game Speed:"         },
   { TYPE_STRING,       &game_speed_text,       ""                      },