rnd-20031118-1-src
authorHolger Schemel <info@artsoft.org>
Tue, 18 Nov 2003 21:38:53 +0000 (22:38 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:44:37 +0000 (10:44 +0200)
src/conftime.h
src/editor.c
src/files.c
src/files.h
src/libgame/setup.c
src/libgame/setup.h
src/libgame/system.h
src/screens.c

index b65f6583b6f2251b0f1cecb6eed74a3890b090c9..fb7ddff0a510af1a512ca29704e0c1d06cce4770 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2003-11-16 22:37]"
+#define COMPILE_DATE_STRING "[2003-11-18 22:35]"
index 5c3298f84201a9e98daeaa1190e17a2500812152..20994b8d0f9403a3d9424c3b0ab20d16ede3748d 100644 (file)
@@ -1922,6 +1922,8 @@ static int editor_el_boulderdash[] =
   EL_BD_FIREFLY_DOWN,
   EL_EMPTY,
 };
+static int *editor_hl_boulderdash_ptr = editor_hl_boulderdash;
+static int *editor_el_boulderdash_ptr = editor_el_boulderdash;
 static int num_editor_hl_boulderdash = SIZEOF_ARRAY_INT(editor_hl_boulderdash);
 static int num_editor_el_boulderdash = SIZEOF_ARRAY_INT(editor_el_boulderdash);
 
@@ -2027,6 +2029,8 @@ static int editor_el_emerald_mine[] =
   EL_EM_GATE_3_GRAY,
   EL_EM_GATE_4_GRAY,
 };
+static int *editor_hl_emerald_mine_ptr = editor_hl_emerald_mine;
+static int *editor_el_emerald_mine_ptr = editor_el_emerald_mine;
 static int num_editor_hl_emerald_mine=SIZEOF_ARRAY_INT(editor_hl_emerald_mine);
 static int num_editor_el_emerald_mine=SIZEOF_ARRAY_INT(editor_el_emerald_mine);
 
@@ -2135,6 +2139,8 @@ static int editor_el_more[] =
   EL_EMC_WALL_6,
   EL_EMC_WALL_7,
 };
+static int *editor_hl_more_ptr = editor_hl_more;
+static int *editor_el_more_ptr = editor_el_more;
 static int num_editor_hl_more = SIZEOF_ARRAY_INT(editor_hl_more);
 static int num_editor_el_more = SIZEOF_ARRAY_INT(editor_el_more);
 
@@ -2158,6 +2164,8 @@ static int editor_el_sokoban[] =
   EL_SOKOBAN_FIELD_FULL,
   EL_STEELWALL,
 };
+static int *editor_hl_sokoban_ptr = editor_hl_sokoban;
+static int *editor_el_sokoban_ptr = editor_el_sokoban;
 static int num_editor_hl_sokoban = SIZEOF_ARRAY_INT(editor_hl_sokoban);
 static int num_editor_el_sokoban = SIZEOF_ARRAY_INT(editor_el_sokoban);
 
@@ -2230,6 +2238,8 @@ static int editor_el_supaplex[] =
   EL_SP_CHIP_TOP,
   EL_SP_CHIP_BOTTOM,
 };
+static int *editor_hl_supaplex_ptr = editor_hl_supaplex;
+static int *editor_el_supaplex_ptr = editor_el_supaplex;
 static int num_editor_hl_supaplex = SIZEOF_ARRAY_INT(editor_hl_supaplex);
 static int num_editor_el_supaplex = SIZEOF_ARRAY_INT(editor_el_supaplex);
 
@@ -2323,6 +2333,8 @@ static int editor_el_diamond_caves[] =
   EL_EXTRA_TIME,
   EL_EMPTY,
 };
+static int *editor_hl_diamond_caves_ptr = editor_hl_diamond_caves;
+static int *editor_el_diamond_caves_ptr = editor_el_diamond_caves;
 static int num_editor_hl_diamond_caves = SIZEOF_ARRAY_INT(editor_hl_diamond_caves);
 static int num_editor_el_diamond_caves = SIZEOF_ARRAY_INT(editor_el_diamond_caves);
 
@@ -2371,6 +2383,8 @@ static int editor_el_dx_boulderdash[] =
   EL_EMPTY,
   EL_EMPTY
 };
