{
ED_LEVEL_TABS_XPOS(0), ED_LEVEL_TABS_YPOS(0),
GADGET_ID_LEVELINFO_LEVEL, GADGET_ID_NONE,
- 8, "Level",
+ 8, "Level",
NULL, NULL, NULL, "Configure level properties"
},
{
-1, -1,
GADGET_ID_LEVELINFO_EDITOR, GADGET_ID_LEVELINFO_LEVEL,
- 8, "Editor",
+ 8, "Editor",
NULL, NULL, NULL, "Configure editor properties"
},
{
ED_ELEMENT_TABS_XPOS(0), ED_ELEMENT_TABS_YPOS(0),
GADGET_ID_PROPERTIES_INFO, GADGET_ID_NONE,
- 8, "Info",
+ 8, "Info",
NULL, NULL, NULL, "Show information about element"
},
{
}
if (level_nr > leveldir_current->last_level)
- {
- static char *temp_levelinfo = NULL;
- FILE *temp_file = NULL;
- char line[MAX_LINE_LEN];
-
- setString(&temp_levelinfo,
- getPath2(getCurrentLevelDir(),
- getStringCat2(LEVELINFO_FILENAME, ".new")));
-
- if ((file = fopen(filename_levelinfo, MODE_READ)) &&
- (temp_file = fopen(temp_levelinfo, MODE_WRITE)))
- {
- while (fgets(line, MAX_LINE_LEN, file))
- {
- if (!strPrefix(line, "levels:"))
- fputs(line, temp_file);
- else
- fprintf(temp_file, "%-32s%d\n", "levels:", level_nr + 9);
- }
- }
-
- if (temp_file)
- fclose(temp_file);
-
- if (file)
- fclose(file);
-
- // needs error handling; also, ok on dos/win?
- unlink(filename_levelinfo);
- rename(temp_levelinfo, filename_levelinfo);
- }
+ UpdateUserLevelSet(getLoginName(), NULL, NULL, level_nr + 9, -1);
// else: allow the save even if annotation failed
getTabulatorBarWidth(), getTabulatorBarHeight(), tab_color);
}
+static void PrintInfoText(char *text, int font_nr, int xpos, int ypos)
+{
+ DrawText(SX + xpos, SY + ypos, text, font_nr);
+}
+
+static int PrintElementDescriptionFromFile(char *filename, int font_nr,
+ int xpos, int ypos)
+{
+ int font_width = getFontWidth(font_nr);
+ int font_height = getFontHeight(font_nr);
+ int max_chars_per_line = (SXSIZE - 2 * xpos) / font_width;
+ int max_lines_drawable = (SYSIZE - ypos) / font_height - 1;
+
+ return DrawTextFile(SX + xpos, SY + ypos, filename, font_nr,
+ max_chars_per_line, -1, max_lines_drawable, 0, -1,
+ TRUE, FALSE, FALSE);
+}
+
static void DrawLevelInfoLevel()
{
int i;
MapTextAreaGadget(ED_TEXTAREA_ID_ENVELOPE_INFO);
}
-static void PrintInfoText(char *text, int font_nr, int xpos, int ypos)
-{
- DrawText(SX + xpos, SY + ypos, text, font_nr);
-}
-
-static int PrintElementDescriptionFromFile(char *filename, int font_nr,
- int xpos, int ypos)
-{
- int font_width = getFontWidth(font_nr);
- int font_height = getFontHeight(font_nr);
- int max_chars_per_line = (SXSIZE - 2 * xpos) / font_width;
- int max_lines_drawable = (SYSIZE - ypos) / font_height - 1;
-
- return DrawTextFile(SX + xpos, SY + ypos, filename, font_nr,
- max_chars_per_line, -1, max_lines_drawable, 0, -1,
- TRUE, FALSE, FALSE);
-}
-
static void DrawPropertiesInfo()
{
static struct