-#define COMPILE_DATE_STRING "[2003-07-03 13:40]"
+#define COMPILE_DATE_STRING "[2003-07-03 21:19]"
#define GADGET_ID_LEVEL_NAME (GADGET_ID_TEXT_INPUT_FIRST + 0)
#define GADGET_ID_LEVEL_AUTHOR (GADGET_ID_TEXT_INPUT_FIRST + 1)
+#define GADGET_ID_ELEMENT_NAME (GADGET_ID_TEXT_INPUT_FIRST + 2)
/* selectbox identifiers */
-#define GADGET_ID_SELECTBOX_FIRST (GADGET_ID_TEXT_INPUT_FIRST + 2)
+#define GADGET_ID_SELECTBOX_FIRST (GADGET_ID_TEXT_INPUT_FIRST + 3)
#define GADGET_ID_CUSTOM_WALK_TO_ACTION (GADGET_ID_SELECTBOX_FIRST + 0)
#define GADGET_ID_CUSTOM_CONSISTENCY (GADGET_ID_SELECTBOX_FIRST + 1)
/* values for text input gadgets */
#define ED_TEXTINPUT_ID_LEVEL_NAME 0
#define ED_TEXTINPUT_ID_LEVEL_AUTHOR 1
+#define ED_TEXTINPUT_ID_ELEMENT_NAME 2
-#define ED_NUM_TEXTINPUT 2
+#define ED_NUM_TEXTINPUT 3
#define ED_TEXTINPUT_ID_LEVEL_FIRST ED_TEXTINPUT_ID_LEVEL_NAME
#define ED_TEXTINPUT_ID_LEVEL_LAST ED_TEXTINPUT_ID_LEVEL_AUTHOR
MAX_LEVEL_AUTHOR_LEN,
level.author,
"Author"
+ },
+ {
+ 5 * MINI_TILEX, 5 * MINI_TILEY - ED_BORDER_SIZE,
+ GADGET_ID_ELEMENT_NAME,
+ MAX_ELEMENT_NAME_LEN - 2, /* currently 2 chars less editable */
+ custom_element.description,
+ NULL
}
};
{
if (element_info[element].custom_description != NULL)
info_text = element_info[element].custom_description;
+ else if (strlen(element_info[element].description) > 0)
+ info_text = element_info[element].description;
else if (element_info[element].editor_description != NULL)
info_text = element_info[element].editor_description;
}
int x = textinput_info[id].x + xoffset_above;
int y = textinput_info[id].y + yoffset_above;
- sprintf(infotext, "%s:", textinput_info[id].infotext);
- infotext[max_infotext_len] = '\0';
- DrawTextF(x, y, FONT_TEXT_1, infotext);
+ if (textinput_info[id].infotext)
+ {
+ sprintf(infotext, "%s:", textinput_info[id].infotext);
+ infotext[max_infotext_len] = '\0';
+ DrawTextF(x, y, FONT_TEXT_1, infotext);
+ }
ModifyGadget(level_editor_gadget[textinput_info[id].gadget_id],
GDI_TEXT_VALUE, textinput_info[id].value, GDI_END);
/* draw drawing area gadgets */
DrawCustomContentArea();
+
+ /* draw text input gadgets */
+ MapTextInputGadget(ED_TEXTINPUT_ID_ELEMENT_NAME);
}
}
ModifyEditorElementList();
RedrawDrawingElements();
+ DrawPropertiesAdvancedDrawingAreas();
+
FrameCounter = 0; /* restart animation frame counter */
}
else if (id == GADGET_ID_CUSTOM_CONTENT)
static void HandleTextInputGadgets(struct GadgetInfo *gi)
{
- strcpy(textinput_info[gi->custom_type_id].value, gi->text.value);
+ int type_id = gi->custom_type_id;
+
+ strcpy(textinput_info[type_id].value, gi->text.value);
+
+ if (type_id == ED_TEXTINPUT_ID_ELEMENT_NAME)
+ CopyCustomElementPropertiesToGame(properties_element);
}
static void HandleSelectboxGadgets(struct GadgetInfo *gi)
#define LEVEL_HEADER_UNUSED 13 /* unused level header bytes */
#define LEVEL_CHUNK_CNT2_SIZE 160 /* size of level CNT2 chunk */
#define LEVEL_CHUNK_CNT2_UNUSED 11 /* unused CNT2 chunk bytes */
-#define LEVEL_CPART_CUS3_SIZE 102 /* size of CUS3 chunk part */
+#define LEVEL_CPART_CUS3_SIZE 134 /* size of CUS3 chunk part */
#define LEVEL_CPART_CUS3_UNUSED 16 /* unused CUS3 bytes / part */
#define TAPE_HEADER_SIZE 20 /* size of tape file header */
#define TAPE_HEADER_UNUSED 3 /* unused tape header bytes */
{
int element = EL_CUSTOM_START + i;
+ for(j=0; j<MAX_ELEMENT_NAME_LEN; j++)
+ element_info[element].description[j] = '\0';
+ strcpy(element_info[element].description,
+ element_info[element].editor_description);
+
element_info[element].use_gfx_element = FALSE;
element_info[element].gfx_element = EL_EMPTY_SPACE;
{
int num_changed_custom_elements = getFile16BitBE(file);
int chunk_size_expected = LEVEL_CHUNK_CUS3_SIZE(num_changed_custom_elements);
- int i, x, y;
+ int i, j, x, y;
if (chunk_size_expected != chunk_size)
{
element = EL_DEFAULT; /* dummy element used for artwork config */
}
+ for(j=0; j<MAX_ELEMENT_NAME_LEN; j++)
+ element_info[element].description[j] = getFile8Bit(file);
+ element_info[element].description[MAX_ELEMENT_NAME_LEN] = 0;
+
Properties[element][EP_BITFIELD_BASE] = getFile32BitBE(file);
/* some free bytes for future properties and padding */
static void SaveLevel_CUS3(FILE *file, struct LevelInfo *level,
int num_changed_custom_elements)
{
- int i, x, y, check = 0;
+ int i, j, x, y, check = 0;
putFile16BitBE(file, num_changed_custom_elements);
if (check < num_changed_custom_elements)
{
putFile16BitBE(file, element);
+
+ for(j=0; j<MAX_ELEMENT_NAME_LEN; j++)
+ putFile8Bit(file, element_info[element].description[j]);
+
putFile32BitBE(file, Properties[element][EP_BITFIELD_BASE]);
/* some free bytes for future properties and padding */
/* boundaries of arrays etc. */
#define MAX_LEVEL_NAME_LEN 32
#define MAX_LEVEL_AUTHOR_LEN 32
+#define MAX_ELEMENT_NAME_LEN 32
#define MAX_TAPELEN (1000 * 50) /* max. time * framerate */
#define MAX_SCORE_ENTRIES 100
#define MAX_NUM_AMOEBA 100
char *token_name; /* element token used in config files */
char *class_name; /* element class used in config files */
- char *editor_description; /* short description for level editor */
- char *custom_description; /* custom description for level editor */
+ char *editor_description; /* pre-defined description for level editor */
+ char *custom_description; /* alternative description from config file */
+ char description[MAX_ELEMENT_NAME_LEN + 1]; /* for custom elements */
/* ---------- graphic and sound definitions ---------- */
/* ---------- special element property values ---------- */
- boolean use_gfx_element;
+ boolean use_gfx_element; /* use custom graphic element */
short gfx_element; /* optional custom graphic element */
int score; /* score value for collecting */