+static int *editor_hl_dx_boulderdash_ptr = editor_hl_dx_boulderdash;
+static int *editor_el_dx_boulderdash_ptr = editor_el_dx_boulderdash;
 static int num_editor_hl_dx_boulderdash = SIZEOF_ARRAY_INT(editor_hl_dx_boulderdash);
 static int num_editor_el_dx_boulderdash = SIZEOF_ARRAY_INT(editor_el_dx_boulderdash);
 
@@ -2474,6 +2488,8 @@ static int editor_el_chars[] =
   EL_CHAR(FONT_ASCII_CURSOR),
   EL_CHAR(' ')
 };
+static int *editor_hl_chars_ptr = editor_hl_chars;
+static int *editor_el_chars_ptr = editor_el_chars;
 static int num_editor_hl_chars = SIZEOF_ARRAY_INT(editor_hl_chars);
 static int num_editor_el_chars = SIZEOF_ARRAY_INT(editor_el_chars);
 
@@ -2662,6 +2678,8 @@ static int editor_el_custom[] =
   EL_CUSTOM_START + 126,
   EL_CUSTOM_START + 127
 };
+static int *editor_hl_custom_ptr = editor_hl_custom;
+static int *editor_el_custom_ptr = editor_el_custom;
 static int num_editor_hl_custom = SIZEOF_ARRAY_INT(editor_hl_custom);
 static int num_editor_el_custom = SIZEOF_ARRAY_INT(editor_el_custom);
 
@@ -2831,9 +2849,44 @@ static int editor_el_custom_more[] =
   EL_CUSTOM_START + 254,
   EL_CUSTOM_START + 255
 };
+static int *editor_hl_custom_more_ptr = editor_hl_custom_more;
+static int *editor_el_custom_more_ptr = editor_el_custom_more;
 static int num_editor_hl_custom_more = SIZEOF_ARRAY_INT(editor_hl_custom_more);
 static int num_editor_el_custom_more = SIZEOF_ARRAY_INT(editor_el_custom_more);
 
+static int editor_hl_user_defined[] =
+{
+  EL_CHAR('U'),
+  EL_CHAR('S'),
+  EL_CHAR('E'),
+  EL_CHAR('R'),
+
+  EL_CHAR('D'),
+  EL_CHAR('E'),
+  EL_CHAR('F'),
+  EL_CHAR('I'),
+
+  EL_CHAR('-'),
+  EL_CHAR('N'),
+  EL_CHAR('E'),
+  EL_CHAR('D'),
+};
+
+static int *editor_hl_user_defined_ptr = editor_hl_user_defined;
+static int *editor_el_user_defined_ptr = NULL;
+static int num_editor_hl_user_defined=SIZEOF_ARRAY_INT(editor_hl_user_defined);
+static int num_editor_el_user_defined = 0;
+
+static int editor_hl_empty[] = { };
+static int editor_el_empty[ED_NUM_ELEMENTLIST_BUTTONS];
+
+static int *editor_hl_empty_ptr = editor_hl_empty;
+static int *editor_el_empty_ptr = editor_el_empty;
+static int num_editor_hl_empty = 0;
+static int num_editor_el_empty = 0;    /* dynamically determined, if needed */
+
+static boolean use_el_empty = FALSE;
+
 static int *editor_elements = NULL;    /* dynamically allocated */
 static int num_editor_elements = 0;    /* dynamically determined */
 
