X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Feditor.c;h=c5eb3e09d49eee142e7fdf9c0cb835f3c98b7b47;hb=f857fec3082c785b0dd271b6ad1b7642a2ed4e65;hp=a10ba95f4844805b53069071d99c514440359cf9;hpb=22e05dae8df6b55dd13eefd0a808a06f82ddba35;p=rocksndiamonds.git diff --git a/src/editor.c b/src/editor.c index a10ba95f..c5eb3e09 100644 --- a/src/editor.c +++ b/src/editor.c @@ -2607,7 +2607,7 @@ void CreateLevelEditorGadgets() 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(); @@ -3406,8 +3406,10 @@ static void DrawPropertiesConfig() else DrawElementContentAreas(); } +#if 1 else if (IS_CUSTOM_ELEMENT(properties_element)) DrawCustomChangedArea(); +#endif } if (IS_GEM(properties_element)) @@ -3440,6 +3442,7 @@ static void DrawPropertiesConfig() MapCheckbuttonGadget(i); } +#if 1 /* draw selectbox gadget */ i = ED_SELECTBOX_ID_CUSTOM_CHANGE_CAUSE; x = selectbox_info[i].x + xoffset_right2; @@ -3451,6 +3454,7 @@ static void DrawPropertiesConfig() ModifyGadget(level_editor_gadget[selectbox_info[i].gadget_id], GDI_SELECTBOX_INDEX, *selectbox_info[i].index, GDI_END); MapSelectboxGadget(i); +#endif } } @@ -3637,7 +3641,7 @@ static void DrawPropertiesTabulatorGadgets() 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; @@ -3655,19 +3659,23 @@ static void DrawPropertiesTabulatorGadgets() 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() @@ -3679,42 +3687,32 @@ 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_INSIDE, "- walkable inside" }, - { 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:"; @@ -3746,6 +3744,7 @@ static void DrawPropertiesInfo() 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, @@ -3764,6 +3763,7 @@ static void DrawPropertiesInfo() screen_line++; } +#endif PrintInfoText("Description:", FONT_TEXT_1, screen_line); if (PrintElementDescriptionFromFile(filename, screen_line + 1) == 0) @@ -5040,7 +5040,7 @@ static void HandleControlButtons(struct GadgetInfo *gi) TapeStartRecording(); level_editor_test_game = TRUE; - game_status = PLAYING; + game_status = GAME_MODE_PLAYING; InitGame(); } @@ -5198,7 +5198,7 @@ void HandleEditorGadgetInfoText(void *ptr) char shortcut[MAX_OUTPUT_LINESIZE + 1]; int max_infotext_len = getMaxInfoTextLength(); - if (game_status != LEVELED) + if (game_status != GAME_MODE_EDITOR) return; ClearEditorGadgetInfoText(); @@ -5379,7 +5379,7 @@ void RequestExitLevelEditor(boolean ask_if_level_has_changed) /* CloseDoor(DOOR_CLOSE_ALL); */ - game_status = MAINMENU; + game_status = GAME_MODE_MAIN; DrawMainMenu(); } else