{
// adjust level settings for (non-native) Sokoban-style levels
LoadLevel_InitSettings_SB(level);
+
+ // rename levels with title "nameless level" or if renaming is forced
+ if (leveldir_current->empty_level_name != NULL &&
+ (strEqual(level->name, NAMELESS_LEVEL_NAME) ||
+ leveldir_current->force_level_name))
+ snprintf(level->name, MAX_LEVEL_NAME_LEN + 1,
+ leveldir_current->empty_level_name, level_nr);
}
static void LoadLevel_InitStandardElements(struct LevelInfo *level)
#define LEVELINFO_TOKEN_FILENAME 24
#define LEVELINFO_TOKEN_FILETYPE 25
#define LEVELINFO_TOKEN_SPECIAL_FLAGS 26
-#define LEVELINFO_TOKEN_HANDICAP 27
-#define LEVELINFO_TOKEN_SKIP_LEVELS 28
-#define LEVELINFO_TOKEN_USE_EMC_TILES 29
+#define LEVELINFO_TOKEN_EMPTY_LEVEL_NAME 27
+#define LEVELINFO_TOKEN_FORCE_LEVEL_NAME 28
+#define LEVELINFO_TOKEN_HANDICAP 29
+#define LEVELINFO_TOKEN_SKIP_LEVELS 30
+#define LEVELINFO_TOKEN_USE_EMC_TILES 31
-#define NUM_LEVELINFO_TOKENS 30
+#define NUM_LEVELINFO_TOKENS 32
static LevelDirTree ldi;
{ TYPE_STRING, &ldi.level_filename, "filename" },
{ TYPE_STRING, &ldi.level_filetype, "filetype" },
{ TYPE_STRING, &ldi.special_flags, "special_flags" },
+ { TYPE_STRING, &ldi.empty_level_name, "empty_level_name" },
+ { TYPE_BOOLEAN, &ldi.force_level_name, "force_level_name" },
{ TYPE_BOOLEAN, &ldi.handicap, "handicap" },
{ TYPE_BOOLEAN, &ldi.skip_levels, "skip_levels" },
{ TYPE_BOOLEAN, &ldi.use_emc_tiles, "use_emc_tiles" }
ti->special_flags = NULL;
+ ti->empty_level_name = NULL;
+ ti->force_level_name = FALSE;
+
ti->levels = 0;
ti->first_level = 0;
ti->last_level = 0;
ti->special_flags = getStringCopy(parent->special_flags);
+ ti->empty_level_name = getStringCopy(parent->empty_level_name);
+ ti->force_level_name = parent->force_level_name;
+
ti->levels = parent->levels;
ti->first_level = parent->first_level;
ti->last_level = parent->last_level;
ti_copy->special_flags = getStringCopy(ti->special_flags);
+ ti_copy->empty_level_name = getStringCopy(ti->empty_level_name);
+ ti_copy->force_level_name = ti->force_level_name;
+
ti_copy->levels = ti->levels;
ti_copy->first_level = ti->first_level;
ti_copy->last_level = ti->last_level;