@@ -2841,10 +2894,10 @@ static struct
 {
   boolean *setup_value;
 
-  int *headline_list;
+  int **headline_list;
   int *headline_list_size;
 
-  int *element_list;
+  int **element_list;
   int *element_list_size;
 
   boolean last_setup_value;
@@ -2853,53 +2906,63 @@ editor_elements_info[] =
 {
   {
     &setup.editor.el_boulderdash,
-    editor_hl_boulderdash,             &num_editor_hl_boulderdash,
-    editor_el_boulderdash,             &num_editor_el_boulderdash
+    &editor_hl_boulderdash_ptr,                &num_editor_hl_boulderdash,
+    &editor_el_boulderdash_ptr,                &num_editor_el_boulderdash
   },
   {
     &setup.editor.el_emerald_mine,
-    editor_hl_emerald_mine,            &num_editor_hl_emerald_mine,
-    editor_el_emerald_mine,            &num_editor_el_emerald_mine
+    &editor_hl_emerald_mine_ptr,       &num_editor_hl_emerald_mine,
+    &editor_el_emerald_mine_ptr,       &num_editor_el_emerald_mine
   },
   {
     &setup.editor.el_more,
-    editor_hl_more,                    &num_editor_hl_more,
-    editor_el_more,                    &num_editor_el_more
+    &editor_hl_more_ptr,               &num_editor_hl_more,
+    &editor_el_more_ptr,               &num_editor_el_more
   },
   {
     &setup.editor.el_sokoban,
-    editor_hl_sokoban,                 &num_editor_hl_sokoban,
-    editor_el_sokoban,                 &num_editor_el_sokoban
+    &editor_hl_sokoban_ptr,            &num_editor_hl_sokoban,
+    &editor_el_sokoban_ptr,            &num_editor_el_sokoban
   },
   {
     &setup.editor.el_supaplex,
-    editor_hl_supaplex,                        &num_editor_hl_supaplex,
-    editor_el_supaplex,                        &num_editor_el_supaplex
+    &editor_hl_supaplex_ptr,           &num_editor_hl_supaplex,
+    &editor_el_supaplex_ptr,           &num_editor_el_supaplex
   },
   {
     &setup.editor.el_diamond_caves,
-    editor_hl_diamond_caves,           &num_editor_hl_diamond_caves,
-    editor_el_diamond_caves,           &num_editor_el_diamond_caves
+    &editor_hl_diamond_caves_ptr,      &num_editor_hl_diamond_caves,
+    &editor_el_diamond_caves_ptr,      &num_editor_el_diamond_caves
   },
   {
     &setup.editor.el_dx_boulderdash,
-    editor_hl_dx_boulderdash,          &num_editor_hl_dx_boulderdash,
-    editor_el_dx_boulderdash,          &num_editor_el_dx_boulderdash
+    &editor_hl_dx_boulderdash_ptr,     &num_editor_hl_dx_boulderdash,
+    &editor_el_dx_boulderdash_ptr,     &num_editor_el_dx_boulderdash
   },
   {
     &setup.editor.el_chars,
-    editor_hl_chars,                   &num_editor_hl_chars,
-    editor_el_chars,                   &num_editor_el_chars
+    &editor_hl_chars_ptr,              &num_editor_hl_chars,
+    &editor_el_chars_ptr,              &num_editor_el_chars
   },
   {
     &setup.editor.el_custom,
-    editor_hl_custom,                  &num_editor_hl_custom,
-    editor_el_custom,                  &num_editor_el_custom
+    &editor_hl_custom_ptr,             &num_editor_hl_custom,
+    &editor_el_custom_ptr,             &num_editor_el_custom
   },
   {
     &setup.editor.el_custom_more,
-    editor_hl_custom_more,             &num_editor_hl_custom_more,
-    editor_el_custom_more,             &num_editor_el_custom_more
+    &editor_hl_custom_more_ptr,                &num_editor_hl_custom_more,
+    &editor_el_custom_more_ptr,                &num_editor_el_custom_more
+  },
+  {
+    &setup.editor.el_user_defined,
+    &editor_hl_user_defined_ptr,       &num_editor_hl_user_defined,
+    &editor_el_user_defined_ptr,       &num_editor_el_user_defined
+  },
+  {
+    &use_el_empty,
+    &editor_hl_empty_ptr,              &num_editor_hl_empty,
+    &editor_el_empty_ptr,              &num_editor_el_empty,
   },
   {
     NULL,
@@ -2970,14 +3033,22 @@ static void ReinitializeElementList()
   if (editor_elements != NULL)
     free(editor_elements);
 
-  /* do some sanity check for each element from element list at startup */
   if (!initialized)
   {
+    /* initialize optional user defined element list */
+    LoadUserDefinedEditorElementList(&editor_el_user_defined_ptr,
+                                    &num_editor_el_user_defined);
+
+    /* initialize list of empty elements (used for padding, if needed) */
+    for (i=0; i < ED_NUM_ELEMENTLIST_BUTTONS; i++)
+      editor_el_empty[i] = EL_EMPTY;
+
+    /* do some sanity checks for each element from element list */
     for (i=0; editor_elements_info[i].setup_value != NULL; i++)
     {
       for (j=0; j < *editor_elements_info[i].element_list_size; j++)
       {
-       int element = editor_elements_info[i].element_list[j];
+       int element = (*editor_elements_info[i].element_list)[j];
 
        if (element >= NUM_FILE_ELEMENTS)
          Error(ERR_WARN, "editor element %d is runtime element", element);
@@ -2991,6 +3062,7 @@ static void ReinitializeElementList()
   }
 
   num_editor_elements = 0;
+  use_el_empty = FALSE;
 
   /* determine size of element list */
   for (i=0; editor_elements_info[i].setup_value != NULL; i++)
@@ -3006,11 +3078,11 @@ static void ReinitializeElementList()
 
   if (num_editor_elements < ED_NUM_ELEMENTLIST_BUTTONS)
   {
-    /* workaround: offer at least as many elements as element buttons exist */
-    int list_nr = 1;   /* see above: editor_elements_info for Emerald Mine */
+    /* offer at least as many elements as element buttons exist */
+    use_el_empty = TRUE;
+    num_editor_el_empty = ED_NUM_ELEMENTLIST_BUTTONS - num_editor_elements;
 
-    *editor_elements_info[list_nr].setup_value = TRUE;
-    num_editor_elements += *editor_elements_info[list_nr].element_list_size;
+    num_editor_elements += num_editor_el_empty;
   }
 
   editor_elements = checked_malloc(num_editor_elements * sizeof(int));
@@ -3022,10 +3094,10 @@ static void ReinitializeElementList()
     {
       if (setup.editor.el_headlines)
        for (j=0; j < *editor_elements_info[i].headline_list_size; j++)
-         editor_elements[pos++] = editor_elements_info[i].headline_list[j];
+         editor_elements[pos++] = (*editor_elements_info[i].headline_list)[j];
 
       for (j=0; j < *editor_elements_info[i].element_list_size; j++)
-       editor_elements[pos++] = editor_elements_info[i].element_list[j];
+       editor_elements[pos++] = (*editor_elements_info[i].element_list)[j];
     }
   }
 
index 813ce976bf0bba97cc5df07d40d3c089c8812606..f8b4983994e6549448e8ad9a577da8dddb5170ca 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <ctype.h>
 #include <sys/stat.h>
+#include <math.h>
 
 #include "libgame/libgame.h"
 
@@ -2299,8 +2300,9 @@ void SaveScore(int level_nr)
 #define SETUP_TOKEN_EDITOR_EL_CUSTOM           8
 #define SETUP_TOKEN_EDITOR_EL_CUSTOM_MORE      9
 #define SETUP_TOKEN_EDITOR_EL_HEADLINES                10
+#define SETUP_TOKEN_EDITOR_EL_USER_DEFINED     11
 
-#define NUM_EDITOR_SETUP_TOKENS                        11
+#define NUM_EDITOR_SETUP_TOKENS                        12
 
 /* shortcut setup */
 #define SETUP_TOKEN_SHORTCUT_SAVE_GAME         0
@@ -2387,6 +2389,7 @@ static struct TokenInfo editor_setup_tokens[] =
   { TYPE_SWITCH, &sei.el_custom,       "editor.el_custom"              },
   { TYPE_SWITCH, &sei.el_custom_more,  "editor.el_custom_more"         },
   { TYPE_SWITCH, &sei.el_headlines,    "editor.el_headlines"           },
+  { TYPE_SWITCH, &sei.el_user_defined, "editor.el_user_defined"        },
 };
 
 static struct TokenInfo shortcut_setup_tokens[] =
@@ -2485,6 +2488,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
   si->editor.el_custom_more = FALSE;
 
   si->editor.el_headlines = TRUE;
+  si->editor.el_user_defined = FALSE;
 
   si->shortcut.save_game = DEFAULT_KEY_SAVE_GAME;
   si->shortcut.load_game = DEFAULT_KEY_LOAD_GAME;
@@ -2756,3 +2760,87 @@ void LoadSpecialMenuDesignSettings()
 
   freeSetupFileHash(setup_file_hash);
 }
+
+static char *itoa(unsigned int i)
+{
+  static char *a = NULL;
+
+  if (a != NULL)
+    free(a);
+
+  if (i > 2147483647)  /* yes, this is a kludge */
+    i = 2147483647;
+
+  a = checked_malloc(10 + 1);
+
+  sprintf(a, "%d", i);
+
+  return a;
+}
+
+void LoadUserDefinedEditorElementList(int **elements, int *num_elements)
+{
+  char *filename = getEditorSetupFilename();
+  SetupFileList *setup_file_list, *list;
+  SetupFileHash *element_hash;
+  int num_unknown_tokens = 0;
+  int i;
+
+  if ((setup_file_list = loadSetupFileList(filename)) == NULL)
+    return;
+
+  element_hash = newSetupFileHash();
+
+  for (i=0; i < NUM_FILE_ELEMENTS; i++)
+    setHashEntry(element_hash, element_info[i].token_name, itoa(i));
+
+  /* determined size may be larger than needed (due to unknown elements) */
+  *num_elements = 0;
+  for (list = setup_file_list; list != NULL; list = list->next)
+    (*num_elements)++;
+
+  /* add space for up to 3 more elements for padding that may be needed */
+  *num_elements += 3;
+
+  *elements = checked_malloc(*num_elements * sizeof(int));
+
+  *num_elements = 0;
+  for (list = setup_file_list; list != NULL; list = list->next)
+  {
+    char *value = getHashEntry(element_hash, list->token);
+
+    if (value)
+    {
+      (*elements)[(*num_elements)++] = atoi(value);
+    }
+    else
+    {
+      if (num_unknown_tokens == 0)
+      {
+       Error(ERR_RETURN_LINE, "-");
+       Error(ERR_RETURN, "warning: unknown token(s) found in config file:");
+       Error(ERR_RETURN, "- config file: '%s'", filename);
+
+       num_unknown_tokens++;
+      }
+
+      Error(ERR_RETURN, "- token: '%s'", list->token);
+    }
+  }
+
+  if (num_unknown_tokens > 0)
+    Error(ERR_RETURN_LINE, "-");
+
+  while (*num_elements % 4)    /* pad with empty elements, if needed */
+    (*elements)[(*num_elements)++] = EL_EMPTY;
+
+  freeSetupFileList(setup_file_list);
+  freeSetupFileHash(element_hash);
+
+#if 0
+  /* TEST-ONLY */
+  for (i=0; i < *num_elements; i++)
+    printf("editor: element '%s' [%d]\n",
+          element_info[(*elements)[i]].token_name, (*elements)[i]);
+#endif
+}
index 1ae371db1f3dee3ce13f253c3bdf77e64f697903..6ad50a6ce9ce24b73bfbc05bc1cc72c0f7785d6f 100644 (file)
@@ -40,5 +40,6 @@ void SaveSetup();
 
 void LoadCustomElementDescriptions();
 void LoadSpecialMenuDesignSettings();
+void LoadUserDefinedEditorElementList(int **, int *);
 
 #endif /* FILES_H */
index 8ba46e0be7e7a4772f5f90f78ab6cd424d2757d8..3ba6745deb17c313c1d55f640b9f2d8bdd7e4571 100644 (file)
@@ -405,6 +405,18 @@ char *getSetupFilename()
   return filename;
 }
 
+char *getEditorSetupFilename()
+{
+  static char *filename = NULL;
+
+  if (filename != NULL)
+    free(filename);
+
+  filename = getPath2(getSetupDir(), EDITORSETUP_FILENAME);
+
+  return filename;
+}
+
 static char *getCorrectedArtworkBasename(char *basename)
 {
   char *basename_corrected = basename;
@@ -1275,6 +1287,9 @@ SetupFileHash *newSetupFileHash()
   SetupFileHash *new_hash =
     create_hashtable(16, 0.75, get_hash_from_key, keys_are_equal);
 
+  if (new_hash == NULL)
+    Error(ERR_EXIT, "create_hashtable() failed -- out of memory");
+
   return new_hash;
 }
 
@@ -1387,7 +1402,11 @@ static void *loadSetupFileData(char *filename, boolean use_hash)
     if (line_ptr < line + line_len)
       value = line_ptr + 1;
     else
+#if 1
+      value = "true";  /* treat tokens without value as "true" */
+#else
       value = "\0";
+#endif
 
     /* cut leading whitespaces from value */
     for (; *value; value++)
@@ -2618,17 +2637,15 @@ char *getSetupLine(struct TokenInfo *token_info, char *prefix, int token_nr)
 
 void LoadLevelSetup_LastSeries()
 {
-  char *filename;
-  SetupFileHash *level_setup_hash = NULL;
-
-  /* always start with reliable default values */
-  leveldir_current = getFirstValidTreeInfoEntry(leveldir_first);
-
   /* ----------------------------------------------------------------------- */
   /* ~/.<program>/levelsetup.conf                                            */
   /* ----------------------------------------------------------------------- */
 
-  filename = getPath2(getSetupDir(), LEVELSETUP_FILENAME);
+  char *filename = getPath2(getSetupDir(), LEVELSETUP_FILENAME);
+  SetupFileHash *level_setup_hash = NULL;
+
+  /* always start with reliable default values */
+  leveldir_current = getFirstValidTreeInfoEntry(leveldir_first);
 
   if ((level_setup_hash = loadSetupFileHash(filename)))
   {
@@ -2652,17 +2669,15 @@ void LoadLevelSetup_LastSeries()
 
 void SaveLevelSetup_LastSeries()
 {
-  char *filename;
-  char *level_subdir = leveldir_current->filename;
-  FILE *file;
-
   /* ----------------------------------------------------------------------- */
   /* ~/.<program>/levelsetup.conf                                            */
   /* ----------------------------------------------------------------------- */
 
-  InitUserDataDirectory();
+  char *filename = getPath2(getSetupDir(), LEVELSETUP_FILENAME);
+  char *level_subdir = leveldir_current->filename;
+  FILE *file;
 
-  filename = getPath2(getSetupDir(), LEVELSETUP_FILENAME);
+  InitUserDataDirectory();
 
   if (!(file = fopen(filename, MODE_WRITE)))
   {
index 2498fe7d2345f5500484d05a99590454eaa74b5d..9bc5fd907bf90f325866b6af37a64cba95a7a947 100644 (file)
@@ -196,6 +196,7 @@ char *getLevelFilename(int);
 char *getTapeFilename(int);
 char *getScoreFilename(int);
 char *getSetupFilename(void);
+char *getEditorSetupFilename(void);
 char *getImageFilename(char *);
 char *getCustomImageFilename(char *);
 char *getCustomSoundFilename(char *);
index ae8473465d2f8b087086c2bd9ce40c174dd99b18..ec1b52501f66ab337091744ded186e06cbf49f80 100644 (file)
 #define LEVELSETUP_DIRECTORY   "levelsetup"
 #define SETUP_FILENAME         "setup.conf"
 #define LEVELSETUP_FILENAME    "levelsetup.conf"
+#define EDITORSETUP_FILENAME   "editorsetup.conf"
 #define LEVELINFO_FILENAME     "levelinfo.conf"
 #define GRAPHICSINFO_FILENAME  "graphicsinfo.conf"
 #define SOUNDSINFO_FILENAME    "soundsinfo.conf"
 #define LEVELSETUP_DIRECTORY   "lvlsetup"
 #define SETUP_FILENAME         "setup.cnf"
 #define LEVELSETUP_FILENAME    "lvlsetup.cnf"
+#define EDITORSETUP_FILENAME   "edsetup.conf"
 #define LEVELINFO_FILENAME     "lvlinfo.cnf"
 #define GRAPHICSINFO_FILENAME  "gfxinfo.cnf"
 #define SOUNDSINFO_FILENAME    "sndinfo.cnf"
@@ -539,6 +541,7 @@ struct SetupEditorInfo
   boolean el_chars;
   boolean el_custom;
   boolean el_custom_more;
+  boolean el_user_defined;
 
   boolean el_headlines;
 };
index d82f3bd25be8284036384bbf8ac5ef113e914b8d..92e3838cba5226ffe8946fb0cc30122ca51d0471 100644 (file)
@@ -1824,6 +1824,7 @@ static struct TokenInfo setup_info_editor[] =
   { TYPE_SWITCH,       &setup.editor.el_custom,        "Custom:"       },
   { TYPE_SWITCH,       &setup.editor.el_custom_more,   "More Custom:"  },
   { TYPE_SWITCH,       &setup.editor.el_headlines,     "Headlines:"    },
+  { TYPE_SWITCH,       &setup.editor.el_user_defined,  "User defined:" },
   { TYPE_EMPTY,                NULL,                   ""                      },
   { TYPE_LEAVE_MENU,   execSetupMain,          "Back"                  },
   { 0,                 NULL,                   NULL                    }