added new option "create_user_levelset" (setup file only)
authorHolger Schemel <info@artsoft.org>
Sat, 25 May 2019 11:42:42 +0000 (13:42 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 25 May 2019 11:42:42 +0000 (13:42 +0200)
Setting this option to "false" (in a global program setup file)
prevents the creation of a new, empty user level set at the first
start of the program.

This option was specifically created for the R'n'D special edition
"R'n'D jue II", which comes with pre-defined user level sets.

src/files.c
src/libgame/setup.c
src/libgame/system.h

index 16b2179131918569244e3aa315cc4dfb7b3bbcac..27aa3abebb574f85e55422e97104b127b6896c87 100644 (file)
@@ -8951,6 +8951,10 @@ static struct TokenInfo internal_setup_tokens[] =
     TYPE_BOOLEAN,
     &setup.internal.show_scaling_in_title,     "show_scaling_in_title"
   },
+  {
+    TYPE_BOOLEAN,
+    &setup.internal.create_user_levelset,      "create_user_levelset"
+  },
   {
     TYPE_BOOLEAN,
     &setup.internal.menu_game,                 "menu_game"
@@ -9324,6 +9328,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
   si->internal.default_level_series = getStringCopy(UNDEFINED_LEVELSET);
   si->internal.choose_from_top_leveldir = FALSE;
   si->internal.show_scaling_in_title = TRUE;
+  si->internal.create_user_levelset = TRUE;
 
   si->internal.default_window_width  = WIN_XSIZE_DEFAULT;
   si->internal.default_window_height = WIN_YSIZE_DEFAULT;
index 5cdaa87471a3c55f3b4dd5a5b18e94494fd5b27d..7f080d9c6c0f92fbdb4f2c2a860c7975f6a3ba54 100644 (file)
@@ -1093,7 +1093,8 @@ void InitUserLevelDirectory(char *level_subdir)
     createDirectory(getUserLevelDir(NULL), "main user level", PERMS_PRIVATE);
     createDirectory(getUserLevelDir(level_subdir), "user level", PERMS_PRIVATE);
 
-    SaveUserLevelInfo();
+    if (setup.internal.create_user_levelset)
+      SaveUserLevelInfo();
   }
 }
 
index d07e0e1ddab91f3f8ee30b8d12dcebf171574890..185fdc5a1376c289d6eb3a2e4efe57fe05d1bd44 100644 (file)
@@ -1326,6 +1326,7 @@ struct SetupInternalInfo
 
   boolean choose_from_top_leveldir;
   boolean show_scaling_in_title;
+  boolean create_user_levelset;
 
   boolean menu_game;
   boolean menu_editor;