static char levelset_name[MAX_LEVEL_NAME_LEN + 1];
static char levelset_author[MAX_LEVEL_AUTHOR_LEN + 1];
static int levelset_num_levels = 100;
-static int levelset_first_level_nr = 1;
static int levelset_save_mode = LEVELSET_SAVE_MODE_UPDATE;
static struct
}
if (level_nr > leveldir_current->last_level)
- UpdateUserLevelSet(getLoginName(), NULL, NULL, level_nr + 9, -1);
+ UpdateUserLevelSet(getLoginName(), NULL, NULL, level_nr + 9);
// else: allow the save even if annotation failed
snprintf(levelset_author, MAX_LEVEL_AUTHOR_LEN + 1,
"%s", leveldir_current->author);
- levelset_num_levels = leveldir_current->levels;
- levelset_first_level_nr = leveldir_current->first_level;
+ levelset_num_levels = leveldir_current->levels;
levelset_save_mode = LEVELSET_SAVE_MODE_UPDATE;
}
if (UpdateUserLevelSet(levelset_subdir,
levelset_name,
levelset_author,
- levelset_num_levels,
- levelset_first_level_nr))
+ levelset_num_levels))
{
Request("Level set updated!", REQ_CONFIRM);
}
if (CreateUserLevelSet(levelset_subdir,
levelset_name,
levelset_author,
- levelset_num_levels,
- 1))
+ levelset_num_levels))
{
Request("New level set created!", REQ_CONFIRM);
Error(ERR_EXIT, "internal level set structure corrupted -- aborting");
}
-boolean UpdateUserLevelSet(char *level_subdir,
- char *level_name, char *level_author,
- int num_levels, int first_level_nr)
+boolean UpdateUserLevelSet(char *level_subdir, char *level_name,
+ char *level_author, int num_levels)
{
char *filename = getPath2(getUserLevelDir(level_subdir), LEVELINFO_FILENAME);
char *filename_tmp = getStringCat2(filename, ".tmp");
if (num_levels != -1)
leveldir->levels = num_levels;
- if (first_level_nr != -1)
- leveldir->first_level = first_level_nr;
-
// update values that depend on other values
setString(&leveldir->name_sorting, leveldir->name);
fprintf(file_tmp, "%-32s%s\n", "author:", level_author);
else if (strPrefix(line, "levels:") && num_levels != -1)
fprintf(file_tmp, "%-32s%d\n", "levels:", num_levels);
- else if (strPrefix(line, "first_level:") && first_level_nr != -1)
- fprintf(file_tmp, "%-32s%d\n", "first_level:", first_level_nr);
else
fputs(line, file_tmp);
}
return success;
}
-boolean CreateUserLevelSet(char *level_subdir,
- char *level_name, char *level_author,
- int num_levels, int first_level_nr)
+boolean CreateUserLevelSet(char *level_subdir, char *level_name,
+ char *level_author, int num_levels)
{
LevelDirTree *level_info;
char *filename;
setString(&level_info->name, level_name);
setString(&level_info->author, level_author);
level_info->levels = num_levels;
- level_info->first_level = first_level_nr;
+ level_info->first_level = 1;
level_info->sort_priority = LEVELCLASS_PRIVATE_START;
level_info->readonly = FALSE;
static void SaveUserLevelInfo()
{
- CreateUserLevelSet(getLoginName(), getLoginName(), getRealName(), 100, 1);
+ CreateUserLevelSet(getLoginName(), getLoginName(), getRealName(), 100);
}
char *getSetupValue(int type, void *value)
void LoadLevelArtworkInfo(void);
void AddUserLevelSetToLevelInfo(char *);
-boolean UpdateUserLevelSet(char *, char *, char *, int, int);
-boolean CreateUserLevelSet(char *, char *, char *, int, int);
+boolean UpdateUserLevelSet(char *, char *, char *, int);
+boolean CreateUserLevelSet(char *, char *, char *, int);
void LoadLevelSetup_LastSeries(void);
void SaveLevelSetup_LastSeries(void);