From: Holger Schemel Date: Sun, 24 Mar 2024 23:03:17 +0000 (+0100) Subject: extended support for expanding wall settings in BD engine to level editor X-Git-Tag: 4.4.0.0-test-1~140 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=8921d90e18b6291cd3f8109da74b267fd1cc8d10;p=rocksndiamonds.git extended support for expanding wall settings in BD engine to level editor --- diff --git a/src/editor.c b/src/editor.c index c3a95116..a09e20ac 100644 --- a/src/editor.c +++ b/src/editor.c @@ -581,6 +581,7 @@ enum GADGET_ID_BD_BITER_EATS_ELEMENT, GADGET_ID_BD_BLADDER_CONVERTS_BY_ELEMENT, GADGET_ID_BD_NUT_CONTENT, + GADGET_ID_BD_EXPANDING_WALL_LOOKS_LIKE, GADGET_ID_START_ELEMENT, GADGET_ID_ARTWORK_ELEMENT, GADGET_ID_EXPLOSION_ELEMENT, @@ -1220,6 +1221,7 @@ enum ED_DRAWING_ID_BD_BITER_EATS_ELEMENT, ED_DRAWING_ID_BD_BLADDER_CONVERTS_BY_ELEMENT, ED_DRAWING_ID_BD_NUT_CONTENT, + ED_DRAWING_ID_BD_EXPANDING_WALL_LOOKS_LIKE, ED_DRAWING_ID_START_ELEMENT, ED_DRAWING_ID_ARTWORK_ELEMENT, ED_DRAWING_ID_EXPLOSION_ELEMENT, @@ -4580,6 +4582,14 @@ static struct &level.bd_nut_content, 1, 1, "When breaking, changes to:", NULL, NULL, NULL, "Element created when breaking nut" }, + { + ED_DRAWING_ID_BD_EXPANDING_WALL_LOOKS_LIKE, + ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(1), + ED_AREA_1X1_SETTINGS_XOFF, ED_AREA_1X1_SETTINGS_YOFF, + GADGET_ID_BD_EXPANDING_WALL_LOOKS_LIKE, GADGET_ID_NONE, + &level.bd_expanding_wall_looks_like, 1, 1, + "Use graphic of element:", NULL, NULL, NULL, "Expanding wall looks like this element" + }, // ---------- level start element ------------------------------------------- @@ -11500,6 +11510,7 @@ static boolean checkPropertiesConfig(int element) IS_PLAYER_ELEMENT(element) || IS_BD_PLAYER_ELEMENT(element) || IS_BD_EXPANDABLE_WALL(properties_element) || + IS_BD_EXPANDABLE_STEELWALL(properties_element) || IS_BD_CONVEYOR_BELT(properties_element) || IS_BD_CONVEYOR_BELT_SWITCH(properties_element) || IS_SOKOBAN_OBJECT_OR_FIELD(element) || @@ -11887,9 +11898,13 @@ static void DrawPropertiesConfig(void) MapDrawingArea(ED_DRAWING_ID_BD_SLIME_CONVERTS_TO_ELEMENT_3); } - if (IS_BD_EXPANDABLE_WALL(properties_element)) + if (IS_BD_EXPANDABLE_WALL(properties_element) || + IS_BD_EXPANDABLE_STEELWALL(properties_element)) { MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_CHANGE_EXPANDING_WALL); + + if (IS_BD_EXPANDABLE_WALL(properties_element)) + MapDrawingArea(ED_DRAWING_ID_BD_EXPANDING_WALL_LOOKS_LIKE); } if (properties_element == EL_BD_REPLICATOR) diff --git a/src/files.c b/src/files.c index 628f577e..4e70f9ef 100644 --- a/src/files.c +++ b/src/files.c @@ -812,6 +812,11 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] = TYPE_BOOLEAN, CONF_VALUE_8_BIT(1), &li.bd_change_expanding_wall, FALSE }, + { + EL_BD_EXPANDABLE_WALL_ANY, -1, + TYPE_ELEMENT, CONF_VALUE_16_BIT(1), + &li.bd_expanding_wall_looks_like, EL_BD_WALL + }, { EL_BD_REPLICATOR, -1, @@ -4203,6 +4208,8 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level) cave->skeletons_needed_for_pot = level->bd_num_skeletons_needed_for_pot; cave->skeletons_worth_diamonds = level->bd_skeleton_worth_num_diamonds; + cave->expanding_wall_looks_like = map_element_RND_to_BD_cave(level->bd_expanding_wall_looks_like); + // level name strncpy(cave->name, level->name, sizeof(GdString)); cave->name[sizeof(GdString) - 1] = '\0'; @@ -4336,6 +4343,8 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level) level->bd_num_skeletons_needed_for_pot= cave->skeletons_needed_for_pot; level->bd_skeleton_worth_num_diamonds = cave->skeletons_worth_diamonds; + level->bd_expanding_wall_looks_like = map_element_BD_to_RND_cave(cave->expanding_wall_looks_like); + // level name char *cave_name = getStringPrint("%s / %d", cave->name, bd_level_nr + 1); diff --git a/src/main.h b/src/main.h index 61ced845..6ec00ec1 100644 --- a/src/main.h +++ b/src/main.h @@ -913,8 +913,9 @@ #define IS_BD_EXPANDABLE_WALL(e) ((e) == EL_BD_EXPANDABLE_WALL_HORIZONTAL || \ (e) == EL_BD_EXPANDABLE_WALL_VERTICAL || \ - (e) == EL_BD_EXPANDABLE_WALL_ANY || \ - (e) == EL_BD_EXPANDABLE_STEELWALL_HORIZONTAL ||\ + (e) == EL_BD_EXPANDABLE_WALL_ANY) + +#define IS_BD_EXPANDABLE_STEELWALL(e) ((e) == EL_BD_EXPANDABLE_STEELWALL_HORIZONTAL ||\ (e) == EL_BD_EXPANDABLE_STEELWALL_VERTICAL || \ (e) == EL_BD_EXPANDABLE_STEELWALL_ANY) @@ -3681,6 +3682,7 @@ struct LevelInfo int bd_hammer_walls_reappear_delay; // BD hammer time for reappearing walls (in BD frames) int bd_num_skeletons_needed_for_pot; // BD skeletons amount must be collected to use a pot int bd_skeleton_worth_num_diamonds; // BD skeleton collected is worth this number of diamonds + int bd_expanding_wall_looks_like; // BD expanding wall looks like this other game element boolean em_slippery_gems; // EM style "gems slip from wall" behaviour boolean em_explodes_by_fire; // EM style chain explosion behaviour