X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Feditor.c;h=d05a5d72f93b6159108787dec92f9f0b984ba037;hb=21597f245598c0c30506c53448c1a549beeb3722;hp=a544dfa11e59103b0da0ce89b225138d5d21c808;hpb=a5e9fc02d650da0520fc4994ba5780c27e4f3569;p=rocksndiamonds.git diff --git a/src/editor.c b/src/editor.c index a544dfa1..d05a5d72 100644 --- a/src/editor.c +++ b/src/editor.c @@ -151,6 +151,12 @@ #define ED_AREA_YAMYAM_CONTENT_YPOS(n) (17 * MINI_TILEY + \ 6 * ((n) / 4) * MINI_TILEY) +/* magic ball content */ +#define ED_AREA_MAGIC_BALL_CONTENT_XPOS(n) (2 * MINI_TILEX + \ + 5 * ((n) % 4) * MINI_TILEX) +#define ED_AREA_MAGIC_BALL_CONTENT_YPOS(n) (17 * MINI_TILEY + \ + 6 * ((n) / 4) * MINI_TILEY) + /* values for scrolling gadgets for drawing area */ #define ED_SCROLLBUTTON_XPOS 24 #define ED_SCROLLBUTTON_YPOS 0 @@ -334,86 +340,97 @@ #define GADGET_ID_LEVEL_TIMESCORE_DOWN (GADGET_ID_COUNTER_FIRST + 18) #define GADGET_ID_LEVEL_TIMESCORE_TEXT (GADGET_ID_COUNTER_FIRST + 19) #define GADGET_ID_LEVEL_TIMESCORE_UP (GADGET_ID_COUNTER_FIRST + 20) -#define GADGET_ID_ELEMENT_SCORE_DOWN (GADGET_ID_COUNTER_FIRST + 21) -#define GADGET_ID_ELEMENT_SCORE_TEXT (GADGET_ID_COUNTER_FIRST + 22) -#define GADGET_ID_ELEMENT_SCORE_UP (GADGET_ID_COUNTER_FIRST + 23) -#define GADGET_ID_ELEMENT_CONTENT_DOWN (GADGET_ID_COUNTER_FIRST + 24) -#define GADGET_ID_ELEMENT_CONTENT_TEXT (GADGET_ID_COUNTER_FIRST + 25) -#define GADGET_ID_ELEMENT_CONTENT_UP (GADGET_ID_COUNTER_FIRST + 26) -#define GADGET_ID_ENVELOPE_XSIZE_DOWN (GADGET_ID_COUNTER_FIRST + 27) -#define GADGET_ID_ENVELOPE_XSIZE_TEXT (GADGET_ID_COUNTER_FIRST + 28) -#define GADGET_ID_ENVELOPE_XSIZE_UP (GADGET_ID_COUNTER_FIRST + 29) -#define GADGET_ID_ENVELOPE_YSIZE_DOWN (GADGET_ID_COUNTER_FIRST + 30) -#define GADGET_ID_ENVELOPE_YSIZE_TEXT (GADGET_ID_COUNTER_FIRST + 31) -#define GADGET_ID_ENVELOPE_YSIZE_UP (GADGET_ID_COUNTER_FIRST + 32) -#define GADGET_ID_CUSTOM_SCORE_DOWN (GADGET_ID_COUNTER_FIRST + 33) -#define GADGET_ID_CUSTOM_SCORE_TEXT (GADGET_ID_COUNTER_FIRST + 34) -#define GADGET_ID_CUSTOM_SCORE_UP (GADGET_ID_COUNTER_FIRST + 35) -#define GADGET_ID_CUSTOM_GEMCOUNT_DOWN (GADGET_ID_COUNTER_FIRST + 36) -#define GADGET_ID_CUSTOM_GEMCOUNT_TEXT (GADGET_ID_COUNTER_FIRST + 37) -#define GADGET_ID_CUSTOM_GEMCOUNT_UP (GADGET_ID_COUNTER_FIRST + 38) -#define GADGET_ID_PUSH_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 39) -#define GADGET_ID_PUSH_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 40) -#define GADGET_ID_PUSH_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 41) -#define GADGET_ID_PUSH_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 42) -#define GADGET_ID_PUSH_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 43) -#define GADGET_ID_PUSH_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 44) -#define GADGET_ID_DROP_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 45) -#define GADGET_ID_DROP_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 46) -#define GADGET_ID_DROP_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 47) -#define GADGET_ID_DROP_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 48) -#define GADGET_ID_DROP_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 49) -#define GADGET_ID_DROP_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 50) -#define GADGET_ID_MOVE_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 51) -#define GADGET_ID_MOVE_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 52) -#define GADGET_ID_MOVE_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 53) -#define GADGET_ID_MOVE_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 54) -#define GADGET_ID_MOVE_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 55) -#define GADGET_ID_MOVE_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 56) -#define GADGET_ID_EXPLOSION_DELAY_DOWN (GADGET_ID_COUNTER_FIRST + 57) -#define GADGET_ID_EXPLOSION_DELAY_TEXT (GADGET_ID_COUNTER_FIRST + 58) -#define GADGET_ID_EXPLOSION_DELAY_UP (GADGET_ID_COUNTER_FIRST + 59) -#define GADGET_ID_IGNITION_DELAY_DOWN (GADGET_ID_COUNTER_FIRST + 60) -#define GADGET_ID_IGNITION_DELAY_TEXT (GADGET_ID_COUNTER_FIRST + 61) -#define GADGET_ID_IGNITION_DELAY_UP (GADGET_ID_COUNTER_FIRST + 62) -#define GADGET_ID_CHANGE_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 63) -#define GADGET_ID_CHANGE_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 64) -#define GADGET_ID_CHANGE_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 65) -#define GADGET_ID_CHANGE_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 66) -#define GADGET_ID_CHANGE_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 67) -#define GADGET_ID_CHANGE_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 68) -#define GADGET_ID_CHANGE_CONT_RND_DOWN (GADGET_ID_COUNTER_FIRST + 69) -#define GADGET_ID_CHANGE_CONT_RND_TEXT (GADGET_ID_COUNTER_FIRST + 70) -#define GADGET_ID_CHANGE_CONT_RND_UP (GADGET_ID_COUNTER_FIRST + 71) -#define GADGET_ID_GROUP_CONTENT_DOWN (GADGET_ID_COUNTER_FIRST + 72) -#define GADGET_ID_GROUP_CONTENT_TEXT (GADGET_ID_COUNTER_FIRST + 73) -#define GADGET_ID_GROUP_CONTENT_UP (GADGET_ID_COUNTER_FIRST + 74) +#define GADGET_ID_ELEMENT_VALUE1_DOWN (GADGET_ID_COUNTER_FIRST + 21) +#define GADGET_ID_ELEMENT_VALUE1_TEXT (GADGET_ID_COUNTER_FIRST + 22) +#define GADGET_ID_ELEMENT_VALUE1_UP (GADGET_ID_COUNTER_FIRST + 23) +#define GADGET_ID_ELEMENT_VALUE2_DOWN (GADGET_ID_COUNTER_FIRST + 24) +#define GADGET_ID_ELEMENT_VALUE2_TEXT (GADGET_ID_COUNTER_FIRST + 25) +#define GADGET_ID_ELEMENT_VALUE2_UP (GADGET_ID_COUNTER_FIRST + 26) +#define GADGET_ID_YAMYAM_CONTENT_DOWN (GADGET_ID_COUNTER_FIRST + 27) +#define GADGET_ID_YAMYAM_CONTENT_TEXT (GADGET_ID_COUNTER_FIRST + 28) +#define GADGET_ID_YAMYAM_CONTENT_UP (GADGET_ID_COUNTER_FIRST + 29) +#define GADGET_ID_ENVELOPE_XSIZE_DOWN (GADGET_ID_COUNTER_FIRST + 30) +#define GADGET_ID_ENVELOPE_XSIZE_TEXT (GADGET_ID_COUNTER_FIRST + 31) +#define GADGET_ID_ENVELOPE_XSIZE_UP (GADGET_ID_COUNTER_FIRST + 32) +#define GADGET_ID_ENVELOPE_YSIZE_DOWN (GADGET_ID_COUNTER_FIRST + 33) +#define GADGET_ID_ENVELOPE_YSIZE_TEXT (GADGET_ID_COUNTER_FIRST + 34) +#define GADGET_ID_ENVELOPE_YSIZE_UP (GADGET_ID_COUNTER_FIRST + 35) +#define GADGET_ID_CUSTOM_SCORE_DOWN (GADGET_ID_COUNTER_FIRST + 36) +#define GADGET_ID_CUSTOM_SCORE_TEXT (GADGET_ID_COUNTER_FIRST + 37) +#define GADGET_ID_CUSTOM_SCORE_UP (GADGET_ID_COUNTER_FIRST + 38) +#define GADGET_ID_CUSTOM_GEMCOUNT_DOWN (GADGET_ID_COUNTER_FIRST + 39) +#define GADGET_ID_CUSTOM_GEMCOUNT_TEXT (GADGET_ID_COUNTER_FIRST + 40) +#define GADGET_ID_CUSTOM_GEMCOUNT_UP (GADGET_ID_COUNTER_FIRST + 41) +#define GADGET_ID_PUSH_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 42) +#define GADGET_ID_PUSH_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 43) +#define GADGET_ID_PUSH_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 44) +#define GADGET_ID_PUSH_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 45) +#define GADGET_ID_PUSH_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 46) +#define GADGET_ID_PUSH_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 47) +#define GADGET_ID_DROP_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 48) +#define GADGET_ID_DROP_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 49) +#define GADGET_ID_DROP_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 50) +#define GADGET_ID_DROP_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 51) +#define GADGET_ID_DROP_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 52) +#define GADGET_ID_DROP_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 53) +#define GADGET_ID_MOVE_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 54) +#define GADGET_ID_MOVE_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 55) +#define GADGET_ID_MOVE_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 56) +#define GADGET_ID_MOVE_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 57) +#define GADGET_ID_MOVE_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 58) +#define GADGET_ID_MOVE_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 59) +#define GADGET_ID_EXPLOSION_DELAY_DOWN (GADGET_ID_COUNTER_FIRST + 60) +#define GADGET_ID_EXPLOSION_DELAY_TEXT (GADGET_ID_COUNTER_FIRST + 61) +#define GADGET_ID_EXPLOSION_DELAY_UP (GADGET_ID_COUNTER_FIRST + 62) +#define GADGET_ID_IGNITION_DELAY_DOWN (GADGET_ID_COUNTER_FIRST + 63) +#define GADGET_ID_IGNITION_DELAY_TEXT (GADGET_ID_COUNTER_FIRST + 64) +#define GADGET_ID_IGNITION_DELAY_UP (GADGET_ID_COUNTER_FIRST + 65) +#define GADGET_ID_CHANGE_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 66) +#define GADGET_ID_CHANGE_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 67) +#define GADGET_ID_CHANGE_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 68) +#define GADGET_ID_CHANGE_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 69) +#define GADGET_ID_CHANGE_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 70) +#define GADGET_ID_CHANGE_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 71) +#define GADGET_ID_CHANGE_CONT_RND_DOWN (GADGET_ID_COUNTER_FIRST + 72) +#define GADGET_ID_CHANGE_CONT_RND_TEXT (GADGET_ID_COUNTER_FIRST + 73) +#define GADGET_ID_CHANGE_CONT_RND_UP (GADGET_ID_COUNTER_FIRST + 74) +#define GADGET_ID_GROUP_CONTENT_DOWN (GADGET_ID_COUNTER_FIRST + 75) +#define GADGET_ID_GROUP_CONTENT_TEXT (GADGET_ID_COUNTER_FIRST + 76) +#define GADGET_ID_GROUP_CONTENT_UP (GADGET_ID_COUNTER_FIRST + 77) /* drawing area identifiers */ -#define GADGET_ID_DRAWING_AREA_FIRST (GADGET_ID_COUNTER_FIRST + 75) +#define GADGET_ID_DRAWING_AREA_FIRST (GADGET_ID_COUNTER_FIRST + 78) #define GADGET_ID_DRAWING_LEVEL (GADGET_ID_DRAWING_AREA_FIRST + 0) -#define GADGET_ID_ELEMENT_CONTENT_0 (GADGET_ID_DRAWING_AREA_FIRST + 1) -#define GADGET_ID_ELEMENT_CONTENT_1 (GADGET_ID_DRAWING_AREA_FIRST + 2) -#define GADGET_ID_ELEMENT_CONTENT_2 (GADGET_ID_DRAWING_AREA_FIRST + 3) -#define GADGET_ID_ELEMENT_CONTENT_3 (GADGET_ID_DRAWING_AREA_FIRST + 4) -#define GADGET_ID_ELEMENT_CONTENT_4 (GADGET_ID_DRAWING_AREA_FIRST + 5) -#define GADGET_ID_ELEMENT_CONTENT_5 (GADGET_ID_DRAWING_AREA_FIRST + 6) -#define GADGET_ID_ELEMENT_CONTENT_6 (GADGET_ID_DRAWING_AREA_FIRST + 7) -#define GADGET_ID_ELEMENT_CONTENT_7 (GADGET_ID_DRAWING_AREA_FIRST + 8) -#define GADGET_ID_AMOEBA_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 9) -#define GADGET_ID_CUSTOM_GRAPHIC (GADGET_ID_DRAWING_AREA_FIRST + 10) -#define GADGET_ID_CUSTOM_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 11) -#define GADGET_ID_CUSTOM_MOVE_ENTER (GADGET_ID_DRAWING_AREA_FIRST + 12) -#define GADGET_ID_CUSTOM_MOVE_LEAVE (GADGET_ID_DRAWING_AREA_FIRST + 13) -#define GADGET_ID_CUSTOM_CHANGE_TARGET (GADGET_ID_DRAWING_AREA_FIRST + 14) -#define GADGET_ID_CUSTOM_CHANGE_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 15) -#define GADGET_ID_CUSTOM_CHANGE_TRIGGER (GADGET_ID_DRAWING_AREA_FIRST + 16) -#define GADGET_ID_GROUP_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 17) -#define GADGET_ID_RANDOM_BACKGROUND (GADGET_ID_DRAWING_AREA_FIRST + 18) +#define GADGET_ID_YAMYAM_CONTENT_0 (GADGET_ID_DRAWING_AREA_FIRST + 1) +#define GADGET_ID_YAMYAM_CONTENT_1 (GADGET_ID_DRAWING_AREA_FIRST + 2) +#define GADGET_ID_YAMYAM_CONTENT_2 (GADGET_ID_DRAWING_AREA_FIRST + 3) +#define GADGET_ID_YAMYAM_CONTENT_3 (GADGET_ID_DRAWING_AREA_FIRST + 4) +#define GADGET_ID_YAMYAM_CONTENT_4 (GADGET_ID_DRAWING_AREA_FIRST + 5) +#define GADGET_ID_YAMYAM_CONTENT_5 (GADGET_ID_DRAWING_AREA_FIRST + 6) +#define GADGET_ID_YAMYAM_CONTENT_6 (GADGET_ID_DRAWING_AREA_FIRST + 7) +#define GADGET_ID_YAMYAM_CONTENT_7 (GADGET_ID_DRAWING_AREA_FIRST + 8) +#define GADGET_ID_MAGIC_BALL_CONTENT_0 (GADGET_ID_DRAWING_AREA_FIRST + 9) +#define GADGET_ID_MAGIC_BALL_CONTENT_1 (GADGET_ID_DRAWING_AREA_FIRST + 10) +#define GADGET_ID_MAGIC_BALL_CONTENT_2 (GADGET_ID_DRAWING_AREA_FIRST + 11) +#define GADGET_ID_MAGIC_BALL_CONTENT_3 (GADGET_ID_DRAWING_AREA_FIRST + 12) +#define GADGET_ID_MAGIC_BALL_CONTENT_4 (GADGET_ID_DRAWING_AREA_FIRST + 13) +#define GADGET_ID_MAGIC_BALL_CONTENT_5 (GADGET_ID_DRAWING_AREA_FIRST + 14) +#define GADGET_ID_MAGIC_BALL_CONTENT_6 (GADGET_ID_DRAWING_AREA_FIRST + 15) +#define GADGET_ID_MAGIC_BALL_CONTENT_7 (GADGET_ID_DRAWING_AREA_FIRST + 16) +#define GADGET_ID_AMOEBA_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 17) +#define GADGET_ID_CUSTOM_GRAPHIC (GADGET_ID_DRAWING_AREA_FIRST + 18) +#define GADGET_ID_CUSTOM_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 19) +#define GADGET_ID_CUSTOM_MOVE_ENTER (GADGET_ID_DRAWING_AREA_FIRST + 20) +#define GADGET_ID_CUSTOM_MOVE_LEAVE (GADGET_ID_DRAWING_AREA_FIRST + 21) +#define GADGET_ID_CUSTOM_CHANGE_TARGET (GADGET_ID_DRAWING_AREA_FIRST + 22) +#define GADGET_ID_CUSTOM_CHANGE_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 23) +#define GADGET_ID_CUSTOM_CHANGE_TRIGGER (GADGET_ID_DRAWING_AREA_FIRST + 24) +#define GADGET_ID_GROUP_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 25) +#define GADGET_ID_RANDOM_BACKGROUND (GADGET_ID_DRAWING_AREA_FIRST + 26) /* text input identifiers */ -#define GADGET_ID_TEXT_INPUT_FIRST (GADGET_ID_DRAWING_AREA_FIRST + 19) +#define GADGET_ID_TEXT_INPUT_FIRST (GADGET_ID_DRAWING_AREA_FIRST + 27) #define GADGET_ID_LEVEL_NAME (GADGET_ID_TEXT_INPUT_FIRST + 0) #define GADGET_ID_LEVEL_AUTHOR (GADGET_ID_TEXT_INPUT_FIRST + 1) @@ -428,31 +445,32 @@ #define GADGET_ID_SELECTBOX_FIRST (GADGET_ID_TEXT_AREA_FIRST + 1) #define GADGET_ID_TIME_OR_STEPS (GADGET_ID_SELECTBOX_FIRST + 0) -#define GADGET_ID_CUSTOM_WALK_TO_ACTION (GADGET_ID_SELECTBOX_FIRST + 1) -#define GADGET_ID_CUSTOM_EXPLOSION_TYPE (GADGET_ID_SELECTBOX_FIRST + 2) -#define GADGET_ID_CUSTOM_DEADLINESS (GADGET_ID_SELECTBOX_FIRST + 3) -#define GADGET_ID_CUSTOM_MOVE_PATTERN (GADGET_ID_SELECTBOX_FIRST + 4) -#define GADGET_ID_CUSTOM_MOVE_DIRECTION (GADGET_ID_SELECTBOX_FIRST + 5) -#define GADGET_ID_CUSTOM_MOVE_STEPSIZE (GADGET_ID_SELECTBOX_FIRST + 6) -#define GADGET_ID_CUSTOM_MOVE_LEAVE_TYPE (GADGET_ID_SELECTBOX_FIRST + 7) -#define GADGET_ID_CUSTOM_SMASH_TARGETS (GADGET_ID_SELECTBOX_FIRST + 8) -#define GADGET_ID_CUSTOM_SLIPPERY_TYPE (GADGET_ID_SELECTBOX_FIRST + 9) -#define GADGET_ID_CUSTOM_ACCESS_TYPE (GADGET_ID_SELECTBOX_FIRST + 10) -#define GADGET_ID_CUSTOM_ACCESS_LAYER (GADGET_ID_SELECTBOX_FIRST + 11) -#define GADGET_ID_CUSTOM_ACCESS_PROTECTED (GADGET_ID_SELECTBOX_FIRST + 12) -#define GADGET_ID_CUSTOM_ACCESS_DIRECTION (GADGET_ID_SELECTBOX_FIRST + 13) -#define GADGET_ID_CHANGE_TIME_UNITS (GADGET_ID_SELECTBOX_FIRST + 14) -#define GADGET_ID_CHANGE_DIRECT_ACTION (GADGET_ID_SELECTBOX_FIRST + 15) -#define GADGET_ID_CHANGE_OTHER_ACTION (GADGET_ID_SELECTBOX_FIRST + 16) -#define GADGET_ID_CHANGE_SIDE (GADGET_ID_SELECTBOX_FIRST + 17) -#define GADGET_ID_CHANGE_PLAYER (GADGET_ID_SELECTBOX_FIRST + 18) -#define GADGET_ID_CHANGE_PAGE (GADGET_ID_SELECTBOX_FIRST + 19) -#define GADGET_ID_CHANGE_REPLACE_WHEN (GADGET_ID_SELECTBOX_FIRST + 20) -#define GADGET_ID_SELECT_CHANGE_PAGE (GADGET_ID_SELECTBOX_FIRST + 21) -#define GADGET_ID_GROUP_CHOICE_MODE (GADGET_ID_SELECTBOX_FIRST + 22) +#define GADGET_ID_GAME_ENGINE_TYPE (GADGET_ID_SELECTBOX_FIRST + 1) +#define GADGET_ID_CUSTOM_WALK_TO_ACTION (GADGET_ID_SELECTBOX_FIRST + 2) +#define GADGET_ID_CUSTOM_EXPLOSION_TYPE (GADGET_ID_SELECTBOX_FIRST + 3) +#define GADGET_ID_CUSTOM_DEADLINESS (GADGET_ID_SELECTBOX_FIRST + 4) +#define GADGET_ID_CUSTOM_MOVE_PATTERN (GADGET_ID_SELECTBOX_FIRST + 5) +#define GADGET_ID_CUSTOM_MOVE_DIRECTION (GADGET_ID_SELECTBOX_FIRST + 6) +#define GADGET_ID_CUSTOM_MOVE_STEPSIZE (GADGET_ID_SELECTBOX_FIRST + 7) +#define GADGET_ID_CUSTOM_MOVE_LEAVE_TYPE (GADGET_ID_SELECTBOX_FIRST + 8) +#define GADGET_ID_CUSTOM_SMASH_TARGETS (GADGET_ID_SELECTBOX_FIRST + 9) +#define GADGET_ID_CUSTOM_SLIPPERY_TYPE (GADGET_ID_SELECTBOX_FIRST + 10) +#define GADGET_ID_CUSTOM_ACCESS_TYPE (GADGET_ID_SELECTBOX_FIRST + 11) +#define GADGET_ID_CUSTOM_ACCESS_LAYER (GADGET_ID_SELECTBOX_FIRST + 12) +#define GADGET_ID_CUSTOM_ACCESS_PROTECTED (GADGET_ID_SELECTBOX_FIRST + 13) +#define GADGET_ID_CUSTOM_ACCESS_DIRECTION (GADGET_ID_SELECTBOX_FIRST + 14) +#define GADGET_ID_CHANGE_TIME_UNITS (GADGET_ID_SELECTBOX_FIRST + 15) +#define GADGET_ID_CHANGE_DIRECT_ACTION (GADGET_ID_SELECTBOX_FIRST + 16) +#define GADGET_ID_CHANGE_OTHER_ACTION (GADGET_ID_SELECTBOX_FIRST + 17) +#define GADGET_ID_CHANGE_SIDE (GADGET_ID_SELECTBOX_FIRST + 18) +#define GADGET_ID_CHANGE_PLAYER (GADGET_ID_SELECTBOX_FIRST + 19) +#define GADGET_ID_CHANGE_PAGE (GADGET_ID_SELECTBOX_FIRST + 20) +#define GADGET_ID_CHANGE_REPLACE_WHEN (GADGET_ID_SELECTBOX_FIRST + 21) +#define GADGET_ID_SELECT_CHANGE_PAGE (GADGET_ID_SELECTBOX_FIRST + 22) +#define GADGET_ID_GROUP_CHOICE_MODE (GADGET_ID_SELECTBOX_FIRST + 23) /* textbutton identifiers */ -#define GADGET_ID_TEXTBUTTON_FIRST (GADGET_ID_SELECTBOX_FIRST + 23) +#define GADGET_ID_TEXTBUTTON_FIRST (GADGET_ID_SELECTBOX_FIRST + 24) #define GADGET_ID_PROPERTIES_INFO (GADGET_ID_TEXTBUTTON_FIRST + 0) #define GADGET_ID_PROPERTIES_CONFIG (GADGET_ID_TEXTBUTTON_FIRST + 1) @@ -551,26 +569,27 @@ #define ED_COUNTER_ID_LEVEL_TIMELIMIT 4 #define ED_COUNTER_ID_LEVEL_TIMESCORE 5 #define ED_COUNTER_ID_LEVEL_RANDOM 6 -#define ED_COUNTER_ID_ELEMENT_SCORE 7 -#define ED_COUNTER_ID_ELEMENT_CONTENT 8 -#define ED_COUNTER_ID_ENVELOPE_XSIZE 9 -#define ED_COUNTER_ID_ENVELOPE_YSIZE 10 -#define ED_COUNTER_ID_CUSTOM_SCORE 11 -#define ED_COUNTER_ID_CUSTOM_GEMCOUNT 12 -#define ED_COUNTER_ID_PUSH_DELAY_FIX 13 -#define ED_COUNTER_ID_PUSH_DELAY_RND 14 -#define ED_COUNTER_ID_DROP_DELAY_FIX 15 -#define ED_COUNTER_ID_DROP_DELAY_RND 16 -#define ED_COUNTER_ID_MOVE_DELAY_FIX 17 -#define ED_COUNTER_ID_MOVE_DELAY_RND 18 -#define ED_COUNTER_ID_EXPLOSION_DELAY 19 -#define ED_COUNTER_ID_IGNITION_DELAY 20 -#define ED_COUNTER_ID_GROUP_CONTENT 21 -#define ED_COUNTER_ID_CHANGE_DELAY_FIX 22 -#define ED_COUNTER_ID_CHANGE_DELAY_RND 23 -#define ED_COUNTER_ID_CHANGE_CONT_RND 24 - -#define ED_NUM_COUNTERBUTTONS 25 +#define ED_COUNTER_ID_ELEMENT_VALUE1 7 +#define ED_COUNTER_ID_ELEMENT_VALUE2 8 +#define ED_COUNTER_ID_YAMYAM_CONTENT 9 +#define ED_COUNTER_ID_ENVELOPE_XSIZE 10 +#define ED_COUNTER_ID_ENVELOPE_YSIZE 11 +#define ED_COUNTER_ID_CUSTOM_SCORE 12 +#define ED_COUNTER_ID_CUSTOM_GEMCOUNT 13 +#define ED_COUNTER_ID_PUSH_DELAY_FIX 14 +#define ED_COUNTER_ID_PUSH_DELAY_RND 15 +#define ED_COUNTER_ID_DROP_DELAY_FIX 16 +#define ED_COUNTER_ID_DROP_DELAY_RND 17 +#define ED_COUNTER_ID_MOVE_DELAY_FIX 18 +#define ED_COUNTER_ID_MOVE_DELAY_RND 19 +#define ED_COUNTER_ID_EXPLOSION_DELAY 20 +#define ED_COUNTER_ID_IGNITION_DELAY 21 +#define ED_COUNTER_ID_GROUP_CONTENT 22 +#define ED_COUNTER_ID_CHANGE_DELAY_FIX 23 +#define ED_COUNTER_ID_CHANGE_DELAY_RND 24 +#define ED_COUNTER_ID_CHANGE_CONT_RND 25 + +#define ED_NUM_COUNTERBUTTONS 26 #define ED_COUNTER_ID_LEVEL_FIRST ED_COUNTER_ID_LEVEL_XSIZE #define ED_COUNTER_ID_LEVEL_LAST ED_COUNTER_ID_LEVEL_RANDOM @@ -628,33 +647,34 @@ /* values for selectbox gadgets */ #define ED_SELECTBOX_ID_TIME_OR_STEPS 0 -#define ED_SELECTBOX_ID_CUSTOM_ACCESS_TYPE 1 -#define ED_SELECTBOX_ID_CUSTOM_ACCESS_LAYER 2 -#define ED_SELECTBOX_ID_CUSTOM_ACCESS_PROTECTED 3 -#define ED_SELECTBOX_ID_CUSTOM_ACCESS_DIRECTION 4 -#define ED_SELECTBOX_ID_CUSTOM_WALK_TO_ACTION 5 -#define ED_SELECTBOX_ID_CUSTOM_MOVE_PATTERN 6 -#define ED_SELECTBOX_ID_CUSTOM_MOVE_DIRECTION 7 -#define ED_SELECTBOX_ID_CUSTOM_MOVE_STEPSIZE 8 -#define ED_SELECTBOX_ID_CUSTOM_MOVE_LEAVE_TYPE 9 -#define ED_SELECTBOX_ID_CUSTOM_SMASH_TARGETS 10 -#define ED_SELECTBOX_ID_CUSTOM_SLIPPERY_TYPE 11 -#define ED_SELECTBOX_ID_CUSTOM_DEADLINESS 12 -#define ED_SELECTBOX_ID_CUSTOM_EXPLOSION_TYPE 13 -#define ED_SELECTBOX_ID_CHANGE_TIME_UNITS 14 -#define ED_SELECTBOX_ID_CHANGE_DIRECT_ACTION 15 -#define ED_SELECTBOX_ID_CHANGE_OTHER_ACTION 16 -#define ED_SELECTBOX_ID_CHANGE_SIDE 17 -#define ED_SELECTBOX_ID_CHANGE_PLAYER 18 -#define ED_SELECTBOX_ID_CHANGE_PAGE 19 -#define ED_SELECTBOX_ID_CHANGE_REPLACE_WHEN 20 -#define ED_SELECTBOX_ID_SELECT_CHANGE_PAGE 21 -#define ED_SELECTBOX_ID_GROUP_CHOICE_MODE 22 - -#define ED_NUM_SELECTBOX 23 +#define ED_SELECTBOX_ID_GAME_ENGINE_TYPE 1 +#define ED_SELECTBOX_ID_CUSTOM_ACCESS_TYPE 2 +#define ED_SELECTBOX_ID_CUSTOM_ACCESS_LAYER 3 +#define ED_SELECTBOX_ID_CUSTOM_ACCESS_PROTECTED 4 +#define ED_SELECTBOX_ID_CUSTOM_ACCESS_DIRECTION 5 +#define ED_SELECTBOX_ID_CUSTOM_WALK_TO_ACTION 6 +#define ED_SELECTBOX_ID_CUSTOM_MOVE_PATTERN 7 +#define ED_SELECTBOX_ID_CUSTOM_MOVE_DIRECTION 8 +#define ED_SELECTBOX_ID_CUSTOM_MOVE_STEPSIZE 9 +#define ED_SELECTBOX_ID_CUSTOM_MOVE_LEAVE_TYPE 10 +#define ED_SELECTBOX_ID_CUSTOM_SMASH_TARGETS 11 +#define ED_SELECTBOX_ID_CUSTOM_SLIPPERY_TYPE 12 +#define ED_SELECTBOX_ID_CUSTOM_DEADLINESS 13 +#define ED_SELECTBOX_ID_CUSTOM_EXPLOSION_TYPE 14 +#define ED_SELECTBOX_ID_CHANGE_TIME_UNITS 15 +#define ED_SELECTBOX_ID_CHANGE_DIRECT_ACTION 16 +#define ED_SELECTBOX_ID_CHANGE_OTHER_ACTION 17 +#define ED_SELECTBOX_ID_CHANGE_SIDE 18 +#define ED_SELECTBOX_ID_CHANGE_PLAYER 19 +#define ED_SELECTBOX_ID_CHANGE_PAGE 20 +#define ED_SELECTBOX_ID_CHANGE_REPLACE_WHEN 21 +#define ED_SELECTBOX_ID_SELECT_CHANGE_PAGE 22 +#define ED_SELECTBOX_ID_GROUP_CHOICE_MODE 23 + +#define ED_NUM_SELECTBOX 24 #define ED_SELECTBOX_ID_LEVEL_FIRST ED_SELECTBOX_ID_TIME_OR_STEPS -#define ED_SELECTBOX_ID_LEVEL_LAST ED_SELECTBOX_ID_TIME_OR_STEPS +#define ED_SELECTBOX_ID_LEVEL_LAST ED_SELECTBOX_ID_GAME_ENGINE_TYPE #define ED_SELECTBOX_ID_CUSTOM1_FIRST ED_SELECTBOX_ID_CUSTOM_ACCESS_TYPE #define ED_SELECTBOX_ID_CUSTOM1_LAST ED_SELECTBOX_ID_CUSTOM_WALK_TO_ACTION @@ -760,26 +780,34 @@ /* values for drawing area gadgets */ #define ED_DRAWING_ID_DRAWING_LEVEL 0 -#define ED_DRAWING_ID_ELEMENT_CONTENT_0 1 -#define ED_DRAWING_ID_ELEMENT_CONTENT_1 2 -#define ED_DRAWING_ID_ELEMENT_CONTENT_2 3 -#define ED_DRAWING_ID_ELEMENT_CONTENT_3 4 -#define ED_DRAWING_ID_ELEMENT_CONTENT_4 5 -#define ED_DRAWING_ID_ELEMENT_CONTENT_5 6 -#define ED_DRAWING_ID_ELEMENT_CONTENT_6 7 -#define ED_DRAWING_ID_ELEMENT_CONTENT_7 8 -#define ED_DRAWING_ID_AMOEBA_CONTENT 9 -#define ED_DRAWING_ID_CUSTOM_GRAPHIC 10 -#define ED_DRAWING_ID_CUSTOM_CONTENT 11 -#define ED_DRAWING_ID_CUSTOM_MOVE_ENTER 12 -#define ED_DRAWING_ID_CUSTOM_MOVE_LEAVE 13 -#define ED_DRAWING_ID_CUSTOM_CHANGE_TARGET 14 -#define ED_DRAWING_ID_CUSTOM_CHANGE_CONTENT 15 -#define ED_DRAWING_ID_CUSTOM_CHANGE_TRIGGER 16 -#define ED_DRAWING_ID_GROUP_CONTENT 17 -#define ED_DRAWING_ID_RANDOM_BACKGROUND 18 - -#define ED_NUM_DRAWING_AREAS 19 +#define ED_DRAWING_ID_YAMYAM_CONTENT_0 1 +#define ED_DRAWING_ID_YAMYAM_CONTENT_1 2 +#define ED_DRAWING_ID_YAMYAM_CONTENT_2 3 +#define ED_DRAWING_ID_YAMYAM_CONTENT_3 4 +#define ED_DRAWING_ID_YAMYAM_CONTENT_4 5 +#define ED_DRAWING_ID_YAMYAM_CONTENT_5 6 +#define ED_DRAWING_ID_YAMYAM_CONTENT_6 7 +#define ED_DRAWING_ID_YAMYAM_CONTENT_7 8 +#define ED_DRAWING_ID_MAGIC_BALL_CONTENT_0 9 +#define ED_DRAWING_ID_MAGIC_BALL_CONTENT_1 10 +#define ED_DRAWING_ID_MAGIC_BALL_CONTENT_2 11 +#define ED_DRAWING_ID_MAGIC_BALL_CONTENT_3 12 +#define ED_DRAWING_ID_MAGIC_BALL_CONTENT_4 13 +#define ED_DRAWING_ID_MAGIC_BALL_CONTENT_5 14 +#define ED_DRAWING_ID_MAGIC_BALL_CONTENT_6 15 +#define ED_DRAWING_ID_MAGIC_BALL_CONTENT_7 16 +#define ED_DRAWING_ID_AMOEBA_CONTENT 17 +#define ED_DRAWING_ID_CUSTOM_GRAPHIC 18 +#define ED_DRAWING_ID_CUSTOM_CONTENT 19 +#define ED_DRAWING_ID_CUSTOM_MOVE_ENTER 20 +#define ED_DRAWING_ID_CUSTOM_MOVE_LEAVE 21 +#define ED_DRAWING_ID_CUSTOM_CHANGE_TARGET 22 +#define ED_DRAWING_ID_CUSTOM_CHANGE_CONTENT 23 +#define ED_DRAWING_ID_CUSTOM_CHANGE_TRIGGER 24 +#define ED_DRAWING_ID_GROUP_CONTENT 25 +#define ED_DRAWING_ID_RANDOM_BACKGROUND 26 + +#define ED_NUM_DRAWING_AREAS 27 /* @@ -961,16 +989,24 @@ static struct { ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(0), MIN_SCORE, MAX_SCORE, - GADGET_ID_ELEMENT_SCORE_DOWN, GADGET_ID_ELEMENT_SCORE_UP, - GADGET_ID_ELEMENT_SCORE_TEXT, GADGET_ID_NONE, + GADGET_ID_ELEMENT_VALUE1_DOWN, GADGET_ID_ELEMENT_VALUE1_UP, + GADGET_ID_ELEMENT_VALUE1_TEXT, GADGET_ID_NONE, + NULL, /* will be set when used */ + NULL, NULL, NULL + }, + { + ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(1), + MIN_SCORE, MAX_SCORE, + GADGET_ID_ELEMENT_VALUE2_DOWN, GADGET_ID_ELEMENT_VALUE2_UP, + GADGET_ID_ELEMENT_VALUE2_TEXT, GADGET_ID_NONE, NULL, /* will be set when used */ NULL, NULL, NULL }, { ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(3), MIN_ELEMENT_CONTENTS, MAX_ELEMENT_CONTENTS, - GADGET_ID_ELEMENT_CONTENT_DOWN, GADGET_ID_ELEMENT_CONTENT_UP, - GADGET_ID_ELEMENT_CONTENT_TEXT, GADGET_ID_NONE, + GADGET_ID_YAMYAM_CONTENT_DOWN, GADGET_ID_YAMYAM_CONTENT_UP, + GADGET_ID_YAMYAM_CONTENT_TEXT, GADGET_ID_NONE, &level.num_yamyam_contents, NULL, NULL, "number of content areas" }, @@ -1174,6 +1210,14 @@ static struct ValueTextInfo options_time_or_steps[] = { -1, NULL } }; +static struct ValueTextInfo options_game_engine_type[] = +{ + { GAME_ENGINE_TYPE_RND, "RND" }, + { GAME_ENGINE_TYPE_EM, "EM" }, + + { -1, NULL } +}; + static struct ValueTextInfo options_access_type[] = { { EP_WALKABLE, "walkable" }, @@ -1358,9 +1402,11 @@ static struct ValueTextInfo options_change_direct_action[] = #else { CE_HITTING_SOMETHING, "collision" }, #endif -#if 1 + +#if 0 { CE_BLOCKED, "blocked" }, #endif + { CE_IMPACT, "impact (on something)" }, { CE_SMASHED, "smashed (from above)" }, @@ -1502,6 +1548,14 @@ static struct &level.use_step_counter, NULL, "(0 => no limit)", "time or step limit" }, + { + ED_SETTINGS_XPOS(0), ED_COUNTER_YPOS(6) + 8, + GADGET_ID_GAME_ENGINE_TYPE, GADGET_ID_NONE, + -1, + options_game_engine_type, + &level.game_engine_type, + "game engine:", NULL, "game engine" + }, /* ---------- element settings: configure 1 (custom elements) ----------- */ @@ -2039,7 +2093,13 @@ static struct ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(1), GADGET_ID_CUSTOM_USE_GRAPHIC, GADGET_ID_NONE, &custom_element.use_gfx_element, + + /* !!! add separate "use existing element sound" !!! */ +#if 0 NULL, "use graphic/sound of element:", "use existing graphic and sound" +#else + NULL, "use graphic of element:", "use existing element graphic" +#endif }, { ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(2), @@ -2204,49 +2264,100 @@ static struct { ED_AREA_YAMYAM_CONTENT_XPOS(0), ED_AREA_YAMYAM_CONTENT_YPOS(0), 3, 3, - GADGET_ID_ELEMENT_CONTENT_0, GADGET_ID_NONE, + GADGET_ID_YAMYAM_CONTENT_0, GADGET_ID_NONE, NULL, NULL, "1" }, { ED_AREA_YAMYAM_CONTENT_XPOS(1), ED_AREA_YAMYAM_CONTENT_YPOS(1), 3, 3, - GADGET_ID_ELEMENT_CONTENT_1, GADGET_ID_NONE, + GADGET_ID_YAMYAM_CONTENT_1, GADGET_ID_NONE, NULL, NULL, "2" }, { ED_AREA_YAMYAM_CONTENT_XPOS(2), ED_AREA_YAMYAM_CONTENT_YPOS(2), 3, 3, - GADGET_ID_ELEMENT_CONTENT_2, GADGET_ID_NONE, + GADGET_ID_YAMYAM_CONTENT_2, GADGET_ID_NONE, NULL, NULL, "3" }, { ED_AREA_YAMYAM_CONTENT_XPOS(3), ED_AREA_YAMYAM_CONTENT_YPOS(3), 3, 3, - GADGET_ID_ELEMENT_CONTENT_3, GADGET_ID_NONE, + GADGET_ID_YAMYAM_CONTENT_3, GADGET_ID_NONE, NULL, NULL, "4" }, { ED_AREA_YAMYAM_CONTENT_XPOS(4), ED_AREA_YAMYAM_CONTENT_YPOS(4), 3, 3, - GADGET_ID_ELEMENT_CONTENT_4, GADGET_ID_NONE, + GADGET_ID_YAMYAM_CONTENT_4, GADGET_ID_NONE, NULL, NULL, "5" }, { ED_AREA_YAMYAM_CONTENT_XPOS(5), ED_AREA_YAMYAM_CONTENT_YPOS(5), 3, 3, - GADGET_ID_ELEMENT_CONTENT_5, GADGET_ID_NONE, + GADGET_ID_YAMYAM_CONTENT_5, GADGET_ID_NONE, NULL, NULL, "6" }, { ED_AREA_YAMYAM_CONTENT_XPOS(6), ED_AREA_YAMYAM_CONTENT_YPOS(6), 3, 3, - GADGET_ID_ELEMENT_CONTENT_6, GADGET_ID_NONE, + GADGET_ID_YAMYAM_CONTENT_6, GADGET_ID_NONE, NULL, NULL, "7" }, { ED_AREA_YAMYAM_CONTENT_XPOS(7), ED_AREA_YAMYAM_CONTENT_YPOS(7), 3, 3, - GADGET_ID_ELEMENT_CONTENT_7, GADGET_ID_NONE, + GADGET_ID_YAMYAM_CONTENT_7, GADGET_ID_NONE, + NULL, NULL, "8" + }, + + /* ---------- magic ball content ----------------------------------------- */ + + { + ED_AREA_MAGIC_BALL_CONTENT_XPOS(0), ED_AREA_MAGIC_BALL_CONTENT_YPOS(0), + 3, 3, + GADGET_ID_MAGIC_BALL_CONTENT_0, GADGET_ID_NONE, + NULL, NULL, "1" + }, + { + ED_AREA_MAGIC_BALL_CONTENT_XPOS(1), ED_AREA_MAGIC_BALL_CONTENT_YPOS(1), + 3, 3, + GADGET_ID_MAGIC_BALL_CONTENT_1, GADGET_ID_NONE, + NULL, NULL, "2" + }, + { + ED_AREA_MAGIC_BALL_CONTENT_XPOS(2), ED_AREA_MAGIC_BALL_CONTENT_YPOS(2), + 3, 3, + GADGET_ID_MAGIC_BALL_CONTENT_2, GADGET_ID_NONE, + NULL, NULL, "3" + }, + { + ED_AREA_MAGIC_BALL_CONTENT_XPOS(3), ED_AREA_MAGIC_BALL_CONTENT_YPOS(3), + 3, 3, + GADGET_ID_MAGIC_BALL_CONTENT_3, GADGET_ID_NONE, + NULL, NULL, "4" + }, + { + ED_AREA_MAGIC_BALL_CONTENT_XPOS(4), ED_AREA_MAGIC_BALL_CONTENT_YPOS(4), + 3, 3, + GADGET_ID_MAGIC_BALL_CONTENT_4, GADGET_ID_NONE, + NULL, NULL, "5" + }, + { + ED_AREA_MAGIC_BALL_CONTENT_XPOS(5), ED_AREA_MAGIC_BALL_CONTENT_YPOS(5), + 3, 3, + GADGET_ID_MAGIC_BALL_CONTENT_5, GADGET_ID_NONE, + NULL, NULL, "6" + }, + { + ED_AREA_MAGIC_BALL_CONTENT_XPOS(6), ED_AREA_MAGIC_BALL_CONTENT_YPOS(6), + 3, 3, + GADGET_ID_MAGIC_BALL_CONTENT_6, GADGET_ID_NONE, + NULL, NULL, "7" + }, + { + ED_AREA_MAGIC_BALL_CONTENT_XPOS(7), ED_AREA_MAGIC_BALL_CONTENT_YPOS(7), + 3, 3, + GADGET_ID_MAGIC_BALL_CONTENT_7, GADGET_ID_NONE, NULL, NULL, "8" }, @@ -2569,6 +2680,106 @@ static int *editor_el_emerald_mine_ptr = editor_el_emerald_mine; static int num_editor_hl_emerald_mine=SIZEOF_ARRAY_INT(editor_hl_emerald_mine); static int num_editor_el_emerald_mine=SIZEOF_ARRAY_INT(editor_el_emerald_mine); +static int editor_hl_emerald_mine_club[] = +{ + EL_CHAR('E'), + EL_CHAR('M'), + EL_CHAR('E'), + EL_CHAR('-'), + + EL_CHAR('R'), + EL_CHAR('A'), + EL_CHAR('L'), + EL_CHAR('D'), + + EL_CHAR('M'), + EL_CHAR('I'), + EL_CHAR('N'), + EL_CHAR('E'), + + EL_CHAR('C'), + EL_CHAR('L'), + EL_CHAR('U'), + EL_CHAR('B'), +}; + +static int editor_el_emerald_mine_club[] = +{ + EL_EM_KEY_5, + EL_EM_KEY_6, + EL_EM_KEY_7, + EL_EM_KEY_8, + + EL_EM_GATE_5, + EL_EM_GATE_6, + EL_EM_GATE_7, + EL_EM_GATE_8, + + EL_EM_GATE_5_GRAY, + EL_EM_GATE_6_GRAY, + EL_EM_GATE_7_GRAY, + EL_EM_GATE_8_GRAY, + + EL_EMC_STEELWALL_1, + EL_EMC_STEELWALL_2, + EL_EMC_STEELWALL_3, + EL_EMC_STEELWALL_4, + + EL_EMC_WALL_13, + EL_EMC_WALL_14, + EL_EMC_WALL_15, + EL_EMC_WALL_16, + + EL_EMC_WALL_SLIPPERY_1, + EL_EMC_WALL_SLIPPERY_2, + EL_EMC_WALL_SLIPPERY_3, + EL_EMC_WALL_SLIPPERY_4, + + EL_EMC_WALL_1, + EL_EMC_WALL_2, + EL_EMC_WALL_3, + EL_EMC_WALL_4, + + EL_EMC_WALL_5, + EL_EMC_WALL_6, + EL_EMC_WALL_7, + EL_EMC_WALL_8, + + EL_EMC_WALL_9, + EL_EMC_WALL_10, + EL_EMC_WALL_11, + EL_EMC_WALL_12, + + EL_EMC_ANDROID, + EL_BALLOON, + EL_BALLOON_SWITCH_ANY, + EL_BALLOON_SWITCH_NONE, + + EL_BALLOON_SWITCH_LEFT, + EL_BALLOON_SWITCH_RIGHT, + EL_BALLOON_SWITCH_UP, + EL_BALLOON_SWITCH_DOWN, + + EL_EMC_GRASS, + EL_EMC_PLANT, + EL_EMC_LENSES, + EL_EMC_MAGNIFIER, + + EL_EMC_MAGIC_BALL, + EL_EMC_MAGIC_BALL_SWITCH, + EL_SPRING, + EL_EMC_SPRING_BUMPER, + + EL_EMC_DRIPPER, + EL_EMPTY, + EL_EMPTY, + EL_EMPTY, +}; +static int *editor_hl_emerald_mine_club_ptr = editor_hl_emerald_mine_club; +static int *editor_el_emerald_mine_club_ptr = editor_el_emerald_mine_club; +static int num_editor_hl_emerald_mine_club=SIZEOF_ARRAY_INT(editor_hl_emerald_mine_club); +static int num_editor_el_emerald_mine_club=SIZEOF_ARRAY_INT(editor_el_emerald_mine_club); + static int editor_hl_more[] = { EL_CHAR('M'), @@ -2646,13 +2857,8 @@ static int editor_el_more[] = EL_SPACESHIP, EL_MOLE_DOWN, - EL_BALLOON, - EL_BALLOON_SWITCH_ANY, - - EL_BALLOON_SWITCH_LEFT, - EL_BALLOON_SWITCH_RIGHT, - EL_BALLOON_SWITCH_UP, - EL_BALLOON_SWITCH_DOWN, + EL_EMPTY, + EL_EMPTY, EL_SATELLITE, EL_EXPANDABLE_WALL_HORIZONTAL, @@ -2663,16 +2869,6 @@ static int editor_el_more[] = EL_INVISIBLE_WALL, EL_SPEED_PILL, EL_BLACK_ORB, - - EL_EMC_STEELWALL_1, - EL_EMC_WALL_1, - EL_EMC_WALL_2, - EL_EMC_WALL_3, - - EL_EMC_WALL_4, - EL_EMC_WALL_5, - EL_EMC_WALL_6, - EL_EMC_WALL_7, }; static int *editor_hl_more_ptr = editor_hl_more; static int *editor_el_more_ptr = editor_el_more; @@ -2898,7 +3094,7 @@ static int editor_hl_dx_boulderdash[] = static int editor_el_dx_boulderdash[] = { - EL_SPRING, + EL_EMPTY, EL_TUBE_RIGHT_DOWN, EL_TUBE_HORIZONTAL_DOWN, EL_TUBE_LEFT_DOWN, @@ -3546,6 +3742,11 @@ editor_elements_info[] = &editor_hl_emerald_mine_ptr, &num_editor_hl_emerald_mine, &editor_el_emerald_mine_ptr, &num_editor_el_emerald_mine }, + { + &setup.editor.el_emerald_mine_club, + &editor_hl_emerald_mine_club_ptr, &num_editor_hl_emerald_mine_club, + &editor_el_emerald_mine_club_ptr, &num_editor_el_emerald_mine_club + }, { &setup.editor.el_more, &editor_hl_more_ptr, &num_editor_hl_more, @@ -4081,10 +4282,10 @@ static void DrawDrawingArea(int id) for (x = 0; x < group_element_info.num_elements; x++) DrawMiniGraphicExt(drawto, gi->x + x * MINI_TILEX, gi->y, el2edimg(group_element_info.element[x])); - else if (id >= ED_DRAWING_ID_ELEMENT_CONTENT_0 && - id <= ED_DRAWING_ID_ELEMENT_CONTENT_7) + else if (id >= ED_DRAWING_ID_YAMYAM_CONTENT_0 && + id <= ED_DRAWING_ID_YAMYAM_CONTENT_7) { - int nr = id - ED_DRAWING_ID_ELEMENT_CONTENT_0; + int nr = id - ED_DRAWING_ID_YAMYAM_CONTENT_0; for (y = 0; y < 3; y++) for (x = 0; x < 3; x++) @@ -4092,6 +4293,17 @@ static void DrawDrawingArea(int id) gi->x + x * MINI_TILEX, gi->y + y * MINI_TILEY, el2edimg(level.yamyam_content[nr][x][y])); } + else if (id >= ED_DRAWING_ID_MAGIC_BALL_CONTENT_0 && + id <= ED_DRAWING_ID_MAGIC_BALL_CONTENT_7) + { + int nr = id - ED_DRAWING_ID_MAGIC_BALL_CONTENT_0; + + for (y = 0; y < 3; y++) + for (x = 0; x < 3; x++) + DrawMiniGraphicExt(drawto, + gi->x + x * MINI_TILEX, gi->y + y * MINI_TILEY, + el2edimg(level.ball_content[nr][x][y])); + } } static void ScrollMiniLevel(int from_x, int from_y, int scroll) @@ -5147,8 +5359,9 @@ static void MapCounterButtons(int id) int y; /* set after gadget position was modified */ #endif - /* set position for "score" counter gadget */ - if (id == ED_COUNTER_ID_ELEMENT_SCORE) + /* set position for "value1/value2" counter gadgets (score in most cases) */ + if (id == ED_COUNTER_ID_ELEMENT_VALUE1 || + id == ED_COUNTER_ID_ELEMENT_VALUE2) { ModifyGadget(gi_down, GDI_Y, SY + counterbutton_info[id].y, GDI_END); ModifyGadget(gi_text, GDI_Y, SY + counterbutton_info[id].y, GDI_END); @@ -5505,6 +5718,8 @@ static void ResetUndoBuffer() undo_buffer_position = -1; undo_buffer_steps = -1; CopyLevelToUndoBuffer(UNDO_IMMEDIATE); + + level.changed = FALSE; } static void DrawEditModeWindow() @@ -5522,15 +5737,18 @@ static void DrawEditModeWindow() static boolean LevelChanged() { - boolean level_changed = FALSE; + boolean field_changed = FALSE; int x, y; + if (leveldir_current->readonly) + return FALSE; + for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++) if (Feld[x][y] != level.field[x][y]) - level_changed = TRUE; + field_changed = TRUE; - return level_changed; + return (level.changed || field_changed); } static boolean LevelContainsPlayer() @@ -5538,6 +5756,8 @@ static boolean LevelContainsPlayer() boolean player_found = FALSE; int x, y; + return TRUE; /* !!! CURRENTLY DEACTIVATED !!! */ + for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++) if (Feld[x][y] == EL_PLAYER_1 || @@ -5651,6 +5871,7 @@ static void copy_custom_element_settings(int element_from, int element_to) for (x = 0; x < 3; x++) ei_to->content[x][y] = ei_from->content[x][y]; + ei_to->explosion_type = ei_from->explosion_type; ei_to->explosion_delay = ei_from->explosion_delay; ei_to->ignition_delay = ei_from->ignition_delay; @@ -5736,6 +5957,8 @@ static boolean CopyCustomElement(int element_old, int element_new, element_old = (IS_CUSTOM_ELEMENT(element_new) ? EL_INTERNAL_CLIPBOARD_CUSTOM : EL_INTERNAL_CLIPBOARD_GROUP); copy_mode = GADGET_ID_CUSTOM_COPY_TO; + + level.changed = TRUE; } else if (IS_CUSTOM_ELEMENT(element_old) && !IS_CUSTOM_ELEMENT(element_new)) { @@ -5749,6 +5972,10 @@ static boolean CopyCustomElement(int element_old, int element_new, return FALSE; } + else + { + level.changed = TRUE; + } if (copy_mode == GADGET_ID_CUSTOM_COPY_FROM) { @@ -5994,6 +6221,7 @@ static void CopyCustomElementPropertiesToGame(int element) /* mark that this custom element has been modified */ custom_element.modified_settings = TRUE; + level.changed = TRUE; if (level.use_custom_template) { @@ -6151,6 +6379,7 @@ static void CopyGroupElementPropertiesToGame(int element) /* mark that this group element has been modified */ element_info[element].modified_settings = TRUE; + level.changed = TRUE; } static void CopyClassicElementPropertiesToGame(int element) @@ -6535,24 +6764,27 @@ static void DrawCustomChangeContentArea() MapDrawingArea(id); } -static void DrawElementContentAreas() +static void DrawYamYamContentAreas() { int x = SX + ED_AREA_YAMYAM_CONTENT_XPOS(3) + 4 * MINI_TILEX; int y = SY + ED_AREA_YAMYAM_CONTENT_YPOS(0) + ED_BORDER_AREA_YSIZE; int i; /* display counter to choose number of element content areas */ - MapCounterButtons(ED_COUNTER_ID_ELEMENT_CONTENT); + MapCounterButtons(ED_COUNTER_ID_YAMYAM_CONTENT); for (i = 0; i < MAX_ELEMENT_CONTENTS; i++) { - int id = ED_DRAWING_ID_ELEMENT_CONTENT_0 + i; - int font_height = getFontHeight(FONT_TEXT_1); + int id = ED_DRAWING_ID_YAMYAM_CONTENT_0 + i; if (i < level.num_yamyam_contents) + { MapDrawingArea(id); + } else { + int font_height = getFontHeight(FONT_TEXT_1); + UnmapDrawingArea(id); /* delete content areas in case of reducing number of them */ @@ -6568,6 +6800,20 @@ static void DrawElementContentAreas() DrawText(x, y + 2 * MINI_TILEY, "smashed", FONT_TEXT_1); } +static void DrawMagicBallContentAreas() +{ + int x = SX + ED_AREA_MAGIC_BALL_CONTENT_XPOS(3) + 4 * MINI_TILEX; + int y = SY + ED_AREA_MAGIC_BALL_CONTENT_YPOS(0) + ED_BORDER_AREA_YSIZE; + int i; + + for (i = 0; i < NUM_MAGIC_BALL_CONTENTS; i++) + MapDrawingArea(ED_DRAWING_ID_MAGIC_BALL_CONTENT_0 + i); + + DrawText(x, y + 0 * MINI_TILEY, "generated", FONT_TEXT_1); + DrawText(x, y + 1 * MINI_TILEY, "when", FONT_TEXT_1); + DrawText(x, y + 2 * MINI_TILEY, "active", FONT_TEXT_1); +} + static void DrawGroupElementArea(int element) { int num_elements = group_element_info.num_elements; @@ -6939,9 +7185,13 @@ static void DrawPropertiesInfo() #define TEXT_COLLECTING "Score for collecting" #define TEXT_SMASHING "Score for smashing" +#define TEXT_SLURPING "Score for slurping" #define TEXT_CRACKING "Score for cracking" -#define TEXT_SPEED "Speed of amoeba growth" +#define TEXT_AMOEBA_SPEED "Speed of amoeba growth" #define TEXT_DURATION "Duration when activated" +#define TEXT_BALL_DELAY "Element generation delay" +#define TEXT_MOVE_SPEED "Speed of android moving" +#define TEXT_CLONE_SPEED "Speed of android cloning" static struct { @@ -7012,12 +7262,28 @@ static struct { EL_EM_KEY_3_FILE, &level.score[SC_KEY], TEXT_COLLECTING }, { EL_EM_KEY_4_FILE, &level.score[SC_KEY], TEXT_COLLECTING }, #endif - { EL_AMOEBA_WET, &level.amoeba_speed, TEXT_SPEED }, - { EL_AMOEBA_DRY, &level.amoeba_speed, TEXT_SPEED }, - { EL_AMOEBA_FULL, &level.amoeba_speed, TEXT_SPEED }, - { EL_BD_AMOEBA, &level.amoeba_speed, TEXT_SPEED }, + { EL_EM_KEY_5, &level.score[SC_KEY], TEXT_COLLECTING }, + { EL_EM_KEY_6, &level.score[SC_KEY], TEXT_COLLECTING }, + { EL_EM_KEY_7, &level.score[SC_KEY], TEXT_COLLECTING }, + { EL_EM_KEY_8, &level.score[SC_KEY], TEXT_COLLECTING }, + { EL_AMOEBA_WET, &level.amoeba_speed, TEXT_AMOEBA_SPEED }, + { EL_AMOEBA_DRY, &level.amoeba_speed, TEXT_AMOEBA_SPEED }, + { EL_AMOEBA_FULL, &level.amoeba_speed, TEXT_AMOEBA_SPEED }, + { EL_BD_AMOEBA, &level.amoeba_speed, TEXT_AMOEBA_SPEED }, { EL_MAGIC_WALL, &level.time_magic_wall, TEXT_DURATION }, { EL_ROBOT_WHEEL, &level.time_wheel, TEXT_DURATION }, + +#if 1 + { EL_EMC_ANDROID, &level.android_move_time, TEXT_MOVE_SPEED }, + { EL_EMC_ANDROID, &level.android_clone_time, TEXT_CLONE_SPEED }, + { EL_EMC_MAGIC_BALL, &level.ball_time, TEXT_BALL_DELAY }, + { EL_EMC_LENSES, &level.lenses_score, TEXT_COLLECTING }, + { EL_EMC_MAGNIFIER, &level.magnify_score, TEXT_COLLECTING }, + { EL_ROBOT, &level.slurp_score, TEXT_SLURPING }, + { EL_EMC_LENSES, &level.lenses_time, TEXT_DURATION }, + { EL_EMC_MAGNIFIER, &level.magnify_time, TEXT_DURATION }, +#endif + { -1, NULL, NULL } }; @@ -7045,6 +7311,8 @@ static boolean checkPropertiesConfig(int element) static void DrawPropertiesConfig() { + int max_num_element_counters = 2; + int num_element_counters = 0; int i; if (!checkPropertiesConfig(properties_element)) @@ -7054,25 +7322,32 @@ static void DrawPropertiesConfig() return; } - /* check if there are elements where a score can be chosen for */ + /* check if there are elements where a value can be chosen for */ for (i = 0; elements_with_counter[i].element != -1; i++) { if (elements_with_counter[i].element == properties_element) { - int counter_id = ED_COUNTER_ID_ELEMENT_SCORE; + int counter_id = ED_COUNTER_ID_ELEMENT_VALUE1 + num_element_counters; counterbutton_info[counter_id].y = ED_SETTINGS_YPOS((HAS_CONTENT(properties_element) ? 1 : 0) + (CAN_GROW(properties_element) ? 1 : 0) + (COULD_MOVE_INTO_ACID(properties_element) ? 1 : 0) + - (MAYBE_DONT_COLLIDE_WITH(properties_element) ? 1 :0)); + (MAYBE_DONT_COLLIDE_WITH(properties_element) ? 1 : 0)+ + num_element_counters); counterbutton_info[counter_id].value = elements_with_counter[i].value; counterbutton_info[counter_id].text_right= elements_with_counter[i].text; + /* !!! CHANGE THIS FOR CERTAIN ELEMENTS !!! */ + counterbutton_info[counter_id].min_value = MIN_SCORE; + counterbutton_info[counter_id].max_value = MAX_SCORE; + MapCounterButtons(counter_id); - break; + num_element_counters++; + if (num_element_counters >= max_num_element_counters) + break; } } @@ -7083,10 +7358,13 @@ static void DrawPropertiesConfig() if (IS_AMOEBOID(properties_element)) MapDrawingArea(ED_DRAWING_ID_AMOEBA_CONTENT); - else - DrawElementContentAreas(); + else if (properties_element == EL_YAMYAM) + DrawYamYamContentAreas(); } + if (properties_element == EL_EMC_MAGIC_BALL) + DrawMagicBallContentAreas(); + if (ELEM_IS_PLAYER(properties_element)) { MapCheckbuttonGadget(ED_CHECKBUTTON_ID_CAN_FALL_INTO_ACID); @@ -7898,6 +8176,8 @@ static int DrawLevelText(int sx, int sy, char letter, int mode) DrawLevelText(start_sx, sy + 1, 0, TEXT_SETCURSOR); else DrawLevelText(0, 0, 0, TEXT_END); + + level.changed = TRUE; } break; @@ -7986,56 +8266,56 @@ static void CopyLevelToUndoBuffer(int mode) SetBorderElement(); if (BorderElement != last_border_element) DrawMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); + + level.changed = TRUE; } static void RandomPlacement(int new_element) { static boolean free_position[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; - int num_free_positions; - int num_percentage; - int num_elements; + int num_free_positions = 0; + int num_percentage, num_elements; int x, y; - /* determine number of free positions for the new elements */ - /* (maybe this statement should be formatted a bit more readable...) */ - num_free_positions = 0; - for (x = 0; x < lev_fieldx; x++) - for (y = 0; y < lev_fieldy; y++) - if ((free_position[x][y] = - ((random_placement_background_restricted && - Feld[x][y] == random_placement_background_element) || - (!random_placement_background_restricted && - Feld[x][y] != new_element))) == TRUE) - num_free_positions++; + /* determine number of free positions for randomly placing the new element */ + for (x = 0; x < lev_fieldx; x++) for (y = 0; y < lev_fieldy; y++) + { + free_position[x][y] = + (random_placement_background_restricted ? + Feld[x][y] == random_placement_background_element : + Feld[x][y] != new_element); + + if (free_position[x][y]) + num_free_positions++; + } /* determine number of new elements to place there */ num_percentage = num_free_positions * random_placement_value / 100; num_elements = (random_placement_method == RANDOM_USE_PERCENTAGE ? num_percentage : random_placement_value); - /* if not more free positions than elements to place, fill whole level */ - if (num_elements >= num_free_positions) + /* if less free positions than elements to place, fill all these positions */ + if (num_free_positions < num_elements) { for (x = 0; x < lev_fieldx; x++) for (y = 0; y < lev_fieldy; y++) - Feld[x][y] = new_element; - - DrawMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); - CopyLevelToUndoBuffer(UNDO_IMMEDIATE); - return; + if (free_position[x][y]) + Feld[x][y] = new_element; } - - while (num_elements > 0) + else { - x = RND(lev_fieldx); - y = RND(lev_fieldy); - - /* don't place element at the same position twice */ - if (free_position[x][y]) + while (num_elements > 0) { - free_position[x][y] = FALSE; - Feld[x][y] = new_element; - num_elements--; + x = RND(lev_fieldx); + y = RND(lev_fieldy); + + /* don't place element at the same position twice */ + if (free_position[x][y]) + { + free_position[x][y] = FALSE; + Feld[x][y] = new_element; + num_elements--; + } } } @@ -8248,9 +8528,13 @@ static void HandleDrawingAreas(struct GadgetInfo *gi) } else if (id == GADGET_ID_RANDOM_BACKGROUND) random_placement_background_element = new_element; - else if (id >= GADGET_ID_ELEMENT_CONTENT_0 && - id <= GADGET_ID_ELEMENT_CONTENT_7) - level.yamyam_content[id - GADGET_ID_ELEMENT_CONTENT_0][sx][sy] = + else if (id >= GADGET_ID_YAMYAM_CONTENT_0 && + id <= GADGET_ID_YAMYAM_CONTENT_7) + level.yamyam_content[id - GADGET_ID_YAMYAM_CONTENT_0][sx][sy] = + new_element; + else if (id >= GADGET_ID_MAGIC_BALL_CONTENT_0 && + id <= GADGET_ID_MAGIC_BALL_CONTENT_7) + level.ball_content[id - GADGET_ID_MAGIC_BALL_CONTENT_0][sx][sy] = new_element; } break; @@ -8370,13 +8654,20 @@ static void HandleDrawingAreas(struct GadgetInfo *gi) PickDrawingElement(button, group_element_info.element[sx]); else if (id == GADGET_ID_RANDOM_BACKGROUND) PickDrawingElement(button, random_placement_background_element); - else if (id >= GADGET_ID_ELEMENT_CONTENT_0 && - id <= GADGET_ID_ELEMENT_CONTENT_7) + else if (id >= GADGET_ID_YAMYAM_CONTENT_0 && + id <= GADGET_ID_YAMYAM_CONTENT_7) { - int i = id - GADGET_ID_ELEMENT_CONTENT_0; + int i = id - GADGET_ID_YAMYAM_CONTENT_0; PickDrawingElement(button, level.yamyam_content[i][sx][sy]); } + else if (id >= GADGET_ID_MAGIC_BALL_CONTENT_0 && + id <= GADGET_ID_MAGIC_BALL_CONTENT_7) + { + int i = id - GADGET_ID_MAGIC_BALL_CONTENT_0; + + PickDrawingElement(button, level.ball_content[i][sx][sy]); + } break; @@ -8408,6 +8699,7 @@ static void HandleCounterButtons(struct GadgetInfo *gi) { if (gadget_id == counterbutton_info[counter_id].gadget_id_text) ModifyEditorCounter(counter_id, *counter_value); + return; } } @@ -8417,10 +8709,20 @@ static void HandleCounterButtons(struct GadgetInfo *gi) else ModifyEditorCounter(counter_id, *counter_value + step); + if (counter_id == ED_COUNTER_ID_SELECT_LEVEL) + { + LoadLevel(level_nr); + TapeErase(); + ResetUndoBuffer(); + DrawEditModeWindow(); + + return; + } + switch (counter_id) { - case ED_COUNTER_ID_ELEMENT_CONTENT: - DrawElementContentAreas(); + case ED_COUNTER_ID_YAMYAM_CONTENT: + DrawYamYamContentAreas(); break; case ED_COUNTER_ID_GROUP_CONTENT: @@ -8439,13 +8741,6 @@ static void HandleCounterButtons(struct GadgetInfo *gi) lev_fieldy = level.fieldy; break; - case ED_COUNTER_ID_SELECT_LEVEL: - LoadLevel(level_nr); - TapeErase(); - ResetUndoBuffer(); - DrawEditModeWindow(); - break; - default: break; } @@ -8455,6 +8750,8 @@ static void HandleCounterButtons(struct GadgetInfo *gi) (counter_id >= ED_COUNTER_ID_CHANGE_FIRST && counter_id <= ED_COUNTER_ID_CHANGE_LAST)) CopyElementPropertiesToGame(properties_element); + + level.changed = TRUE; } static void HandleTextInputGadgets(struct GadgetInfo *gi) @@ -8469,6 +8766,8 @@ static void HandleTextInputGadgets(struct GadgetInfo *gi) ModifyEditorElementList(); /* update changed button info text */ } + + level.changed = TRUE; } static void HandleTextAreaGadgets(struct GadgetInfo *gi) @@ -8476,6 +8775,8 @@ static void HandleTextAreaGadgets(struct GadgetInfo *gi) int type_id = gi->custom_type_id; strcpy(textarea_info[type_id].value, gi->textarea.value); + + level.changed = TRUE; } static void HandleSelectboxGadgets(struct GadgetInfo *gi) @@ -8496,7 +8797,11 @@ static void HandleSelectboxGadgets(struct GadgetInfo *gi) (type_id >= ED_SELECTBOX_ID_CHANGE_FIRST && type_id <= ED_SELECTBOX_ID_CHANGE_LAST) || (type_id == ED_SELECTBOX_ID_GROUP_CHOICE_MODE)) + { CopyElementPropertiesToGame(properties_element); + + level.changed = TRUE; + } } static void HandleTextbuttonGadgets(struct GadgetInfo *gi) @@ -8537,6 +8842,8 @@ static void HandleTextbuttonGadgets(struct GadgetInfo *gi) setElementChangeInfoToDefaults(ei->change); DrawPropertiesWindow(); + + level.changed = TRUE; } else if (type_id == ED_TEXTBUTTON_ID_DEL_CHANGE_PAGE && custom_element.num_change_pages > MIN_CHANGE_PAGES) @@ -8550,6 +8857,8 @@ static void HandleTextbuttonGadgets(struct GadgetInfo *gi) setElementChangePages(ei, ei->num_change_pages - 1); DrawPropertiesWindow(); + + level.changed = TRUE; } } @@ -8583,9 +8892,13 @@ static void HandleGraphicbuttonGadgets(struct GadgetInfo *gi) element_info[EL_INTERNAL_CLIPBOARD_CHANGE].change_page[0] = ei->change_page[current_change_page]; else if (type_id == ED_GRAPHICBUTTON_ID_PASTE_CHANGE_PAGE) + { ei->change_page[current_change_page] = element_info[EL_INTERNAL_CLIPBOARD_CHANGE].change_page[0]; + level.changed = TRUE; + } + DrawPropertiesWindow(); } } @@ -8594,6 +8907,8 @@ static void HandleRadiobuttons(struct GadgetInfo *gi) { *radiobutton_info[gi->custom_type_id].value = radiobutton_info[gi->custom_type_id].checked_value; + + level.changed = TRUE; } static void HandleCheckbuttons(struct GadgetInfo *gi) @@ -8636,6 +8951,8 @@ static void HandleCheckbuttons(struct GadgetInfo *gi) DrawEditModeWindow(); } + + level.changed = TRUE; } static void HandleControlButtons(struct GadgetInfo *gi) @@ -8901,6 +9218,7 @@ static void HandleControlButtons(struct GadgetInfo *gi) for (x = 0; x < MAX_LEV_FIELDX; x++) for (y = 0; y < MAX_LEV_FIELDY; y++) Feld[x][y] = (button == 1 ? EL_EMPTY : new_element); + CopyLevelToUndoBuffer(GADGET_ID_CLEAR); DrawMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos); @@ -8913,7 +9231,7 @@ static void HandleControlButtons(struct GadgetInfo *gi) break; } - if (!LevelContainsPlayer) + if (!LevelContainsPlayer()) Request("No Level without Gregor Mc Duffin please !", REQ_CONFIRM); else { @@ -8930,11 +9248,13 @@ static void HandleControlButtons(struct GadgetInfo *gi) if (new_level) Request("Level saved !", REQ_CONFIRM); + + level.changed = FALSE; } break; case GADGET_ID_TEST: - if (!LevelContainsPlayer) + if (!LevelContainsPlayer()) Request("No Level without Gregor Mc Duffin please !", REQ_CONFIRM); else { @@ -8944,6 +9264,8 @@ static void HandleControlButtons(struct GadgetInfo *gi) CopyPlayfield(level.field, FieldBackup); CopyPlayfield(Feld, level.field); + CopyNativeLevel_RND_to_Native(&level); + UnmapLevelEditorGadgets(); UndrawSpecialEditorDoor(); @@ -9064,7 +9386,15 @@ void HandleLevelEditorKeyInput(Key key) { RequestExitLevelEditor(setup.ask_on_escape); } - else + else if (edit_mode == ED_MODE_INFO) + { + HandleControlButtons(level_editor_gadget[GADGET_ID_INFO]); + } + else if (edit_mode == ED_MODE_PROPERTIES) + { + HandleControlButtons(level_editor_gadget[GADGET_ID_PROPERTIES]); + } + else /* should never happen */ { DrawDrawingWindow(); edit_mode = ED_MODE_DRAWING; @@ -9329,9 +9659,12 @@ static void HandleDrawingAreaInfo(struct GadgetInfo *gi) element = group_element_info.element[sx]; else if (id == GADGET_ID_RANDOM_BACKGROUND) element = random_placement_background_element; - else if (id >= GADGET_ID_ELEMENT_CONTENT_0 && - id <= GADGET_ID_ELEMENT_CONTENT_7) - element = level.yamyam_content[id - GADGET_ID_ELEMENT_CONTENT_0][sx][sy]; + else if (id >= GADGET_ID_YAMYAM_CONTENT_0 && + id <= GADGET_ID_YAMYAM_CONTENT_7) + element = level.yamyam_content[id - GADGET_ID_YAMYAM_CONTENT_0][sx][sy]; + else if (id >= GADGET_ID_MAGIC_BALL_CONTENT_0 && + id <= GADGET_ID_MAGIC_BALL_CONTENT_7) + element = level.ball_content[id -GADGET_ID_MAGIC_BALL_CONTENT_0][sx][sy]; strncpy(infotext, getElementInfoText(element), max_infotext_len); } @@ -9357,10 +9690,14 @@ static void HandleDrawingAreaInfo(struct GadgetInfo *gi) sprintf(infotext, "Group element position: %d", sx + 1); else if (id == GADGET_ID_RANDOM_BACKGROUND) strcpy(infotext, "Random placement background"); - else if (id >= GADGET_ID_ELEMENT_CONTENT_0 && - id <= GADGET_ID_ELEMENT_CONTENT_7) + else if (id >= GADGET_ID_YAMYAM_CONTENT_0 && + id <= GADGET_ID_YAMYAM_CONTENT_7) + sprintf(infotext, "Content area %d position: %d, %d", + id - GADGET_ID_YAMYAM_CONTENT_0 + 1, sx, sy); + else if (id >= GADGET_ID_MAGIC_BALL_CONTENT_0 && + id <= GADGET_ID_MAGIC_BALL_CONTENT_7) sprintf(infotext, "Content area %d position: %d, %d", - id - GADGET_ID_ELEMENT_CONTENT_0 + 1, sx, sy); + id - GADGET_ID_MAGIC_BALL_CONTENT_0 + 1, sx, sy); } infotext[max_infotext_len] = '\0'; @@ -9388,9 +9725,6 @@ void RequestExitLevelEditor(boolean ask_if_level_has_changed) else { CloseDoor(DOOR_CLOSE_1); - BlitBitmap(bitmap_db_door, bitmap_db_door, - DOOR_GFX_PAGEX2, DOOR_GFX_PAGEY1, DXSIZE,DYSIZE, - DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1); - OpenDoor(DOOR_OPEN_1); + OpenDoor(DOOR_OPEN_1 | DOOR_COPY_BACK); } }