From: Holger Schemel Date: Fri, 22 Mar 2024 10:14:32 +0000 (+0100) Subject: added support for water settings in BD engine to level editor X-Git-Tag: 4.4.0.0-test-1~165 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=aa7bc38aa03e7b7cfbe96175a96c7b97922003bd;p=rocksndiamonds.git added support for water settings in BD engine to level editor --- diff --git a/src/editor.c b/src/editor.c index 25853f86..fd5d5463 100644 --- a/src/editor.c +++ b/src/editor.c @@ -733,6 +733,7 @@ enum GADGET_ID_BD_REPLICATORS_ACTIVE, GADGET_ID_BD_CONVEYOR_BELTS_ACTIVE, GADGET_ID_BD_CONVEYOR_BELTS_CHANGED, + GADGET_ID_BD_WATER_CANNOT_FLOW_DOWN, GADGET_ID_ENVELOPE_AUTOWRAP, GADGET_ID_ENVELOPE_CENTERED, GADGET_ID_MM_LASER_RED, @@ -1082,6 +1083,7 @@ enum ED_CHECKBUTTON_ID_BD_REPLICATORS_ACTIVE, ED_CHECKBUTTON_ID_BD_CONVEYOR_BELTS_ACTIVE, ED_CHECKBUTTON_ID_BD_CONVEYOR_BELTS_CHANGED, + ED_CHECKBUTTON_ID_BD_WATER_CANNOT_FLOW_DOWN, ED_CHECKBUTTON_ID_ENVELOPE_AUTOWRAP, ED_CHECKBUTTON_ID_ENVELOPE_CENTERED, ED_CHECKBUTTON_ID_MM_LASER_RED, @@ -3850,6 +3852,14 @@ static struct NULL, NULL, "Change direction", "Switch conveyor belt direction" }, + { + ED_CHECKBUTTON_ID_BD_WATER_CANNOT_FLOW_DOWN, + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(0), + GADGET_ID_BD_WATER_CANNOT_FLOW_DOWN, GADGET_ID_NONE, + &level.bd_water_cannot_flow_down, + NULL, NULL, + "Does not flow downwards", "Water can only flow up, left and right" + }, { ED_CHECKBUTTON_ID_ENVELOPE_AUTOWRAP, ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1), @@ -11137,7 +11147,8 @@ static boolean checkPropertiesConfig(int element) element == EL_BD_ROCK || element == EL_BD_MEGA_ROCK || element == EL_BD_SWEET || - element == EL_BD_VOODOO_DOLL) + element == EL_BD_VOODOO_DOLL || + element == EL_BD_WATER) { return TRUE; } @@ -11504,6 +11515,11 @@ static void DrawPropertiesConfig(void) MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_CONVEYOR_BELTS_CHANGED); } + if (properties_element == EL_BD_WATER) + { + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_WATER_CANNOT_FLOW_DOWN); + } + // special case: slippery walls option for gems only available in R'n'D game engine if (IS_GEM(properties_element) && level.game_engine_type == GAME_ENGINE_TYPE_RND) MapCheckbuttonGadget(ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS); diff --git a/src/files.c b/src/files.c index a164fdfd..3e6d25f3 100644 --- a/src/files.c +++ b/src/files.c @@ -770,6 +770,12 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] = &li.bd_conveyor_belts_changed, FALSE }, + { + EL_BD_WATER, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(1), + &li.bd_water_cannot_flow_down, FALSE + }, + // (the following values are related to various game elements) { @@ -4073,6 +4079,8 @@ static void CopyNativeLevel_RND_to_BD(struct LevelInfo *level) cave->conveyor_belts_active = level->bd_conveyor_belts_active; cave->conveyor_belts_direction_changed= level->bd_conveyor_belts_changed; + cave->water_does_not_flow_down = level->bd_water_cannot_flow_down; + // level name strncpy(cave->name, level->name, sizeof(GdString)); cave->name[sizeof(GdString) - 1] = '\0'; @@ -4180,6 +4188,8 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level) level->bd_conveyor_belts_active = cave->conveyor_belts_active; level->bd_conveyor_belts_changed = cave->conveyor_belts_direction_changed; + level->bd_water_cannot_flow_down = cave->water_does_not_flow_down; + // 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 f18bfb1d..5a85ae28 100644 --- a/src/main.h +++ b/src/main.h @@ -3562,6 +3562,7 @@ struct LevelInfo int bd_replicator_create_delay; // BD replicator delay between replications (in BD frames) boolean bd_conveyor_belts_active; // BD conveyor belts start in active state if enabled boolean bd_conveyor_belts_changed; // BD conveyor belts direction is changed if enabled + boolean bd_water_cannot_flow_down; // BD water does not flow downwards if enabled boolean em_slippery_gems; // EM style "gems slip from wall" behaviour boolean em_explodes_by_fire; // EM style chain explosion behaviour