X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Feditor.c;h=f6c63d1dd7d028d9e78d43501f8c7c8a669f81a4;hb=1e4a6b46371858fdb85052eec3e7143732ff91b5;hp=c4392072282e37d0f8eec97c5b231a9dd7233ccd;hpb=60aac4d0fa635b69e498dcb174f3fe9b2cacc1c9;p=rocksndiamonds.git diff --git a/src/editor.c b/src/editor.c index c4392072..f6c63d1d 100644 --- a/src/editor.c +++ b/src/editor.c @@ -110,8 +110,11 @@ MINI_TILEX / 2) /* values for the settings windows */ -#define ED_SETTINGS_XSTART (3 * MINI_TILEX / 2) -#define ED_SETTINGS_YSTART (MINI_TILEY * 10) +#define ED_LEVEL_SETTINGS_XSTART (3 * MINI_TILEX / 2) +#define ED_LEVEL_SETTINGS_YSTART (5 * MINI_TILEY) + +#define ED_ELEMENT_SETTINGS_XSTART (3 * MINI_TILEX / 2) +#define ED_ELEMENT_SETTINGS_YSTART (10 * MINI_TILEY) #define ED_XOFFSET_CHECKBOX (ED_CHECKBUTTON_XSIZE + \ 2 * ED_GADGET_DISTANCE) @@ -119,9 +122,14 @@ #define ED_SETTINGS_XOFFSET ED_XOFFSET_CHECKBOX #define ED_SETTINGS_YOFFSET (3 * MINI_TILEY / 2) -#define ED_SETTINGS_XPOS(n) (ED_SETTINGS_XSTART + \ +#define ED_LEVEL_SETTINGS_XPOS(n) (ED_LEVEL_SETTINGS_XSTART + \ (n) * ED_SETTINGS_XOFFSET) -#define ED_SETTINGS_YPOS(n) (ED_SETTINGS_YSTART + \ +#define ED_LEVEL_SETTINGS_YPOS(n) (ED_LEVEL_SETTINGS_YSTART + \ + (n) * ED_SETTINGS_YOFFSET) + +#define ED_ELEMENT_SETTINGS_XPOS(n) (ED_ELEMENT_SETTINGS_XSTART + \ + (n) * ED_SETTINGS_XOFFSET) +#define ED_ELEMENT_SETTINGS_YPOS(n) (ED_ELEMENT_SETTINGS_YSTART + \ (n) * ED_SETTINGS_YOFFSET) #define ED_SETTINGS1_YPOS MINI_TILEY @@ -137,12 +145,12 @@ (n) * ED_COUNTER_YDISTANCE - 2) /* values for element content drawing areas */ -#define ED_AREA_1X1_SETTINGS_XPOS(n) (ED_SETTINGS_XPOS(n)) -#define ED_AREA_1X1_SETTINGS_YPOS(n) (ED_SETTINGS_YPOS(n) + \ +#define ED_AREA_1X1_SETTINGS_XPOS(n) (ED_ELEMENT_SETTINGS_XPOS(n)) +#define ED_AREA_1X1_SETTINGS_YPOS(n) (ED_ELEMENT_SETTINGS_YPOS(n) + \ ED_GADGET_DISTANCE) -#define ED_AREA_3X3_SETTINGS_XPOS(n) (ED_SETTINGS_XPOS(n)) -#define ED_AREA_3X3_SETTINGS_YPOS(n) (ED_SETTINGS_YPOS(n) + \ +#define ED_AREA_3X3_SETTINGS_XPOS(n) (ED_ELEMENT_SETTINGS_XPOS(n)) +#define ED_AREA_3X3_SETTINGS_YPOS(n) (ED_ELEMENT_SETTINGS_YPOS(n) + \ ED_GADGET_DISTANCE - MINI_TILEY) /* yamyam content */ @@ -151,6 +159,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 +348,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 +453,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_CONSISTENCY (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) @@ -494,12 +520,12 @@ #define GADGET_ID_RANDOM_PERCENTAGE (GADGET_ID_CHECKBUTTON_FIRST + 0) #define GADGET_ID_RANDOM_QUANTITY (GADGET_ID_CHECKBUTTON_FIRST + 1) #define GADGET_ID_RANDOM_RESTRICTED (GADGET_ID_CHECKBUTTON_FIRST + 2) -#define GADGET_ID_DOUBLE_SPEED (GADGET_ID_CHECKBUTTON_FIRST + 3) -#define GADGET_ID_GRAVITY (GADGET_ID_CHECKBUTTON_FIRST + 4) -#define GADGET_ID_STICK_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 5) -#define GADGET_ID_EM_SLIPPERY_GEMS (GADGET_ID_CHECKBUTTON_FIRST + 6) -#define GADGET_ID_USE_SPRING_BUG (GADGET_ID_CHECKBUTTON_FIRST + 7) -#define GADGET_ID_GROW_INTO_DIGGABLE (GADGET_ID_CHECKBUTTON_FIRST + 8) +#define GADGET_ID_INITIAL_GRAVITY (GADGET_ID_CHECKBUTTON_FIRST + 3) +#define GADGET_ID_STICK_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 4) +#define GADGET_ID_EM_SLIPPERY_GEMS (GADGET_ID_CHECKBUTTON_FIRST + 5) +#define GADGET_ID_USE_SPRING_BUG (GADGET_ID_CHECKBUTTON_FIRST + 6) +#define GADGET_ID_GROW_INTO_DIGGABLE (GADGET_ID_CHECKBUTTON_FIRST + 7) +#define GADGET_ID_DOUBLE_SPEED (GADGET_ID_CHECKBUTTON_FIRST + 8) #define GADGET_ID_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 9) #define GADGET_ID_SP_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 10) #define GADGET_ID_INSTANT_RELOCATION (GADGET_ID_CHECKBUTTON_FIRST + 11) @@ -507,30 +533,32 @@ #define GADGET_ID_CAN_FALL_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 13) #define GADGET_ID_CAN_MOVE_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 14) #define GADGET_ID_DONT_COLLIDE_WITH (GADGET_ID_CHECKBUTTON_FIRST + 15) -#define GADGET_ID_CUSTOM_EXPLODE_RESULT (GADGET_ID_CHECKBUTTON_FIRST + 16) -#define GADGET_ID_CUSTOM_EXPLODE_FIRE (GADGET_ID_CHECKBUTTON_FIRST + 17) -#define GADGET_ID_CUSTOM_EXPLODE_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 18) -#define GADGET_ID_CUSTOM_EXPLODE_IMPACT (GADGET_ID_CHECKBUTTON_FIRST + 19) -#define GADGET_ID_CUSTOM_WALK_TO_OBJECT (GADGET_ID_CHECKBUTTON_FIRST + 20) -#define GADGET_ID_CUSTOM_DEADLY (GADGET_ID_CHECKBUTTON_FIRST + 21) -#define GADGET_ID_CUSTOM_CAN_MOVE (GADGET_ID_CHECKBUTTON_FIRST + 22) -#define GADGET_ID_CUSTOM_CAN_FALL (GADGET_ID_CHECKBUTTON_FIRST + 23) -#define GADGET_ID_CUSTOM_CAN_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 24) -#define GADGET_ID_CUSTOM_SLIPPERY (GADGET_ID_CHECKBUTTON_FIRST + 25) -#define GADGET_ID_CUSTOM_ACCESSIBLE (GADGET_ID_CHECKBUTTON_FIRST + 26) -#define GADGET_ID_CUSTOM_USE_GRAPHIC (GADGET_ID_CHECKBUTTON_FIRST + 27) -#define GADGET_ID_CUSTOM_USE_TEMPLATE (GADGET_ID_CHECKBUTTON_FIRST + 28) -#define GADGET_ID_CUSTOM_CAN_CHANGE (GADGET_ID_CHECKBUTTON_FIRST + 29) -#define GADGET_ID_CHANGE_USE_CONTENT (GADGET_ID_CHECKBUTTON_FIRST + 30) -#define GADGET_ID_CHANGE_USE_EXPLOSION (GADGET_ID_CHECKBUTTON_FIRST + 31) -#define GADGET_ID_CHANGE_ONLY_COMPLETE (GADGET_ID_CHECKBUTTON_FIRST + 32) -#define GADGET_ID_CHANGE_USE_RANDOM (GADGET_ID_CHECKBUTTON_FIRST + 33) -#define GADGET_ID_CHANGE_DELAY (GADGET_ID_CHECKBUTTON_FIRST + 34) -#define GADGET_ID_CHANGE_BY_DIRECT_ACT (GADGET_ID_CHECKBUTTON_FIRST + 35) -#define GADGET_ID_CHANGE_BY_OTHER_ACT (GADGET_ID_CHECKBUTTON_FIRST + 36) +#define GADGET_ID_CUSTOM_INDESTRUCTIBLE (GADGET_ID_CHECKBUTTON_FIRST + 16) +#define GADGET_ID_CUSTOM_CAN_EXPLODE (GADGET_ID_CHECKBUTTON_FIRST + 17) +#define GADGET_ID_CUSTOM_EXPLODE_FIRE (GADGET_ID_CHECKBUTTON_FIRST + 18) +#define GADGET_ID_CUSTOM_EXPLODE_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 19) +#define GADGET_ID_CUSTOM_EXPLODE_IMPACT (GADGET_ID_CHECKBUTTON_FIRST + 20) +#define GADGET_ID_CUSTOM_WALK_TO_OBJECT (GADGET_ID_CHECKBUTTON_FIRST + 21) +#define GADGET_ID_CUSTOM_DEADLY (GADGET_ID_CHECKBUTTON_FIRST + 22) +#define GADGET_ID_CUSTOM_CAN_MOVE (GADGET_ID_CHECKBUTTON_FIRST + 23) +#define GADGET_ID_CUSTOM_CAN_FALL (GADGET_ID_CHECKBUTTON_FIRST + 24) +#define GADGET_ID_CUSTOM_CAN_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 25) +#define GADGET_ID_CUSTOM_SLIPPERY (GADGET_ID_CHECKBUTTON_FIRST + 26) +#define GADGET_ID_CUSTOM_ACCESSIBLE (GADGET_ID_CHECKBUTTON_FIRST + 27) +#define GADGET_ID_CUSTOM_GRAV_REACHABLE (GADGET_ID_CHECKBUTTON_FIRST + 28) +#define GADGET_ID_CUSTOM_USE_GRAPHIC (GADGET_ID_CHECKBUTTON_FIRST + 29) +#define GADGET_ID_CUSTOM_USE_TEMPLATE (GADGET_ID_CHECKBUTTON_FIRST + 30) +#define GADGET_ID_CUSTOM_CAN_CHANGE (GADGET_ID_CHECKBUTTON_FIRST + 31) +#define GADGET_ID_CHANGE_USE_CONTENT (GADGET_ID_CHECKBUTTON_FIRST + 32) +#define GADGET_ID_CHANGE_USE_EXPLOSION (GADGET_ID_CHECKBUTTON_FIRST + 33) +#define GADGET_ID_CHANGE_ONLY_COMPLETE (GADGET_ID_CHECKBUTTON_FIRST + 34) +#define GADGET_ID_CHANGE_USE_RANDOM (GADGET_ID_CHECKBUTTON_FIRST + 35) +#define GADGET_ID_CHANGE_DELAY (GADGET_ID_CHECKBUTTON_FIRST + 36) +#define GADGET_ID_CHANGE_BY_DIRECT_ACT (GADGET_ID_CHECKBUTTON_FIRST + 37) +#define GADGET_ID_CHANGE_BY_OTHER_ACT (GADGET_ID_CHECKBUTTON_FIRST + 38) /* gadgets for buttons in element list */ -#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 37) +#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 39) #define GADGET_ID_ELEMENTLIST_LAST (GADGET_ID_ELEMENTLIST_FIRST + \ ED_NUM_ELEMENTLIST_BUTTONS - 1) @@ -549,33 +577,34 @@ #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 #define ED_COUNTER_ID_CUSTOM1_FIRST ED_COUNTER_ID_CUSTOM_SCORE -#define ED_COUNTER_ID_CUSTOM1_LAST ED_COUNTER_ID_MOVE_DELAY_RND -#define ED_COUNTER_ID_CUSTOM2_FIRST ED_COUNTER_ID_EXPLOSION_DELAY +#define ED_COUNTER_ID_CUSTOM1_LAST ED_COUNTER_ID_DROP_DELAY_RND +#define ED_COUNTER_ID_CUSTOM2_FIRST ED_COUNTER_ID_MOVE_DELAY_FIX #define ED_COUNTER_ID_CUSTOM2_LAST ED_COUNTER_ID_IGNITION_DELAY #define ED_COUNTER_ID_CUSTOM_FIRST ED_COUNTER_ID_CUSTOM1_FIRST #define ED_COUNTER_ID_CUSTOM_LAST ED_COUNTER_ID_CUSTOM2_LAST @@ -626,38 +655,39 @@ /* 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_CONSISTENCY 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_MOVE_LEAVE_TYPE -#define ED_SELECTBOX_ID_CUSTOM2_FIRST ED_SELECTBOX_ID_CUSTOM_SMASH_TARGETS -#define ED_SELECTBOX_ID_CUSTOM2_LAST ED_SELECTBOX_ID_CUSTOM_CONSISTENCY +#define ED_SELECTBOX_ID_CUSTOM1_LAST ED_SELECTBOX_ID_CUSTOM_WALK_TO_ACTION +#define ED_SELECTBOX_ID_CUSTOM2_FIRST ED_SELECTBOX_ID_CUSTOM_MOVE_PATTERN +#define ED_SELECTBOX_ID_CUSTOM2_LAST ED_SELECTBOX_ID_CUSTOM_EXPLOSION_TYPE #define ED_SELECTBOX_ID_CUSTOM_FIRST ED_SELECTBOX_ID_CUSTOM1_FIRST #define ED_SELECTBOX_ID_CUSTOM_LAST ED_SELECTBOX_ID_CUSTOM2_LAST @@ -694,13 +724,13 @@ #define ED_GRAPHICBUTTON_ID_CHANGE_LAST ED_GRAPHICBUTTON_ID_PASTE_CHANGE_PAGE /* values for checkbutton gadgets */ -#define ED_CHECKBUTTON_ID_DOUBLE_SPEED 0 -#define ED_CHECKBUTTON_ID_GRAVITY 1 -#define ED_CHECKBUTTON_ID_RANDOM_RESTRICTED 2 -#define ED_CHECKBUTTON_ID_STICK_ELEMENT 3 -#define ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS 4 -#define ED_CHECKBUTTON_ID_USE_SPRING_BUG 5 -#define ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE 6 +#define ED_CHECKBUTTON_ID_INITIAL_GRAVITY 0 +#define ED_CHECKBUTTON_ID_RANDOM_RESTRICTED 1 +#define ED_CHECKBUTTON_ID_STICK_ELEMENT 2 +#define ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS 3 +#define ED_CHECKBUTTON_ID_USE_SPRING_BUG 4 +#define ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE 5 +#define ED_CHECKBUTTON_ID_DOUBLE_SPEED 6 #define ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD 7 #define ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD 8 #define ED_CHECKBUTTON_ID_INSTANT_RELOCATION 9 @@ -711,33 +741,35 @@ #define ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC 14 #define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE 15 #define ED_CHECKBUTTON_ID_CUSTOM_ACCESSIBLE 16 -#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT 17 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE 18 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 19 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 20 -#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 21 -#define ED_CHECKBUTTON_ID_CUSTOM_DEADLY 22 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_RESULT 23 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE 24 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH 25 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT 26 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE 27 -#define ED_CHECKBUTTON_ID_CHANGE_DELAY 28 -#define ED_CHECKBUTTON_ID_CHANGE_BY_DIRECT_ACT 29 -#define ED_CHECKBUTTON_ID_CHANGE_BY_OTHER_ACT 30 -#define ED_CHECKBUTTON_ID_CHANGE_USE_EXPLOSION 31 -#define ED_CHECKBUTTON_ID_CHANGE_USE_CONTENT 32 -#define ED_CHECKBUTTON_ID_CHANGE_ONLY_COMPLETE 33 -#define ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM 34 - -#define ED_NUM_CHECKBUTTONS 35 - -#define ED_CHECKBUTTON_ID_LEVEL_FIRST ED_CHECKBUTTON_ID_DOUBLE_SPEED +#define ED_CHECKBUTTON_ID_CUSTOM_GRAV_REACHABLE 17 +#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT 18 +#define ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE 19 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE 20 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 21 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 22 +#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 23 +#define ED_CHECKBUTTON_ID_CUSTOM_DEADLY 24 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_EXPLODE 25 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE 26 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH 27 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT 28 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE 29 +#define ED_CHECKBUTTON_ID_CHANGE_DELAY 30 +#define ED_CHECKBUTTON_ID_CHANGE_BY_DIRECT_ACT 31 +#define ED_CHECKBUTTON_ID_CHANGE_BY_OTHER_ACT 32 +#define ED_CHECKBUTTON_ID_CHANGE_USE_EXPLOSION 33 +#define ED_CHECKBUTTON_ID_CHANGE_USE_CONTENT 34 +#define ED_CHECKBUTTON_ID_CHANGE_ONLY_COMPLETE 35 +#define ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM 36 + +#define ED_NUM_CHECKBUTTONS 37 + +#define ED_CHECKBUTTON_ID_LEVEL_FIRST ED_CHECKBUTTON_ID_INITIAL_GRAVITY #define ED_CHECKBUTTON_ID_LEVEL_LAST ED_CHECKBUTTON_ID_RANDOM_RESTRICTED #define ED_CHECKBUTTON_ID_CUSTOM1_FIRST ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC -#define ED_CHECKBUTTON_ID_CUSTOM1_LAST ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE -#define ED_CHECKBUTTON_ID_CUSTOM2_FIRST ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL +#define ED_CHECKBUTTON_ID_CUSTOM1_LAST ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE +#define ED_CHECKBUTTON_ID_CUSTOM2_FIRST ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE #define ED_CHECKBUTTON_ID_CUSTOM2_LAST ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT #define ED_CHECKBUTTON_ID_CUSTOM_FIRST ED_CHECKBUTTON_ID_CUSTOM1_FIRST #define ED_CHECKBUTTON_ID_CUSTOM_LAST ED_CHECKBUTTON_ID_CUSTOM2_LAST @@ -756,26 +788,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 /* @@ -893,7 +933,7 @@ static struct char *text_above, *text_left, *text_right; } counterbutton_info[ED_NUM_COUNTERBUTTONS] = { - /* ---------- level and editor settings ---------------------------------- */ + /* ---------- current level number --------------------------------------- */ { DX + 5 - SX, DY + 3 - SY, @@ -903,8 +943,11 @@ static struct &level_nr, NULL, NULL, NULL }, + + /* ---------- level and editor settings ---------------------------------- */ + { - ED_SETTINGS_XPOS(0), ED_COUNTER_YPOS(2), + ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(4), MIN_LEV_FIELDX, MAX_LEV_FIELDX, GADGET_ID_LEVEL_XSIZE_DOWN, GADGET_ID_LEVEL_XSIZE_UP, GADGET_ID_LEVEL_XSIZE_TEXT, GADGET_ID_NONE, @@ -912,7 +955,7 @@ static struct "playfield size:", NULL, "width", }, { - -1, ED_COUNTER_YPOS(2), + -1, ED_LEVEL_SETTINGS_YPOS(4), MIN_LEV_FIELDY, MAX_LEV_FIELDY, GADGET_ID_LEVEL_YSIZE_DOWN, GADGET_ID_LEVEL_YSIZE_UP, GADGET_ID_LEVEL_YSIZE_TEXT, GADGET_ID_LEVEL_XSIZE_UP, @@ -920,15 +963,15 @@ static struct NULL, " ", "height", }, { - ED_SETTINGS_XPOS(0), ED_COUNTER_YPOS(3), + ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(6), 0, 999, GADGET_ID_LEVEL_GEMSLIMIT_DOWN, GADGET_ID_LEVEL_GEMSLIMIT_UP, GADGET_ID_LEVEL_GEMSLIMIT_TEXT, GADGET_ID_NONE, &level.gems_needed, - "number of gems to collect:", NULL, NULL + NULL, "number of gems to collect:", NULL }, { - ED_SETTINGS_XPOS(0), ED_COUNTER_YPOS(4), + ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(8), 0, 9999, GADGET_ID_LEVEL_TIMELIMIT_DOWN, GADGET_ID_LEVEL_TIMELIMIT_UP, GADGET_ID_LEVEL_TIMELIMIT_TEXT, GADGET_ID_NONE, @@ -936,7 +979,7 @@ static struct "time or step limit to solve level:", NULL, NULL }, { - ED_SETTINGS_XPOS(0), ED_COUNTER_YPOS(5), + ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(10), 0, 255, GADGET_ID_LEVEL_TIMESCORE_DOWN, GADGET_ID_LEVEL_TIMESCORE_UP, GADGET_ID_LEVEL_TIMESCORE_TEXT, GADGET_ID_NONE, @@ -944,7 +987,7 @@ static struct "score for each 10 sec/steps left:", NULL, NULL }, { - ED_SETTINGS_XPOS(0), ED_COUNTER2_YPOS(8), + ED_LEVEL_SETTINGS_XPOS(0), ED_COUNTER2_YPOS(8), 1, 100, GADGET_ID_LEVEL_RANDOM_DOWN, GADGET_ID_LEVEL_RANDOM_UP, GADGET_ID_LEVEL_RANDOM_TEXT, GADGET_ID_NONE, @@ -955,23 +998,31 @@ static struct /* ---------- element settings: configure (various elements) ------------- */ { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(0), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_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(3), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_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_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_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" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(0), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(0), MIN_ENVELOPE_XSIZE, MAX_ENVELOPE_XSIZE, GADGET_ID_ENVELOPE_XSIZE_DOWN, GADGET_ID_ENVELOPE_XSIZE_UP, GADGET_ID_ENVELOPE_XSIZE_TEXT, GADGET_ID_NONE, @@ -979,7 +1030,7 @@ static struct NULL, NULL, "width", }, { - -1, ED_SETTINGS_YPOS(0), + -1, ED_ELEMENT_SETTINGS_YPOS(0), MIN_ENVELOPE_YSIZE, MAX_ENVELOPE_YSIZE, GADGET_ID_ENVELOPE_YSIZE_DOWN, GADGET_ID_ENVELOPE_YSIZE_UP, GADGET_ID_ENVELOPE_YSIZE_TEXT, GADGET_ID_ENVELOPE_XSIZE_UP, @@ -990,7 +1041,7 @@ static struct /* ---------- element settings: configure 1 (custom elements) ------------ */ { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(6), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(6), MIN_SCORE, MAX_SCORE, GADGET_ID_CUSTOM_SCORE_DOWN, GADGET_ID_CUSTOM_SCORE_UP, GADGET_ID_CUSTOM_SCORE_TEXT, GADGET_ID_NONE, @@ -998,7 +1049,7 @@ static struct NULL, "score", " " }, { - -1, ED_SETTINGS_YPOS(6), + -1, ED_ELEMENT_SETTINGS_YPOS(6), MIN_COLLECT_COUNT, MAX_COLLECT_COUNT, GADGET_ID_CUSTOM_GEMCOUNT_DOWN, GADGET_ID_CUSTOM_GEMCOUNT_UP, GADGET_ID_CUSTOM_GEMCOUNT_TEXT, GADGET_ID_CUSTOM_SCORE_UP, @@ -1006,7 +1057,7 @@ static struct NULL, "count", NULL }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(7), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(7), 0, 255, GADGET_ID_PUSH_DELAY_FIX_DOWN, GADGET_ID_PUSH_DELAY_FIX_UP, GADGET_ID_PUSH_DELAY_FIX_TEXT, GADGET_ID_NONE, @@ -1014,7 +1065,7 @@ static struct NULL, "push delay", NULL }, { - -1, ED_SETTINGS_YPOS(7), + -1, ED_ELEMENT_SETTINGS_YPOS(7), 0, 255, GADGET_ID_PUSH_DELAY_RND_DOWN, GADGET_ID_PUSH_DELAY_RND_UP, GADGET_ID_PUSH_DELAY_RND_TEXT, GADGET_ID_PUSH_DELAY_FIX_UP, @@ -1022,7 +1073,7 @@ static struct NULL, "+random", NULL }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(8), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(8), 0, 255, GADGET_ID_DROP_DELAY_FIX_DOWN, GADGET_ID_DROP_DELAY_FIX_UP, GADGET_ID_DROP_DELAY_FIX_TEXT, GADGET_ID_NONE, @@ -1030,15 +1081,18 @@ static struct NULL, "drop delay", NULL }, { - -1, ED_SETTINGS_YPOS(8), + -1, ED_ELEMENT_SETTINGS_YPOS(8), 0, 255, GADGET_ID_DROP_DELAY_RND_DOWN, GADGET_ID_DROP_DELAY_RND_UP, GADGET_ID_DROP_DELAY_RND_TEXT, GADGET_ID_DROP_DELAY_FIX_UP, &custom_element.drop_delay_random, NULL, "+random", NULL }, + + /* ---------- element settings: configure 2 (custom elements) ------------ */ + { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(13), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(5), 0, 999, GADGET_ID_MOVE_DELAY_FIX_DOWN, GADGET_ID_MOVE_DELAY_FIX_UP, GADGET_ID_MOVE_DELAY_FIX_TEXT, GADGET_ID_NONE, @@ -1046,18 +1100,15 @@ static struct NULL, "move delay", NULL }, { - -1, ED_SETTINGS_YPOS(13), + -1, ED_ELEMENT_SETTINGS_YPOS(5), 0, 999, GADGET_ID_MOVE_DELAY_RND_DOWN, GADGET_ID_MOVE_DELAY_RND_UP, GADGET_ID_MOVE_DELAY_RND_TEXT, GADGET_ID_MOVE_DELAY_FIX_UP, &custom_element.move_delay_random, NULL, "+random", NULL }, - - /* ---------- element settings: configure 2 (custom elements) ------------ */ - { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(4), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(12), 0, 255, GADGET_ID_EXPLOSION_DELAY_DOWN, GADGET_ID_EXPLOSION_DELAY_UP, GADGET_ID_EXPLOSION_DELAY_TEXT, GADGET_ID_NONE, @@ -1065,7 +1116,7 @@ static struct NULL, "explosion delay", NULL }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(5), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(13), 0, 255, GADGET_ID_IGNITION_DELAY_DOWN, GADGET_ID_IGNITION_DELAY_UP, GADGET_ID_IGNITION_DELAY_TEXT, GADGET_ID_NONE, @@ -1076,7 +1127,7 @@ static struct /* ---------- element settings: configure (group elements) --------------- */ { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(5), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(5), MIN_ELEMENTS_IN_GROUP, MAX_ELEMENTS_IN_GROUP, GADGET_ID_GROUP_CONTENT_DOWN, GADGET_ID_GROUP_CONTENT_UP, GADGET_ID_GROUP_CONTENT_TEXT, GADGET_ID_NONE, @@ -1087,7 +1138,7 @@ static struct /* ---------- element settings: advanced (custom elements) --------------- */ { - ED_SETTINGS_XPOS(2), ED_SETTINGS_YPOS(2), + ED_ELEMENT_SETTINGS_XPOS(2), ED_ELEMENT_SETTINGS_YPOS(2), 0, 999, GADGET_ID_CHANGE_DELAY_FIX_DOWN, GADGET_ID_CHANGE_DELAY_FIX_UP, GADGET_ID_CHANGE_DELAY_FIX_TEXT, GADGET_ID_NONE, @@ -1095,7 +1146,7 @@ static struct NULL, "delay", NULL, }, { - -1, ED_SETTINGS_YPOS(2), + -1, ED_ELEMENT_SETTINGS_YPOS(2), 0, 999, GADGET_ID_CHANGE_DELAY_RND_DOWN, GADGET_ID_CHANGE_DELAY_RND_UP, GADGET_ID_CHANGE_DELAY_RND_TEXT, GADGET_ID_CHANGE_DELAY_FIX_UP, @@ -1103,7 +1154,7 @@ static struct NULL, "+random", NULL }, { - ED_SETTINGS_XPOS(3), ED_SETTINGS_YPOS(12), + ED_ELEMENT_SETTINGS_XPOS(3), ED_ELEMENT_SETTINGS_YPOS(12), 0, 100, GADGET_ID_CHANGE_CONT_RND_DOWN, GADGET_ID_CHANGE_CONT_RND_UP, GADGET_ID_CHANGE_CONT_RND_TEXT, GADGET_ID_NONE, @@ -1122,14 +1173,14 @@ static struct } textinput_info[ED_NUM_TEXTINPUT] = { { - ED_SETTINGS_XPOS(0), ED_COUNTER_YPOS(0), + ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(0), GADGET_ID_LEVEL_NAME, MAX_LEVEL_NAME_LEN, level.name, "Title:", "Title" }, { - ED_SETTINGS_XPOS(0), ED_COUNTER_YPOS(1), + ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(2), GADGET_ID_LEVEL_AUTHOR, MAX_LEVEL_AUTHOR_LEN, level.author, @@ -1154,7 +1205,7 @@ static struct } textarea_info[ED_NUM_TEXTAREAS] = { { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(2), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(2), GADGET_ID_ENVELOPE_INFO, MAX_ENVELOPE_XSIZE, MAX_ENVELOPE_YSIZE, NULL, @@ -1170,6 +1221,14 @@ static struct ValueTextInfo options_time_or_steps[] = { -1, NULL } }; +static struct ValueTextInfo options_game_engine_type[] = +{ + { GAME_ENGINE_TYPE_RND, "Rocks'n'Diamonds" }, + { GAME_ENGINE_TYPE_EM, "Emerald Mine" }, + + { -1, NULL } +}; + static struct ValueTextInfo options_access_type[] = { { EP_WALKABLE, "walkable" }, @@ -1268,6 +1327,7 @@ static struct ValueTextInfo options_move_direction[] = static struct ValueTextInfo options_move_stepsize[] = { + { 0, "not moving" }, { 1, "very slow" }, { 2, "slow" }, { 4, "normal" }, @@ -1319,12 +1379,14 @@ static struct ValueTextInfo options_deadliness[] = { -1, NULL } }; -static struct ValueTextInfo options_consistency[] = +static struct ValueTextInfo options_explosion_type[] = { - { EP_CAN_EXPLODE_3X3, "can explode 3x3" }, - { EP_CAN_EXPLODE_CROSS, "can explode 3+3" }, - { EP_CAN_EXPLODE_1X1, "can explode 1x1" }, + { EXPLODES_3X3, "3x3" }, + { EXPLODES_CROSS, "3+3" }, + { EXPLODES_1X1, "1x1" }, +#if 0 { EP_INDESTRUCTIBLE, "indestructible" }, +#endif { -1, NULL } }; @@ -1352,9 +1414,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)" }, @@ -1489,18 +1553,26 @@ static struct /* ---------- level and editor settings ---------------------------------- */ { - -1, ED_COUNTER_YPOS(4), + -1, ED_LEVEL_SETTINGS_YPOS(8), GADGET_ID_TIME_OR_STEPS, GADGET_ID_LEVEL_TIMELIMIT_UP, -1, options_time_or_steps, &level.use_step_counter, NULL, "(0 => no limit)", "time or step limit" }, + { + ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(5), + 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) ----------- */ { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(3), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(3), GADGET_ID_CUSTOM_ACCESS_TYPE, GADGET_ID_NONE, -1, options_access_type, @@ -1508,7 +1580,7 @@ static struct NULL, NULL, "type of access to this field" }, { - -1, ED_SETTINGS_YPOS(3), + -1, ED_ELEMENT_SETTINGS_YPOS(3), GADGET_ID_CUSTOM_ACCESS_LAYER, GADGET_ID_CUSTOM_ACCESS_TYPE, -1, options_access_layer, @@ -1516,7 +1588,7 @@ static struct NULL, NULL, "layer of access for this field" }, { - -1, ED_SETTINGS_YPOS(3), + -1, ED_ELEMENT_SETTINGS_YPOS(3), GADGET_ID_CUSTOM_ACCESS_PROTECTED, GADGET_ID_CUSTOM_ACCESS_LAYER, -1, options_access_protected, @@ -1524,7 +1596,7 @@ static struct NULL, NULL, "protected access for this field" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(4), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(4), GADGET_ID_CUSTOM_ACCESS_DIRECTION, GADGET_ID_NONE, -1, options_access_direction, @@ -1532,23 +1604,26 @@ static struct "from", NULL, "access direction for this field" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(5), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(5), GADGET_ID_CUSTOM_WALK_TO_ACTION, GADGET_ID_NONE, -1, options_walk_to_action, &custom_element.walk_to_action, NULL, NULL, "diggable/collectible/pushable" }, + + /* ---------- element settings: configure 2 (custom elements) ----------- */ + { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(9), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(1), GADGET_ID_CUSTOM_MOVE_PATTERN, GADGET_ID_NONE, -1, options_move_pattern, &custom_element.move_pattern, - "can move", NULL, "element move direction" + "can move", NULL, "element move pattern" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(10), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(2), GADGET_ID_CUSTOM_MOVE_DIRECTION, GADGET_ID_NONE, -1, options_move_direction, @@ -1556,7 +1631,7 @@ static struct "starts moving", NULL, "initial element move direction" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(12), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(4), GADGET_ID_CUSTOM_MOVE_STEPSIZE, GADGET_ID_NONE, -1, options_move_stepsize, @@ -1564,7 +1639,7 @@ static struct "move/fall speed", NULL, "speed of element movement" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(11), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(3), GADGET_ID_CUSTOM_MOVE_LEAVE_TYPE, GADGET_ID_NONE, -1, options_move_leave_type, @@ -1572,7 +1647,7 @@ static struct "can dig: can", ":", "leave behind or change element" }, { - -1, ED_SETTINGS_YPOS(13), + -1, ED_ELEMENT_SETTINGS_YPOS(7), GADGET_ID_CUSTOM_SMASH_TARGETS, GADGET_ID_CUSTOM_CAN_SMASH, -1, options_smash_targets, @@ -1580,18 +1655,15 @@ static struct "can smash", NULL, "elements that can be smashed" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(14), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(8), GADGET_ID_CUSTOM_SLIPPERY_TYPE, GADGET_ID_NONE, -1, options_slippery_type, &custom_element.slippery_type, "slippery", NULL, "where other elements fall down" }, - - /* ---------- element settings: configure 2 (custom elements) ----------- */ - { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(1), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(9), GADGET_ID_CUSTOM_DEADLINESS, GADGET_ID_NONE, -1, options_deadliness, @@ -1599,18 +1671,18 @@ static struct "deadly when", NULL, "deadliness of element" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(2), - GADGET_ID_CUSTOM_CONSISTENCY, GADGET_ID_NONE, + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(10), + GADGET_ID_CUSTOM_EXPLOSION_TYPE, GADGET_ID_NONE, -1, - options_consistency, - &custom_element.consistency, - NULL, NULL, "consistency/destructibility" + options_explosion_type, + &custom_element.explosion_type, + "can explode", NULL, "explosion type" }, /* ---------- element settings: advanced (custom elements) --------------- */ { - ED_SETTINGS_XPOS(2), ED_SETTINGS_YPOS(3), + ED_ELEMENT_SETTINGS_XPOS(2), ED_ELEMENT_SETTINGS_YPOS(3), GADGET_ID_CHANGE_TIME_UNITS, GADGET_ID_NONE, -1, options_time_units, @@ -1618,7 +1690,7 @@ static struct "delay time given in", NULL, "delay time units for change" }, { - ED_SETTINGS_XPOS(2), ED_SETTINGS_YPOS(4), + ED_ELEMENT_SETTINGS_XPOS(2), ED_ELEMENT_SETTINGS_YPOS(4), GADGET_ID_CHANGE_DIRECT_ACTION, GADGET_ID_NONE, -1, options_change_direct_action, @@ -1626,7 +1698,7 @@ static struct NULL, NULL, "type of direct action" }, { - ED_SETTINGS_XPOS(2), ED_SETTINGS_YPOS(5), + ED_ELEMENT_SETTINGS_XPOS(2), ED_ELEMENT_SETTINGS_YPOS(5), GADGET_ID_CHANGE_OTHER_ACTION, GADGET_ID_NONE, -1, options_change_other_action, @@ -1634,7 +1706,7 @@ static struct NULL, "element:", "type of other element action" }, { - ED_SETTINGS_XPOS(2), ED_SETTINGS_YPOS(6), + ED_ELEMENT_SETTINGS_XPOS(2), ED_ELEMENT_SETTINGS_YPOS(6), GADGET_ID_CHANGE_SIDE, GADGET_ID_NONE, -1, options_change_trigger_side, @@ -1642,7 +1714,7 @@ static struct "at", "side", "element side that causes change" }, { - ED_SETTINGS_XPOS(2), ED_SETTINGS_YPOS(7), + ED_ELEMENT_SETTINGS_XPOS(2), ED_ELEMENT_SETTINGS_YPOS(7), GADGET_ID_CHANGE_PLAYER, GADGET_ID_NONE, -1, options_change_trigger_player, @@ -1650,7 +1722,7 @@ static struct "player:", " ", "player that causes change" }, { - ED_SETTINGS_XPOS(2), ED_SETTINGS_YPOS(7), + ED_ELEMENT_SETTINGS_XPOS(2), ED_ELEMENT_SETTINGS_YPOS(7), GADGET_ID_CHANGE_PAGE, GADGET_ID_CHANGE_PLAYER, -1, options_change_trigger_page, @@ -1658,7 +1730,7 @@ static struct "page:", NULL, "change page that causes change" }, { - ED_SETTINGS_XPOS(2), ED_SETTINGS_YPOS(10), + ED_ELEMENT_SETTINGS_XPOS(2), ED_ELEMENT_SETTINGS_YPOS(10), GADGET_ID_CHANGE_REPLACE_WHEN, GADGET_ID_NONE, -1, options_change_replace_when, @@ -1666,7 +1738,7 @@ static struct "replace when", NULL, "which elements can be replaced" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(14), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(14), GADGET_ID_SELECT_CHANGE_PAGE, GADGET_ID_NONE, 3, options_change_page, @@ -1677,7 +1749,7 @@ static struct /* ---------- element settings: configure (group elements) --------------- */ { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(6), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(6), GADGET_ID_GROUP_CHOICE_MODE, GADGET_ID_NONE, -1, options_group_choice_mode, @@ -1698,69 +1770,69 @@ static struct { #if 1 { - ED_SETTINGS_XPOS(0), ED_COUNTER_YPOS(1), + ED_ELEMENT_SETTINGS_XPOS(0), ED_COUNTER_YPOS(1), GADGET_ID_PROPERTIES_INFO, GADGET_ID_NONE, 8, "Info", NULL, NULL, "Show information about element" }, { - ED_SETTINGS_XPOS(0) + 124, ED_COUNTER_YPOS(1), + ED_ELEMENT_SETTINGS_XPOS(0) + 124, ED_COUNTER_YPOS(1), GADGET_ID_PROPERTIES_CONFIG, GADGET_ID_NONE, 8, "Config", NULL, NULL, "Configure element properties" }, { - ED_SETTINGS_XPOS(0) + 124, ED_COUNTER_YPOS(1), + ED_ELEMENT_SETTINGS_XPOS(0) + 124, ED_COUNTER_YPOS(1), GADGET_ID_PROPERTIES_CONFIG_1, GADGET_ID_NONE, 8, "Config 1", NULL, NULL, "Configure custom element properties" }, { - ED_SETTINGS_XPOS(0) + 248, ED_COUNTER_YPOS(1), + ED_ELEMENT_SETTINGS_XPOS(0) + 248, ED_COUNTER_YPOS(1), GADGET_ID_PROPERTIES_CONFIG_2, GADGET_ID_NONE, 8, "Config 2", NULL, NULL, "Configure custom element properties" }, { - ED_SETTINGS_XPOS(0) + 372, ED_COUNTER_YPOS(1), + ED_ELEMENT_SETTINGS_XPOS(0) + 372, ED_COUNTER_YPOS(1), GADGET_ID_PROPERTIES_CHANGE, GADGET_ID_NONE, 8, "Change", NULL, NULL, "Custom element change configuration" }, #else { - ED_SETTINGS_XPOS(0), ED_COUNTER_YPOS(1), + ED_ELEMENT_SETTINGS_XPOS(0), ED_COUNTER_YPOS(1), GADGET_ID_PROPERTIES_INFO, GADGET_ID_NONE, 11, "Information", NULL, NULL, "Show information about element" }, { - ED_SETTINGS_XPOS(0) + 166, ED_COUNTER_YPOS(1), + ED_ELEMENT_SETTINGS_XPOS(0) + 166, ED_COUNTER_YPOS(1), GADGET_ID_PROPERTIES_CONFIG, GADGET_ID_NONE, 11, "Configure", NULL, NULL, "Configure element properties" }, { - ED_SETTINGS_XPOS(0) + 332, ED_COUNTER_YPOS(1), + ED_ELEMENT_SETTINGS_XPOS(0) + 332, ED_COUNTER_YPOS(1), GADGET_ID_PROPERTIES_CHANGE, GADGET_ID_NONE, 11, "Advanced", NULL, NULL, "Advanced element configuration" }, #endif { - -1, ED_SETTINGS_YPOS(2), + -1, ED_ELEMENT_SETTINGS_YPOS(2), GADGET_ID_SAVE_AS_TEMPLATE, GADGET_ID_CUSTOM_USE_TEMPLATE, -1, "Save", " ", "As Template", "Save current settings as new template" }, { - -1, ED_SETTINGS_YPOS(14), + -1, ED_ELEMENT_SETTINGS_YPOS(14), GADGET_ID_ADD_CHANGE_PAGE, GADGET_ID_PASTE_CHANGE_PAGE, -1, "New", NULL, NULL, "Add new change page" }, { - -1, ED_SETTINGS_YPOS(14), + -1, ED_ELEMENT_SETTINGS_YPOS(14), GADGET_ID_DEL_CHANGE_PAGE, GADGET_ID_ADD_CHANGE_PAGE, -1, "Delete", NULL, NULL, "Delete current change page" @@ -1779,28 +1851,28 @@ static struct { { ED_BUTTON_MINUS_XPOS, ED_BUTTON_COUNT_YPOS, - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(14), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(14), ED_BUTTON_COUNT_XSIZE, ED_BUTTON_COUNT_YSIZE, GADGET_ID_PREV_CHANGE_PAGE, GADGET_ID_NONE, NULL, NULL, "select previous change page" }, { ED_BUTTON_PLUS_XPOS, ED_BUTTON_COUNT_YPOS, - -1, ED_SETTINGS_YPOS(14), + -1, ED_ELEMENT_SETTINGS_YPOS(14), ED_BUTTON_COUNT_XSIZE, ED_BUTTON_COUNT_YSIZE, GADGET_ID_NEXT_CHANGE_PAGE, GADGET_ID_SELECT_CHANGE_PAGE, NULL, "change page", "select next change page" }, { ED_COPY_CHANGE_PAGE_XPOS, ED_COPY_CHANGE_PAGE_YPOS, - -1, ED_SETTINGS_YPOS(14), + -1, ED_ELEMENT_SETTINGS_YPOS(14), ED_BUTTON_COUNT_XSIZE, ED_BUTTON_COUNT_YSIZE, GADGET_ID_COPY_CHANGE_PAGE, GADGET_ID_NEXT_CHANGE_PAGE, " ", NULL, "copy settings from this change page" }, { ED_PASTE_CHANGE_PAGE_XPOS, ED_PASTE_CHANGE_PAGE_YPOS, - -1, ED_SETTINGS_YPOS(14), + -1, ED_ELEMENT_SETTINGS_YPOS(14), ED_BUTTON_COUNT_XSIZE, ED_BUTTON_COUNT_YSIZE, GADGET_ID_PASTE_CHANGE_PAGE, GADGET_ID_COPY_CHANGE_PAGE, NULL, NULL, "paste settings to this change page" @@ -1928,19 +2000,14 @@ static struct /* ---------- level and editor settings ---------------------------------- */ { - ED_SETTINGS_XPOS(0), ED_COUNTER_YPOS(6) - MINI_TILEY, - GADGET_ID_DOUBLE_SPEED, GADGET_ID_NONE, - &level.double_speed, - NULL, "double speed movement", "set movement speed of player" - }, - { - -1, ED_COUNTER_YPOS(6) - MINI_TILEY, - GADGET_ID_GRAVITY, GADGET_ID_DOUBLE_SPEED, + ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(11), + GADGET_ID_INITIAL_GRAVITY, GADGET_ID_NONE, &level.initial_gravity, - " ", "gravity", "set level gravity" + NULL, + "initial gravity", "set initial level gravity" }, { - ED_SETTINGS_XPOS(0), ED_COUNTER2_YPOS(9) - MINI_TILEY, + ED_LEVEL_SETTINGS_XPOS(0), ED_COUNTER2_YPOS(9) - MINI_TILEY, GADGET_ID_RANDOM_RESTRICTED, GADGET_ID_NONE, &random_placement_background_restricted, NULL, @@ -1950,77 +2017,84 @@ static struct /* ---------- element settings: configure (various elements) ------------- */ { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(0), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(0), GADGET_ID_STICK_ELEMENT, GADGET_ID_NONE, &stick_element_properties_window, NULL, "stick this screen to edit content","stick this screen to edit content" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(1), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1), GADGET_ID_EM_SLIPPERY_GEMS, GADGET_ID_NONE, &level.em_slippery_gems, NULL, "slip down from certain flat walls","use EM style slipping behaviour" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(1), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1), GADGET_ID_USE_SPRING_BUG, GADGET_ID_NONE, &level.use_spring_bug, NULL, "use spring pushing bug", "use odd spring pushing behaviour" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(0), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(0), GADGET_ID_GROW_INTO_DIGGABLE, GADGET_ID_NONE, &level.grow_into_diggable, NULL, "can grow into anything diggable", "grow into more than just sand" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(1), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(4), + GADGET_ID_DOUBLE_SPEED, GADGET_ID_NONE, + &level.double_speed, + NULL, + "double speed movement", "set initial movement speed of player" + }, + { + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1), GADGET_ID_BLOCK_LAST_FIELD, GADGET_ID_NONE, &level.block_last_field, NULL, "block last field when moving", "player blocks last field when moving" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(1), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1), GADGET_ID_SP_BLOCK_LAST_FIELD, GADGET_ID_NONE, &level.sp_block_last_field, NULL, "block last field when moving", "player blocks last field when moving" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(2), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(2), GADGET_ID_INSTANT_RELOCATION, GADGET_ID_NONE, &level.instant_relocation, NULL, "no scrolling when relocating", "player gets relocated without delay" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(3), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(3), GADGET_ID_CAN_PASS_TO_WALKABLE, GADGET_ID_NONE, &level.can_pass_to_walkable, NULL, "can pass to walkable element", "player can pass to empty or walkable" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(0), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(0), GADGET_ID_CAN_FALL_INTO_ACID, GADGET_ID_NONE, &custom_element_properties[EP_CAN_MOVE_INTO_ACID], NULL, "can fall into acid (with gravity)","player can fall into acid pool" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(0), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(0), GADGET_ID_CAN_MOVE_INTO_ACID, GADGET_ID_NONE, &custom_element_properties[EP_CAN_MOVE_INTO_ACID], NULL, "can move into acid", "element can move into acid pool" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(1), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1), GADGET_ID_DONT_COLLIDE_WITH, GADGET_ID_NONE, &custom_element_properties[EP_DONT_COLLIDE_WITH], NULL, @@ -2030,133 +2104,151 @@ static struct /* ---------- element settings: configure 1 (custom elements) ----------- */ { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(1), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1), GADGET_ID_CUSTOM_USE_GRAPHIC, GADGET_ID_NONE, &custom_element.use_gfx_element, - NULL, "use graphic of element:", "use graphic for custom 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), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(2), GADGET_ID_CUSTOM_USE_TEMPLATE, GADGET_ID_NONE, &level.use_custom_template, NULL, "use template", "use template for custom properties" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(3), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(3), GADGET_ID_CUSTOM_ACCESSIBLE, GADGET_ID_NONE, &custom_element_properties[EP_ACCESSIBLE], NULL, NULL, "player can walk to or pass this field" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(5), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(10), + GADGET_ID_CUSTOM_GRAV_REACHABLE, GADGET_ID_NONE, + &custom_element_properties[EP_GRAVITY_REACHABLE], + NULL, "reachable despite gravity", "player can walk/dig despite gravity" + }, + { + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(5), GADGET_ID_CUSTOM_WALK_TO_OBJECT, GADGET_ID_NONE, &custom_element_properties[EP_WALK_TO_OBJECT], NULL, NULL, "player can dig/collect/push element" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(9), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(9), + GADGET_ID_CUSTOM_INDESTRUCTIBLE, GADGET_ID_NONE, + &custom_element_properties[EP_INDESTRUCTIBLE], + NULL, "indestructible", "element is indestructible" + }, + + /* ---------- element settings: configure 2 (custom elements) ----------- */ + + { + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1), GADGET_ID_CUSTOM_CAN_MOVE, GADGET_ID_NONE, &custom_element_properties[EP_CAN_MOVE], - NULL, NULL, "element can move in some direction" + NULL, NULL, "element can move with some pattern" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(13), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(7), GADGET_ID_CUSTOM_CAN_FALL, GADGET_ID_NONE, &custom_element_properties[EP_CAN_FALL], NULL, "can fall", "element can fall down" }, { - -1, ED_SETTINGS_YPOS(13), + -1, ED_ELEMENT_SETTINGS_YPOS(7), GADGET_ID_CUSTOM_CAN_SMASH, GADGET_ID_CUSTOM_CAN_FALL, &custom_element_properties[EP_CAN_SMASH], " ", NULL, "element can smash other elements" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(14), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(8), GADGET_ID_CUSTOM_SLIPPERY, GADGET_ID_NONE, &custom_element_properties[EP_SLIPPERY], NULL, NULL, "other elements can fall down from it" }, - - /* ---------- element settings: configure 2 (custom elements) ----------- */ - { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(1), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(9), GADGET_ID_CUSTOM_DEADLY, GADGET_ID_NONE, &custom_element_properties[EP_DEADLY], NULL, NULL, "element can kill the player" }, { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(2), - GADGET_ID_CUSTOM_EXPLODE_RESULT, GADGET_ID_NONE, - &custom_element_properties[EP_EXPLODE_RESULT], - NULL, NULL, "set consistency/destructibility" + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(10), + GADGET_ID_CUSTOM_CAN_EXPLODE, GADGET_ID_NONE, + &custom_element_properties[EP_CAN_EXPLODE], + NULL, NULL, "element can explode" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(3), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(11), GADGET_ID_CUSTOM_EXPLODE_FIRE, GADGET_ID_NONE, - &custom_element.can_explode_by_fire, + &custom_element_properties[EP_EXPLODES_BY_FIRE], NULL, "by fire", "element can explode by fire/explosion" }, { - -1, ED_SETTINGS_YPOS(3), + -1, ED_ELEMENT_SETTINGS_YPOS(11), GADGET_ID_CUSTOM_EXPLODE_SMASH, GADGET_ID_CUSTOM_EXPLODE_FIRE, - &custom_element.can_explode_smashed, + &custom_element_properties[EP_EXPLODES_SMASHED], " ", "smashed", "element can explode when smashed" }, { - -1, ED_SETTINGS_YPOS(3), + -1, ED_ELEMENT_SETTINGS_YPOS(11), GADGET_ID_CUSTOM_EXPLODE_IMPACT, GADGET_ID_CUSTOM_EXPLODE_SMASH, - &custom_element.can_explode_impact, + &custom_element_properties[EP_EXPLODES_IMPACT], " ", "impact", "element can explode on impact" }, /* ---------- element settings: advanced (custom elements) --------------- */ { - ED_SETTINGS_XPOS(0), ED_SETTINGS_YPOS(1), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1), GADGET_ID_CUSTOM_CAN_CHANGE, GADGET_ID_NONE, &custom_element_change.can_change, NULL, "element changes to:", "element can change to other element" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(2), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(2), GADGET_ID_CHANGE_DELAY, GADGET_ID_NONE, &custom_element_change_events[CE_DELAY], NULL, NULL, "element changes after delay" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(4), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(4), GADGET_ID_CHANGE_BY_DIRECT_ACT, GADGET_ID_NONE, &custom_element_change_events[CE_BY_DIRECT_ACTION], NULL, NULL, "element changes by direct action" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(5), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(5), GADGET_ID_CHANGE_BY_OTHER_ACT, GADGET_ID_NONE, &custom_element_change_events[CE_BY_OTHER_ACTION], NULL, NULL, "element changes by other element" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(8), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(8), GADGET_ID_CHANGE_USE_EXPLOSION, GADGET_ID_NONE, &custom_element_change.explode, NULL, "explode instead of change", "element explodes instead of change" }, { - ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(9), + ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(9), GADGET_ID_CHANGE_USE_CONTENT, GADGET_ID_NONE, &custom_element_change.use_target_content, NULL, "use extended change target:","element changes to more elements" }, { - ED_SETTINGS_XPOS(2), ED_SETTINGS_YPOS(11), + ED_ELEMENT_SETTINGS_XPOS(2), ED_ELEMENT_SETTINGS_YPOS(11), GADGET_ID_CHANGE_ONLY_COMPLETE, GADGET_ID_NONE, &custom_element_change.only_if_complete, NULL, "replace all or nothing", "only replace when all can be changed" }, { - ED_SETTINGS_XPOS(2), ED_SETTINGS_YPOS(12), + ED_ELEMENT_SETTINGS_XPOS(2), ED_ELEMENT_SETTINGS_YPOS(12), GADGET_ID_CHANGE_USE_RANDOM, GADGET_ID_NONE, &custom_element_change.use_random_replace, NULL, NULL, "use percentage for random replace" @@ -2186,49 +2278,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" }, @@ -2241,6 +2384,8 @@ static struct "content:", NULL, NULL }, + /* ---------- element settings: configure 1 (custom elements) ----------- */ + /* ---------- custom graphic --------------------------------------------- */ { @@ -2250,10 +2395,12 @@ static struct NULL, NULL, NULL }, + /* ---------- element settings: configure 2 (custom elements) ----------- */ + /* ---------- custom content (when exploding) ---------------------------- */ { - -1, ED_AREA_3X3_SETTINGS_YPOS(2), + -1, ED_AREA_3X3_SETTINGS_YPOS(10), 3, 3, GADGET_ID_CUSTOM_CONTENT, GADGET_ID_NONE, /* align three rows */ "content:", NULL, NULL @@ -2262,18 +2409,20 @@ static struct /* ---------- custom enter and leave element (when moving) --------------- */ { - ED_AREA_1X1_SETTINGS_XPOS(1), ED_AREA_1X1_SETTINGS_YPOS(11), + ED_AREA_1X1_SETTINGS_XPOS(1), ED_AREA_1X1_SETTINGS_YPOS(3), 1, 1, GADGET_ID_CUSTOM_MOVE_ENTER, GADGET_ID_NONE, "can dig:", " ", NULL }, { - -1, ED_AREA_1X1_SETTINGS_YPOS(11), + -1, ED_AREA_1X1_SETTINGS_YPOS(3), 1, 1, GADGET_ID_CUSTOM_MOVE_LEAVE, GADGET_ID_CUSTOM_MOVE_LEAVE_TYPE, NULL, NULL, NULL }, + /* ---------- element settings: advanced (custom elements) --------------- */ + /* ---------- custom change target --------------------------------------- */ { @@ -2313,7 +2462,7 @@ static struct /* ---------- random background (for random painting) -------------------- */ { - -1, ED_SETTINGS_YPOS(14), + -1, ED_ELEMENT_SETTINGS_YPOS(14), 1, 1, GADGET_ID_RANDOM_BACKGROUND, GADGET_ID_RANDOM_RESTRICTED, NULL, NULL, NULL @@ -2545,6 +2694,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_EMC_KEY_5, + EL_EMC_KEY_6, + EL_EMC_KEY_7, + EL_EMC_KEY_8, + + EL_EMC_GATE_5, + EL_EMC_GATE_6, + EL_EMC_GATE_7, + EL_EMC_GATE_8, + + EL_EMC_GATE_5_GRAY, + EL_EMC_GATE_6_GRAY, + EL_EMC_GATE_7_GRAY, + EL_EMC_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_EMC_FAKE_GRASS, + 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'), @@ -2622,13 +2871,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, @@ -2639,16 +2883,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; @@ -2874,7 +3108,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, @@ -3522,6 +3756,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, @@ -3858,7 +4097,11 @@ static void ReinitializeElementList() checked_free(editor_elements); +#if 0 if (!initialized) +#else + /* reload user defined element list for each invocation of level editor */ +#endif { /* initialize optional user defined element list */ LoadUserDefinedEditorElementList(&editor_el_user_defined_ptr, @@ -4057,10 +4300,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++) @@ -4068,6 +4311,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) @@ -5123,8 +5377,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); @@ -5331,13 +5586,15 @@ static void MapCheckbuttonGadget(int id) int xoffset_left = getTextWidthForGadget(checkbutton_info[id].text_left); int xoffset_right = ED_GADGET_TEXT_DISTANCE; int yoffset = ED_BORDER_SIZE; - int x_left = gi->x - xoffset_left; - int x_right = gi->x + gi->width + xoffset_right; - int y; /* set after gadget position was modified */ + int x_left, x_right, y; /* set after gadget position was modified */ - /* set position for gadgets with dynamically determined vertical position */ + /* set position for gadgets with dynamically determined position */ + if (checkbutton_info[id].x != -1) /* do not change dynamic positions */ + ModifyGadget(gi, GDI_X, SX + checkbutton_info[id].x, GDI_END); ModifyGadget(gi, GDI_Y, SY + checkbutton_info[id].y, GDI_END); + x_left = gi->x - xoffset_left; + x_right = gi->x + gi->width + xoffset_right; y = gi->y + yoffset; if (checkbutton_info[id].text_left) @@ -5479,6 +5736,8 @@ static void ResetUndoBuffer() undo_buffer_position = -1; undo_buffer_steps = -1; CopyLevelToUndoBuffer(UNDO_IMMEDIATE); + + level.changed = FALSE; } static void DrawEditModeWindow() @@ -5496,15 +5755,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() @@ -5512,6 +5774,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 || @@ -5625,6 +5889,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; @@ -5710,6 +5975,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)) { @@ -5723,6 +5990,10 @@ static boolean CopyCustomElement(int element_old, int element_new, return FALSE; } + else + { + level.changed = TRUE; + } if (copy_mode == GADGET_ID_CUSTOM_COPY_FROM) { @@ -5845,19 +6116,28 @@ static void CopyCustomElementPropertiesToEditor(int element) DONT_COLLIDE_WITH(element) || DONT_RUN_INTO(element)); - /* set consistency selectbox help value */ - custom_element.consistency = - (IS_INDESTRUCTIBLE(element) ? EP_INDESTRUCTIBLE : +#if 0 + /* set explosion type selectbox help value */ + custom_element.explosion_type = + ( +#if 0 + IS_INDESTRUCTIBLE(element) ? EP_INDESTRUCTIBLE : +#endif CAN_EXPLODE_1X1(element) ? EP_CAN_EXPLODE_1X1 : CAN_EXPLODE_3X3(element) ? EP_CAN_EXPLODE_3X3 : CAN_EXPLODE_CROSS(element) ? EP_CAN_EXPLODE_CROSS : - custom_element.consistency); - custom_element_properties[EP_EXPLODE_RESULT] = - (IS_INDESTRUCTIBLE(element) || + custom_element.explosion_type); + custom_element_properties[EP_CAN_EXPLODE_AT_ALL] = + ( +#if 0 + IS_INDESTRUCTIBLE(element) || +#endif CAN_EXPLODE_1X1(element) || CAN_EXPLODE_3X3(element) || CAN_EXPLODE_CROSS(element)); +#endif +#if 0 /* special case: sub-settings dependent from main setting */ #if 0 custom_element.can_explode_by_fire = CAN_EXPLODE_BY_FIRE(element); @@ -5870,6 +6150,7 @@ static void CopyCustomElementPropertiesToEditor(int element) custom_element.can_explode_smashed = TRUE; if (CAN_EXPLODE_IMPACT(element)) custom_element.can_explode_impact = TRUE; +#endif #endif /* ---------- element settings: advanced (custom elements) --------------- */ @@ -5952,10 +6233,13 @@ static void CopyCustomElementPropertiesToGame(int element) { int i; int access_type_and_layer; +#if 0 boolean can_explode; +#endif /* mark that this custom element has been modified */ custom_element.modified_settings = TRUE; + level.changed = TRUE; if (level.use_custom_template) { @@ -6017,17 +6301,22 @@ static void CopyCustomElementPropertiesToGame(int element) custom_element_properties[custom_element.deadliness] = custom_element_properties[EP_DEADLY]; - /* set consistency property from checkbox and selectbox */ +#if 0 + /* set explosion type property from checkbox and selectbox */ +#if 0 custom_element_properties[EP_INDESTRUCTIBLE] = FALSE; +#endif custom_element_properties[EP_CAN_EXPLODE_1X1] = FALSE; custom_element_properties[EP_CAN_EXPLODE_3X3] = FALSE; custom_element_properties[EP_CAN_EXPLODE_CROSS] = FALSE; custom_element_properties[EP_CAN_EXPLODE_BY_FIRE] = FALSE; custom_element_properties[EP_CAN_EXPLODE_SMASHED] = FALSE; custom_element_properties[EP_CAN_EXPLODE_IMPACT] = FALSE; - custom_element_properties[custom_element.consistency] = - custom_element_properties[EP_EXPLODE_RESULT]; + custom_element_properties[custom_element.explosion_type] = + custom_element_properties[EP_CAN_EXPLODE_AT_ALL]; +#endif +#if 0 /* special case: sub-settings dependent from main setting */ #if 0 can_explode = (custom_element_properties[EP_CAN_EXPLODE_1X1] || @@ -6051,6 +6340,7 @@ static void CopyCustomElementPropertiesToGame(int element) custom_element_properties[EP_CAN_EXPLODE_IMPACT] = custom_element.can_explode_impact; } +#endif #endif /* ---------- element settings: advanced (custom elements) --------------- */ @@ -6107,6 +6397,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) @@ -6465,7 +6756,7 @@ static void DrawCustomContentArea() int id = ED_DRAWING_ID_CUSTOM_CONTENT; struct GadgetInfo *gi = level_editor_gadget[drawingarea_info[id].gadget_id]; int x1 = right_gadget_border[GADGET_ID_CUSTOM_DEADLINESS]; - int x2 = right_gadget_border[GADGET_ID_CUSTOM_CONSISTENCY]; + int x2 = right_gadget_border[GADGET_ID_CUSTOM_EXPLOSION_TYPE]; int x3 = right_gadget_border[GADGET_ID_CUSTOM_EXPLODE_IMPACT]; int xoffset = ED_DRAWINGAREA_TEXT_DISTANCE; @@ -6491,24 +6782,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 */ @@ -6524,6 +6818,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; @@ -6594,8 +6902,8 @@ char *getElementDescriptionFilename(int element) static boolean PrintInfoText(char *text, int font_nr, int start_line) { int font_height = getFontHeight(font_nr); - int pad_x = ED_SETTINGS_XPOS(0); - int pad_y = ED_SETTINGS_YPOS(0) + ED_BORDER_SIZE; + int pad_x = ED_ELEMENT_SETTINGS_XPOS(0); + int pad_y = ED_ELEMENT_SETTINGS_YPOS(0) + ED_BORDER_SIZE; int sx = SX + pad_x; int sy = SY + pad_y; int max_lines_per_screen = (SYSIZE - pad_y) / font_height - 1; @@ -6615,8 +6923,8 @@ static int PrintElementDescriptionFromFile(char *filename, int start_line) int font_nr = FONT_TEXT_2; int font_width = getFontWidth(font_nr); int font_height = getFontHeight(font_nr); - int pad_x = ED_SETTINGS_XPOS(0); - int pad_y = ED_SETTINGS_YPOS(0) + ED_BORDER_SIZE; + int pad_x = ED_ELEMENT_SETTINGS_XPOS(0); + int pad_y = ED_ELEMENT_SETTINGS_YPOS(0) + ED_BORDER_SIZE; int sx = SX + pad_x; int sy = SY + pad_y + start_line * font_height; int max_chars_per_line = (SXSIZE - 2 * pad_x) / font_width; @@ -6633,8 +6941,8 @@ static int PrintElementDescriptionFromFile(char *filename, int start_line) int font_nr = FONT_TEXT_2; int font_width = getFontWidth(font_nr); int font_height = getFontHeight(font_nr); - int pad_x = ED_SETTINGS_XPOS(0); - int pad_y = ED_SETTINGS_YPOS(0) + ED_BORDER_SIZE; + int pad_x = ED_ELEMENT_SETTINGS_XPOS(0); + int pad_y = ED_ELEMENT_SETTINGS_YPOS(0) + ED_BORDER_SIZE; int sx = SX + pad_x; int sy = SY + pad_y; int max_chars_per_line = (SXSIZE - 2 * pad_x) / font_width; @@ -6828,8 +7136,8 @@ static void DrawPropertiesInfo() int font2_nr = FONT_TEXT_2; int font1_width = getFontWidth(font1_nr); int font2_height = getFontHeight(font2_nr); - int pad_x = ED_SETTINGS_XPOS(0); - int pad_y = ED_SETTINGS_YPOS(0) + ED_BORDER_SIZE; + int pad_x = ED_ELEMENT_SETTINGS_XPOS(0); + int pad_y = ED_ELEMENT_SETTINGS_YPOS(0) + ED_BORDER_SIZE; int screen_line = 0; int i, x, y; @@ -6895,9 +7203,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 { @@ -6968,12 +7280,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_EMC_KEY_5, &level.score[SC_KEY], TEXT_COLLECTING }, + { EL_EMC_KEY_6, &level.score[SC_KEY], TEXT_COLLECTING }, + { EL_EMC_KEY_7, &level.score[SC_KEY], TEXT_COLLECTING }, + { EL_EMC_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 } }; @@ -7001,6 +7329,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)) @@ -7010,25 +7340,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) + + ED_ELEMENT_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; } } @@ -7039,10 +7376,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); @@ -7051,6 +7391,7 @@ static void DrawPropertiesConfig() ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_INSTANT_RELOCATION); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_CAN_PASS_TO_WALKABLE); + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_DOUBLE_SPEED); } if (IS_GEM(properties_element)) @@ -7062,8 +7403,10 @@ static void DrawPropertiesConfig() edit_mode_properties == ED_MODE_PROPERTIES_CONFIG_2)) { /* set position for checkbutton for "can move into acid" */ + checkbutton_info[ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID].x = + ED_ELEMENT_SETTINGS_XPOS(IS_CUSTOM_ELEMENT(properties_element) ? 1 : 0); checkbutton_info[ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID].y = - ED_SETTINGS_YPOS(IS_CUSTOM_ELEMENT(properties_element) ? 6 : + ED_ELEMENT_SETTINGS_YPOS(IS_CUSTOM_ELEMENT(properties_element) ? 6 : HAS_CONTENT(properties_element) ? 1 : 0); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID); @@ -7078,7 +7421,7 @@ static void DrawPropertiesConfig() if (CAN_GROW(properties_element)) { checkbutton_info[ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE].y = - ED_SETTINGS_YPOS(HAS_CONTENT(properties_element) ? 1 : 0); + ED_ELEMENT_SETTINGS_YPOS(HAS_CONTENT(properties_element) ? 1 : 0); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE); } @@ -7129,8 +7472,6 @@ static void DrawPropertiesConfig() /* draw drawing area gadgets */ MapDrawingArea(ED_DRAWING_ID_CUSTOM_GRAPHIC); - MapDrawingArea(ED_DRAWING_ID_CUSTOM_MOVE_ENTER); - MapDrawingArea(ED_DRAWING_ID_CUSTOM_MOVE_LEAVE); } else if (edit_mode_properties == ED_MODE_PROPERTIES_CONFIG_2) { @@ -7150,6 +7491,8 @@ static void DrawPropertiesConfig() MapSelectboxGadget(i); /* draw drawing area gadgets */ + MapDrawingArea(ED_DRAWING_ID_CUSTOM_MOVE_ENTER); + MapDrawingArea(ED_DRAWING_ID_CUSTOM_MOVE_LEAVE); DrawCustomContentArea(); } } @@ -7237,7 +7580,7 @@ static void DrawElementName(int x, int y, int element) int font_nr = FONT_TEXT_1; int font_width = getFontWidth(font_nr); int font_height = getFontHeight(font_nr); - int max_text_width = SXSIZE - x - ED_SETTINGS_XPOS(0); + int max_text_width = SXSIZE - x - ED_ELEMENT_SETTINGS_XPOS(0); int max_chars_per_line = max_text_width / font_width; char buffer[max_chars_per_line + 1]; @@ -7852,6 +8195,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; @@ -7940,56 +8285,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--; + } } } @@ -8202,9 +8547,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; @@ -8324,13 +8673,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; @@ -8362,6 +8718,7 @@ static void HandleCounterButtons(struct GadgetInfo *gi) { if (gadget_id == counterbutton_info[counter_id].gadget_id_text) ModifyEditorCounter(counter_id, *counter_value); + return; } } @@ -8371,10 +8728,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: @@ -8393,13 +8760,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; } @@ -8409,6 +8769,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) @@ -8423,6 +8785,8 @@ static void HandleTextInputGadgets(struct GadgetInfo *gi) ModifyEditorElementList(); /* update changed button info text */ } + + level.changed = TRUE; } static void HandleTextAreaGadgets(struct GadgetInfo *gi) @@ -8430,6 +8794,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) @@ -8450,7 +8816,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) @@ -8491,6 +8861,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) @@ -8504,6 +8876,8 @@ static void HandleTextbuttonGadgets(struct GadgetInfo *gi) setElementChangePages(ei, ei->num_change_pages - 1); DrawPropertiesWindow(); + + level.changed = TRUE; } } @@ -8537,9 +8911,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(); } } @@ -8548,6 +8926,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) @@ -8590,6 +8970,8 @@ static void HandleCheckbuttons(struct GadgetInfo *gi) DrawEditModeWindow(); } + + level.changed = TRUE; } static void HandleControlButtons(struct GadgetInfo *gi) @@ -8855,6 +9237,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); @@ -8867,7 +9250,7 @@ static void HandleControlButtons(struct GadgetInfo *gi) break; } - if (!LevelContainsPlayer) + if (!LevelContainsPlayer()) Request("No Level without Gregor Mc Duffin please !", REQ_CONFIRM); else { @@ -8884,11 +9267,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 { @@ -8898,6 +9283,8 @@ static void HandleControlButtons(struct GadgetInfo *gi) CopyPlayfield(level.field, FieldBackup); CopyPlayfield(Feld, level.field); + CopyNativeLevel_RND_to_Native(&level); + UnmapLevelEditorGadgets(); UndrawSpecialEditorDoor(); @@ -9018,7 +9405,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; @@ -9283,9 +9678,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); } @@ -9311,10 +9709,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'; @@ -9342,9 +9744,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); } }