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 16b2179..27aa3ab 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 5cdaa87..7f080d9 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 d07e0e1..185fdc5 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;