/* values for counter gadgets */
#define ED_COUNT_ELEM_SCORE_XPOS ED_SETTINGS_XPOS
-#define ED_COUNT_ELEM_SCORE_YPOS (14 * MINI_TILEY)
+#define ED_COUNT_ELEM_SCORE_YPOS (11 * MINI_TILEY)
#define ED_COUNT_ELEM_CONTENT_XPOS ED_SETTINGS_XPOS
#define ED_COUNT_ELEM_CONTENT_YPOS (19 * MINI_TILEY)
#define GADGET_ID_STICK_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 5)
#define GADGET_ID_EM_SLIPPERY_GEMS (GADGET_ID_CHECKBUTTON_FIRST + 6)
#define GADGET_ID_CUSTOM_INDESTRUCTIBLE (GADGET_ID_CHECKBUTTON_FIRST + 7)
-#define GADGET_ID_CUSTOM_CAN_FALL (GADGET_ID_CHECKBUTTON_FIRST + 8)
-#define GADGET_ID_CUSTOM_CAN_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 9)
+#define GADGET_ID_CUSTOM_DIGGABLE (GADGET_ID_CHECKBUTTON_FIRST + 8)
+#define GADGET_ID_CUSTOM_COLLECTIBLE (GADGET_ID_CHECKBUTTON_FIRST + 9)
#define GADGET_ID_CUSTOM_PUSHABLE (GADGET_ID_CHECKBUTTON_FIRST + 10)
-#define GADGET_ID_CUSTOM_SLIPPERY (GADGET_ID_CHECKBUTTON_FIRST + 11)
+#define GADGET_ID_CUSTOM_CAN_FALL (GADGET_ID_CHECKBUTTON_FIRST + 11)
+#define GADGET_ID_CUSTOM_CAN_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 12)
+#define GADGET_ID_CUSTOM_CAN_MOVE (GADGET_ID_CHECKBUTTON_FIRST + 13)
+#define GADGET_ID_CUSTOM_SLIPPERY (GADGET_ID_CHECKBUTTON_FIRST + 14)
+#define GADGET_ID_CUSTOM_WALKABLE_OVER (GADGET_ID_CHECKBUTTON_FIRST + 15)
+#define GADGET_ID_CUSTOM_WALKABLE_INSIDE (GADGET_ID_CHECKBUTTON_FIRST+ 16)
+#define GADGET_ID_CUSTOM_WALKABLE_UNDER (GADGET_ID_CHECKBUTTON_FIRST + 17)
/* gadgets for buttons in element list */
-#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 12)
+#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 18)
#define GADGET_ID_ELEMENTLIST_LAST (GADGET_ID_ELEMENTLIST_FIRST + \
ED_NUM_ELEMENTLIST_BUTTONS - 1)
#define ED_CHECKBUTTON_ID_STICK_ELEMENT 3
#define ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS 4
#define ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE 5
-#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 6
-#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 7
+#define ED_CHECKBUTTON_ID_CUSTOM_DIGGABLE 6
+#define ED_CHECKBUTTON_ID_CUSTOM_COLLECTIBLE 7
#define ED_CHECKBUTTON_ID_CUSTOM_PUSHABLE 8
-#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 9
+#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 9
+#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 10
+#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE 11
+#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 12
+#define ED_CHECKBUTTON_ID_CUSTOM_WALKABLE_OVER 13
+#define ED_CHECKBUTTON_ID_CUSTOM_WALKABLE_INSIDE 14
+#define ED_CHECKBUTTON_ID_CUSTOM_WALKABLE_UNDER 15
-#define ED_NUM_CHECKBUTTONS 10
+#define ED_NUM_CHECKBUTTONS 16
#define ED_CHECKBUTTON_ID_LEVEL_FIRST ED_CHECKBUTTON_ID_DOUBLE_SPEED
#define ED_CHECKBUTTON_ID_LEVEL_LAST ED_CHECKBUTTON_ID_RANDOM_RESTRICTED
#define ED_CHECKBUTTON_ID_CUSTOM_FIRST ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE
-#define ED_CHECKBUTTON_ID_CUSTOM_LAST ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY
+#define ED_CHECKBUTTON_ID_CUSTOM_LAST ED_CHECKBUTTON_ID_CUSTOM_WALKABLE_UNDER
/* values for radiobutton gadgets */
#define ED_RADIOBUTTON_ID_PERCENTAGE 0
"slip down from certain flat walls","use EM style slipping behaviour"
},
{
- ED_SETTINGS_XPOS, ED_COUNTER_YPOS2(10),
+ ED_SETTINGS_XPOS, ED_COUNTER_YPOS2(5),
GADGET_ID_CUSTOM_INDESTRUCTIBLE,
&custom_element_properties[EP_INDESTRUCTIBLE],
"indestructible", "element cannot be destroyed"
},
{
- ED_SETTINGS_XPOS, ED_COUNTER_YPOS2(11),
+ ED_SETTINGS_XPOS, ED_COUNTER_YPOS2(6),
+ GADGET_ID_CUSTOM_DIGGABLE,
+ &custom_element_properties[EP_DIGGABLE],
+ "diggable", "element can be digged away"
+ },
+ {
+ ED_SETTINGS_XPOS, ED_COUNTER_YPOS2(7),
+ GADGET_ID_CUSTOM_COLLECTIBLE,
+ &custom_element_properties[EP_COLLECTIBLE],
+ "collectible", "element can be collected"
+ },
+ {
+ ED_SETTINGS_XPOS, ED_COUNTER_YPOS2(8),
+ GADGET_ID_CUSTOM_PUSHABLE,
+ &custom_element_properties[EP_PUSHABLE],
+ "pushable", "element can be pushed"
+ },
+ {
+ ED_SETTINGS_XPOS, ED_COUNTER_YPOS2(9),
GADGET_ID_CUSTOM_CAN_FALL,
&custom_element_properties[EP_CAN_FALL],
"can fall", "element can fall down"
},
{
- ED_SETTINGS_XPOS, ED_COUNTER_YPOS2(12),
+ ED_SETTINGS_XPOS, ED_COUNTER_YPOS2(10),
GADGET_ID_CUSTOM_CAN_SMASH,
&custom_element_properties[EP_CAN_SMASH],
"can smash", "element can smash other elements"
},
{
- ED_SETTINGS_XPOS, ED_COUNTER_YPOS2(13),
- GADGET_ID_CUSTOM_PUSHABLE,
- &custom_element_properties[EP_PUSHABLE],
- "pushable", "element can be pushed"
+ ED_SETTINGS_XPOS, ED_COUNTER_YPOS2(11),
+ GADGET_ID_CUSTOM_CAN_MOVE,
+ &custom_element_properties[EP_CAN_MOVE],
+ "can move", "element can move in some direction"
},
{
- ED_SETTINGS_XPOS, ED_COUNTER_YPOS2(14),
+ ED_SETTINGS_XPOS, ED_COUNTER_YPOS2(12),
GADGET_ID_CUSTOM_SLIPPERY,
&custom_element_properties[EP_SLIPPERY],
"slippery", "other elements can fall down from it"
+ },
+ {
+ ED_SETTINGS_XPOS, ED_COUNTER_YPOS2(13),
+ GADGET_ID_CUSTOM_WALKABLE_OVER,
+ &custom_element_properties[EP_WALKABLE_OVER],
+ "player can walk over", "player can walk over this element"
+ },
+ {
+ ED_SETTINGS_XPOS, ED_COUNTER_YPOS2(14),
+ GADGET_ID_CUSTOM_WALKABLE_INSIDE,
+ &custom_element_properties[EP_WALKABLE_INSIDE],
+ "player can walk inside", "player can walk inside this element"
+ },
+ {
+ ED_SETTINGS_XPOS, ED_COUNTER_YPOS2(15),
+ GADGET_ID_CUSTOM_WALKABLE_UNDER,
+ &custom_element_properties[EP_WALKABLE_UNDER],
+ "player can walk under", "player can walk under this element"
}
};
int old_game_status = game_status;
/* setting 'game_status' is needed to get the right fonts for the editor */
- game_status = LEVELED;
+ game_status = GAME_MODE_EDITOR;
ReinitializeElementList();
static void DrawPropertiesConfig()
{
+ boolean element_has_score = FALSE;
+ char *element_score_text = NULL;
+ int temporary_dummy_score = 0;
int counter_id = ED_COUNTER_ID_ELEM_SCORE;
int xoffset_right = getCounterGadgetWidth();
int yoffset_right = ED_BORDER_SIZE;
{
if (elements_with_counter[i].element == properties_element)
{
+#if 1
+ counterbutton_info[counter_id].value = elements_with_counter[i].value;
+ element_score_text = elements_with_counter[i].text;
+ element_has_score = TRUE;
+#else
int x = counterbutton_info[counter_id].x + xoffset_right;
int y = counterbutton_info[counter_id].y + yoffset_right;
ModifyEditorCounter(counter_id, *counterbutton_info[counter_id].value);
MapCounterButtons(counter_id);
+#endif
break;
}
}
- if (HAS_CONTENT(properties_element) ||
- IS_CUSTOM_ELEMENT(properties_element))
+ if (IS_CUSTOM_ELEMENT(properties_element))
+ {
+ counterbutton_info[counter_id].value = &temporary_dummy_score;
+ element_score_text = "Score for certain actions";
+ element_has_score = TRUE;
+ }
+
+ if (element_has_score)
+ {
+ int x = counterbutton_info[counter_id].x + xoffset_right;
+ int y = counterbutton_info[counter_id].y + yoffset_right;
+
+ DrawTextF(x, y, FONT_TEXT_1, element_score_text);
+
+ ModifyEditorCounter(counter_id, *counterbutton_info[counter_id].value);
+ MapCounterButtons(counter_id);
+ }
+
+ if (HAS_CONTENT(properties_element))
{
/* draw stickybutton gadget */
i = ED_CHECKBUTTON_ID_STICK_ELEMENT;
else
DrawElementContentAreas();
}
- else if (IS_CUSTOM_ELEMENT(properties_element))
- DrawCustomChangedArea();
}
if (IS_GEM(properties_element))
{
CopyCustomElementPropertiesToEditor(properties_element);
- for (i = ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE;
- i <= ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY; i++)
+ for (i = ED_CHECKBUTTON_ID_CUSTOM_FIRST;
+ i <= ED_CHECKBUTTON_ID_CUSTOM_LAST; i++)
{
/* draw checkbutton gadget */
x = checkbutton_info[i].x + xoffset_right2;
GDI_CHECKED, *checkbutton_info[i].value, GDI_END);
MapCheckbuttonGadget(i);
}
-
- /* draw selectbox gadget */
- i = ED_SELECTBOX_ID_CUSTOM_CHANGE_CAUSE;
- x = selectbox_info[i].x + xoffset_right2;
- y = selectbox_info[i].y + yoffset_right2;
-
- selectbox_info[i].index = &index_change_cause;
-
- DrawTextF(x, y, FONT_TEXT_1, selectbox_info[i].text);
- ModifyGadget(level_editor_gadget[selectbox_info[i].gadget_id],
- GDI_SELECTBOX_INDEX, *selectbox_info[i].index, GDI_END);
- MapSelectboxGadget(i);
}
}
struct GadgetDesign *gd = &gd_gi->alt_design[GD_BUTTON_UNPRESSED];
int gd_x = gd->x + gd_gi->border.width / 2;
int gd_y = gd->y + gd_gi->height - 1;
- Pixel line_color = GetPixel(gd->bitmap, gd_x, gd_y);
+ Pixel tab_color = GetPixel(gd->bitmap, gd_x, gd_y);
int id_first = ED_TEXTBUTTON_ID_PROPERTIES_INFO;
int id_last = ED_TEXTBUTTON_ID_PROPERTIES_INFO;
int i;
int gadget_id = textbutton_info[i].gadget_id;
struct GadgetInfo *gi = level_editor_gadget[gadget_id];
boolean active = (i != edit_mode_properties);
- Pixel color = (active ? BLACK_PIXEL : line_color);
- /* draw solid or black line below tabulator button */
- FillRectangle(drawto, gi->x, gi->y + gi->height, gi->width, 1, color);
+ /* draw background line below tabulator button */
+ ClearRectangleOnBackground(drawto, gi->x, gi->y + gi->height, gi->width,1);
+
+ /* draw solid line below inactive tabulator buttons */
+ if (!active && tab_color != BLACK_PIXEL) /* black => transparent */
+ FillRectangle(drawto, gi->x, gi->y + gi->height, gi->width,1, tab_color);
ModifyGadget(gi, GDI_ACTIVE, active, GDI_END);
MapTextbuttonGadget(i);
}
/* draw little border line below tabulator buttons */
- FillRectangle(drawto, gd_gi->x, gd_gi->y + gd_gi->height + 1,
- 3 * gd_gi->width + 2 * ED_GADGET_DISTANCE, ED_GADGET_DISTANCE,
- line_color);
+ if (tab_color != BLACK_PIXEL) /* black => transparent */
+ FillRectangle(drawto, gd_gi->x, gd_gi->y + gd_gi->height + 1,
+ 3 * gd_gi->width + 2 * ED_GADGET_DISTANCE,
+ ED_GADGET_DISTANCE, tab_color);
}
static void DrawPropertiesInfo()
}
properties[] =
{
- { EP_AMOEBALIVE, "- living amoeba" },
- { EP_AMOEBOID, "- amoeboid" },
- { EP_PFORTE, "- pforte" },
- { EP_SOLID, "- solid" },
- { EP_INDESTRUCTIBLE, "- undestructible" },
- { EP_SLIPPERY, "- slippery" },
- { EP_ENEMY, "- enemy" },
- { EP_MAUER, "- mauer" },
- { EP_CAN_FALL, "- can fall" },
- { EP_CAN_SMASH, "- can smash" },
- { EP_CAN_CHANGE, "- can change" },
- { EP_CAN_MOVE, "- can move" },
- { EP_COULD_MOVE, "- could move" },
- { EP_DONT_TOUCH, "- don't touch" },
- { EP_DONT_GO_TO, "- don't go to" },
- { EP_FOOD_DARK_YAMYAM, "- food for dark yamyam" },
- { EP_BD_ELEMENT, "- BD style" },
- { EP_SB_ELEMENT, "- SB style" },
- { EP_GEM, "- gem" },
- { EP_INACTIVE, "- inactive" },
- { EP_EXPLOSIVE, "- explosive" },
- { EP_FOOD_PENGUIN, "- food for penguin" },
- { EP_PUSHABLE, "- pushable" },
- { EP_PLAYER, "- player" },
- { EP_HAS_CONTENT, "- has content" },
- { EP_DIGGABLE, "- diggable" },
- { EP_SP_ELEMENT, "- SB style" },
- { EP_WALKABLE_THROUGH, "- walkable through" },
- { EP_OVER_PLAYER, "- over player" },
- { EP_ACTIVE_BOMB, "- active bomb" },
- { EP_BELT, "- belt" },
- { EP_BELT_ACTIVE, "- active belt" },
- { EP_BELT_SWITCH, "- belt switch" },
- { EP_WALKABLE_UNDER, "- walkable under" },
- { EP_EM_SLIPPERY_WALL, "- EM style slippery wall" },
- { EP_CAN_BE_CRUMBLED, "- can be crumbled" },
- { -1, NULL }
+ /* configurable properties */
+ { EP_INDESTRUCTIBLE, "- undestructible" },
+ { EP_DIGGABLE, "- diggable" },
+ { EP_COLLECTIBLE, "- collectible" },
+ { EP_PUSHABLE, "- pushable" },
+ { EP_CAN_FALL, "- can fall" },
+ { EP_CAN_SMASH, "- can smash other objects" },
+ { EP_CAN_MOVE, "- can move" },
+ { EP_SLIPPERY, "- slippery for falling objects" },
+ { EP_EM_SLIPPERY_WALL, "- slippery for some gems (EM style)" },
+ { EP_WALKABLE_OVER, "- player can walk over it" },
+ { EP_WALKABLE_INSIDE, "- player can walk inside it" },
+ { EP_WALKABLE_UNDER, "- player can walk under it" },
+ { EP_PASSABLE_OVER, "- player can pass over it" },
+ { EP_PASSABLE_INSIDE, "- player can pass through it" },
+ { EP_PASSABLE_UNDER, "- player can pass under it" },
+
+ /* pre-defined properties */
+ { EP_CAN_PASS_MAGIC_WALL, "- can pass magic walls" },
+ { EP_DONT_TOUCH, "- deadly when touched" },
+ { EP_ENEMY, "- can kill the player" },
+ { EP_DONT_GO_TO, "- deadly when walked to" },
+ { EP_CAN_EXPLODE, "- can explode" },
+ { EP_HAS_CONTENT, "- can contain other elements" },
+
+ { -1, NULL }
};
char *filename = getElementDescriptionFilename(properties_element);
char *percentage_text = "In this level:";
if (HAS_PROPERTY(properties_element, properties[i].value))
num_standard_properties++;
+#if 1
if (num_standard_properties > 0)
{
DrawTextF(pad_x, pad_y + screen_line * font2_height, font1_nr,
screen_line++;
}
+#endif
PrintInfoText("Description:", FONT_TEXT_1, screen_line);
if (PrintElementDescriptionFromFile(filename, screen_line + 1) == 0)
static void DrawPropertiesAdvanced()
{
- DrawText(SX + ED_SETTINGS_XPOS, SY + 5 * TILEY, "Coming soon!", FONT_TEXT_1);
+ int xoffset_right2 = ED_CHECKBUTTON_XSIZE + 2 * ED_GADGET_DISTANCE;
+ int yoffset_right2 = ED_BORDER_SIZE;
+ int i, x, y;
+
+ DrawText(SX + ED_SETTINGS_XPOS, SY + 5 * TILEY,
+ "Under construction! :-)", FONT_TEXT_1);
+
+ /* draw stickybutton gadget */
+ i = ED_CHECKBUTTON_ID_STICK_ELEMENT;
+ x = checkbutton_info[i].x + xoffset_right2;
+ y = checkbutton_info[i].y + yoffset_right2;
+
+ DrawTextF(x, y, FONT_TEXT_1, checkbutton_info[i].text);
+ ModifyGadget(level_editor_gadget[checkbutton_info[i].gadget_id],
+ GDI_CHECKED, *checkbutton_info[i].value, GDI_END);
+ MapCheckbuttonGadget(i);
+
+ DrawCustomChangedArea();
+
+ /* draw selectbox gadget */
+ i = ED_SELECTBOX_ID_CUSTOM_CHANGE_CAUSE;
+ x = selectbox_info[i].x + xoffset_right2;
+ y = selectbox_info[i].y + yoffset_right2;
+
+ selectbox_info[i].index = &index_change_cause;
+
+ DrawTextF(x, y, FONT_TEXT_1, selectbox_info[i].text);
+ ModifyGadget(level_editor_gadget[selectbox_info[i].gadget_id],
+ GDI_SELECTBOX_INDEX, *selectbox_info[i].index, GDI_END);
+ MapSelectboxGadget(i);
}
static void DrawPropertiesWindow()
case GADGET_ID_FLOOD_FILL:
case GADGET_ID_GRAB_BRUSH:
case GADGET_ID_PICK_ELEMENT:
- last_drawing_function = drawing_function;
+ if (drawing_function != GADGET_ID_PICK_ELEMENT)
+ last_drawing_function = drawing_function;
drawing_function = id;
draw_with_brush = FALSE;
break;
TapeStartRecording();
level_editor_test_game = TRUE;
- game_status = PLAYING;
+ game_status = GAME_MODE_PLAYING;
InitGame();
}
char shortcut[MAX_OUTPUT_LINESIZE + 1];
int max_infotext_len = getMaxInfoTextLength();
- if (game_status != LEVELED)
+ if (game_status != GAME_MODE_EDITOR)
return;
ClearEditorGadgetInfoText();
/*
CloseDoor(DOOR_CLOSE_ALL);
*/
- game_status = MAINMENU;
+ game_status = GAME_MODE_MAIN;
DrawMainMenu();
}
else