/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* (c) 1995-2002 Artsoft Entertainment *
+* (c) 1995-2006 Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
/* yamyam content */
#define ED_AREA_YAMYAM_CONTENT_XPOS(n) (2 * MINI_TILEX + \
5 * ((n) % 4) * MINI_TILEX)
-#define ED_AREA_YAMYAM_CONTENT_YPOS(n) (17 * MINI_TILEY + \
+#define ED_AREA_YAMYAM_CONTENT_YPOS(n) (11 * ED_SETTINGS_YOFFSET + \
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 + \
+#define ED_AREA_MAGIC_BALL_CONTENT_YPOS(n) (12 * ED_SETTINGS_YOFFSET + \
6 * ((n) / 4) * MINI_TILEY)
/* values for scrolling gadgets for drawing area */
#define ED_TEXTBUTTON_XSIZE ED_WIN_COUNT_XSIZE
#define ED_TEXTBUTTON_YSIZE ED_WIN_COUNT_YSIZE
-/* values for ClearEditorGadgetInfoText() and HandleGadgetInfoText() */
+/* values for ClearEditorGadgetInfoText() and HandleEditorGadgetInfoText() */
#define INFOTEXT_XPOS SX
#define INFOTEXT_YPOS (SY + SYSIZE - MINI_TILEX + 2)
#define INFOTEXT_XSIZE SXSIZE
#define GADGET_ID_CUSTOM_COPY (GADGET_ID_TOOLBOX_FIRST + 25)
#define GADGET_ID_CUSTOM_PASTE (GADGET_ID_TOOLBOX_FIRST + 26)
-/* counter button identifiers */
+/* counter gadget identifiers */
#define GADGET_ID_COUNTER_FIRST (GADGET_ID_TOOLBOX_FIRST + 27)
#define GADGET_ID_SELECT_LEVEL_DOWN (GADGET_ID_COUNTER_FIRST + 0)
#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)
+#define GADGET_ID_ELEMENT_VALUE3_DOWN (GADGET_ID_COUNTER_FIRST + 27)
+#define GADGET_ID_ELEMENT_VALUE3_TEXT (GADGET_ID_COUNTER_FIRST + 28)
+#define GADGET_ID_ELEMENT_VALUE3_UP (GADGET_ID_COUNTER_FIRST + 29)
+#define GADGET_ID_ELEMENT_VALUE4_DOWN (GADGET_ID_COUNTER_FIRST + 30)
+#define GADGET_ID_ELEMENT_VALUE4_TEXT (GADGET_ID_COUNTER_FIRST + 31)
+#define GADGET_ID_ELEMENT_VALUE4_UP (GADGET_ID_COUNTER_FIRST + 32)
+#define GADGET_ID_YAMYAM_CONTENT_DOWN (GADGET_ID_COUNTER_FIRST + 33)
+#define GADGET_ID_YAMYAM_CONTENT_TEXT (GADGET_ID_COUNTER_FIRST + 34)
+#define GADGET_ID_YAMYAM_CONTENT_UP (GADGET_ID_COUNTER_FIRST + 35)
+#define GADGET_ID_BALL_CONTENT_DOWN (GADGET_ID_COUNTER_FIRST + 36)
+#define GADGET_ID_BALL_CONTENT_TEXT (GADGET_ID_COUNTER_FIRST + 37)
+#define GADGET_ID_BALL_CONTENT_UP (GADGET_ID_COUNTER_FIRST + 38)
+#define GADGET_ID_ANDROID_CONTENT_DOWN (GADGET_ID_COUNTER_FIRST + 39)
+#define GADGET_ID_ANDROID_CONTENT_TEXT (GADGET_ID_COUNTER_FIRST + 40)
+#define GADGET_ID_ANDROID_CONTENT_UP (GADGET_ID_COUNTER_FIRST + 41)
+#define GADGET_ID_ENVELOPE_XSIZE_DOWN (GADGET_ID_COUNTER_FIRST + 42)
+#define GADGET_ID_ENVELOPE_XSIZE_TEXT (GADGET_ID_COUNTER_FIRST + 43)
+#define GADGET_ID_ENVELOPE_XSIZE_UP (GADGET_ID_COUNTER_FIRST + 44)
+#define GADGET_ID_ENVELOPE_YSIZE_DOWN (GADGET_ID_COUNTER_FIRST + 45)
+#define GADGET_ID_ENVELOPE_YSIZE_TEXT (GADGET_ID_COUNTER_FIRST + 46)
+#define GADGET_ID_ENVELOPE_YSIZE_UP (GADGET_ID_COUNTER_FIRST + 47)
+#define GADGET_ID_CUSTOM_SCORE_DOWN (GADGET_ID_COUNTER_FIRST + 48)
+#define GADGET_ID_CUSTOM_SCORE_TEXT (GADGET_ID_COUNTER_FIRST + 49)
+#define GADGET_ID_CUSTOM_SCORE_UP (GADGET_ID_COUNTER_FIRST + 50)
+#define GADGET_ID_CUSTOM_GEMCOUNT_DOWN (GADGET_ID_COUNTER_FIRST + 51)
+#define GADGET_ID_CUSTOM_GEMCOUNT_TEXT (GADGET_ID_COUNTER_FIRST + 52)
+#define GADGET_ID_CUSTOM_GEMCOUNT_UP (GADGET_ID_COUNTER_FIRST + 53)
+#define GADGET_ID_CUSTOM_VALUE_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 54)
+#define GADGET_ID_CUSTOM_VALUE_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 55)
+#define GADGET_ID_CUSTOM_VALUE_FIX_UP (GADGET_ID_COUNTER_FIRST + 56)
+#define GADGET_ID_CUSTOM_VALUE_RND_DOWN (GADGET_ID_COUNTER_FIRST + 57)
+#define GADGET_ID_CUSTOM_VALUE_RND_TEXT (GADGET_ID_COUNTER_FIRST + 58)
+#define GADGET_ID_CUSTOM_VALUE_RND_UP (GADGET_ID_COUNTER_FIRST + 59)
+#define GADGET_ID_PUSH_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 60)
+#define GADGET_ID_PUSH_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 61)
+#define GADGET_ID_PUSH_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 62)
+#define GADGET_ID_PUSH_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 63)
+#define GADGET_ID_PUSH_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 64)
+#define GADGET_ID_PUSH_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 65)
+#define GADGET_ID_DROP_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 66)
+#define GADGET_ID_DROP_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 67)
+#define GADGET_ID_DROP_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 68)
+#define GADGET_ID_DROP_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 69)
+#define GADGET_ID_DROP_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 70)
+#define GADGET_ID_DROP_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 71)
+#define GADGET_ID_MOVE_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 72)
+#define GADGET_ID_MOVE_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 73)
+#define GADGET_ID_MOVE_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 74)
+#define GADGET_ID_MOVE_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 75)
+#define GADGET_ID_MOVE_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 76)
+#define GADGET_ID_MOVE_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 77)
+#define GADGET_ID_EXPLOSION_DELAY_DOWN (GADGET_ID_COUNTER_FIRST + 78)
+#define GADGET_ID_EXPLOSION_DELAY_TEXT (GADGET_ID_COUNTER_FIRST + 79)
+#define GADGET_ID_EXPLOSION_DELAY_UP (GADGET_ID_COUNTER_FIRST + 80)
+#define GADGET_ID_IGNITION_DELAY_DOWN (GADGET_ID_COUNTER_FIRST + 81)
+#define GADGET_ID_IGNITION_DELAY_TEXT (GADGET_ID_COUNTER_FIRST + 82)
+#define GADGET_ID_IGNITION_DELAY_UP (GADGET_ID_COUNTER_FIRST + 83)
+#define GADGET_ID_CHANGE_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 84)
+#define GADGET_ID_CHANGE_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 85)
+#define GADGET_ID_CHANGE_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 86)
+#define GADGET_ID_CHANGE_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 87)
+#define GADGET_ID_CHANGE_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 88)
+#define GADGET_ID_CHANGE_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 89)
+#define GADGET_ID_CHANGE_CONT_RND_DOWN (GADGET_ID_COUNTER_FIRST + 90)
+#define GADGET_ID_CHANGE_CONT_RND_TEXT (GADGET_ID_COUNTER_FIRST + 91)
+#define GADGET_ID_CHANGE_CONT_RND_UP (GADGET_ID_COUNTER_FIRST + 92)
+#define GADGET_ID_GROUP_CONTENT_DOWN (GADGET_ID_COUNTER_FIRST + 93)
+#define GADGET_ID_GROUP_CONTENT_TEXT (GADGET_ID_COUNTER_FIRST + 94)
+#define GADGET_ID_GROUP_CONTENT_UP (GADGET_ID_COUNTER_FIRST + 95)
/* drawing area identifiers */
-#define GADGET_ID_DRAWING_AREA_FIRST (GADGET_ID_COUNTER_FIRST + 78)
+#define GADGET_ID_DRAWING_AREA_FIRST (GADGET_ID_COUNTER_FIRST + 96)
#define GADGET_ID_DRAWING_LEVEL (GADGET_ID_DRAWING_AREA_FIRST + 0)
#define GADGET_ID_YAMYAM_CONTENT_0 (GADGET_ID_DRAWING_AREA_FIRST + 1)
#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)
+#define GADGET_ID_ANDROID_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 17)
+#define GADGET_ID_AMOEBA_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 18)
+#define GADGET_ID_START_ELEMENT (GADGET_ID_DRAWING_AREA_FIRST + 19)
+#define GADGET_ID_ARTWORK_ELEMENT (GADGET_ID_DRAWING_AREA_FIRST + 20)
+#define GADGET_ID_EXPLOSION_ELEMENT (GADGET_ID_DRAWING_AREA_FIRST + 21)
+#define GADGET_ID_CUSTOM_GRAPHIC (GADGET_ID_DRAWING_AREA_FIRST + 22)
+#define GADGET_ID_CUSTOM_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 23)
+#define GADGET_ID_CUSTOM_MOVE_ENTER (GADGET_ID_DRAWING_AREA_FIRST + 24)
+#define GADGET_ID_CUSTOM_MOVE_LEAVE (GADGET_ID_DRAWING_AREA_FIRST + 25)
+#define GADGET_ID_CUSTOM_CHANGE_TARGET (GADGET_ID_DRAWING_AREA_FIRST + 26)
+#define GADGET_ID_CUSTOM_CHANGE_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 27)
+#define GADGET_ID_CUSTOM_CHANGE_TRIGGER (GADGET_ID_DRAWING_AREA_FIRST + 28)
+#define GADGET_ID_GROUP_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 29)
+#define GADGET_ID_RANDOM_BACKGROUND (GADGET_ID_DRAWING_AREA_FIRST + 30)
/* text input identifiers */
-#define GADGET_ID_TEXT_INPUT_FIRST (GADGET_ID_DRAWING_AREA_FIRST + 27)
+#define GADGET_ID_TEXT_INPUT_FIRST (GADGET_ID_DRAWING_AREA_FIRST + 31)
#define GADGET_ID_LEVEL_NAME (GADGET_ID_TEXT_INPUT_FIRST + 0)
#define GADGET_ID_LEVEL_AUTHOR (GADGET_ID_TEXT_INPUT_FIRST + 1)
#define GADGET_ID_TIME_OR_STEPS (GADGET_ID_SELECTBOX_FIRST + 0)
#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_ACTION_TYPE (GADGET_ID_SELECTBOX_FIRST + 22)
-#define GADGET_ID_ACTION_MODE (GADGET_ID_SELECTBOX_FIRST + 23)
-#define GADGET_ID_ACTION_ARG (GADGET_ID_SELECTBOX_FIRST + 24)
-#define GADGET_ID_SELECT_CHANGE_PAGE (GADGET_ID_SELECTBOX_FIRST + 25)
-#define GADGET_ID_GROUP_CHOICE_MODE (GADGET_ID_SELECTBOX_FIRST + 26)
+#define GADGET_ID_WIND_DIRECTION (GADGET_ID_SELECTBOX_FIRST + 2)
+#define GADGET_ID_PLAYER_SPEED (GADGET_ID_SELECTBOX_FIRST + 3)
+#define GADGET_ID_CUSTOM_WALK_TO_ACTION (GADGET_ID_SELECTBOX_FIRST + 4)
+#define GADGET_ID_CUSTOM_EXPLOSION_TYPE (GADGET_ID_SELECTBOX_FIRST + 5)
+#define GADGET_ID_CUSTOM_DEADLINESS (GADGET_ID_SELECTBOX_FIRST + 6)
+#define GADGET_ID_CUSTOM_MOVE_PATTERN (GADGET_ID_SELECTBOX_FIRST + 7)
+#define GADGET_ID_CUSTOM_MOVE_DIRECTION (GADGET_ID_SELECTBOX_FIRST + 8)
+#define GADGET_ID_CUSTOM_MOVE_STEPSIZE (GADGET_ID_SELECTBOX_FIRST + 9)
+#define GADGET_ID_CUSTOM_MOVE_LEAVE_TYPE (GADGET_ID_SELECTBOX_FIRST + 10)
+#define GADGET_ID_CUSTOM_SMASH_TARGETS (GADGET_ID_SELECTBOX_FIRST + 11)
+#define GADGET_ID_CUSTOM_SLIPPERY_TYPE (GADGET_ID_SELECTBOX_FIRST + 12)
+#define GADGET_ID_CUSTOM_ACCESS_TYPE (GADGET_ID_SELECTBOX_FIRST + 13)
+#define GADGET_ID_CUSTOM_ACCESS_LAYER (GADGET_ID_SELECTBOX_FIRST + 14)
+#define GADGET_ID_CUSTOM_ACCESS_PROTECTED (GADGET_ID_SELECTBOX_FIRST + 15)
+#define GADGET_ID_CUSTOM_ACCESS_DIRECTION (GADGET_ID_SELECTBOX_FIRST + 16)
+#define GADGET_ID_CHANGE_TIME_UNITS (GADGET_ID_SELECTBOX_FIRST + 17)
+#define GADGET_ID_CHANGE_DIRECT_ACTION (GADGET_ID_SELECTBOX_FIRST + 18)
+#define GADGET_ID_CHANGE_OTHER_ACTION (GADGET_ID_SELECTBOX_FIRST + 19)
+#define GADGET_ID_CHANGE_SIDE (GADGET_ID_SELECTBOX_FIRST + 20)
+#define GADGET_ID_CHANGE_PLAYER (GADGET_ID_SELECTBOX_FIRST + 21)
+#define GADGET_ID_CHANGE_PAGE (GADGET_ID_SELECTBOX_FIRST + 22)
+#define GADGET_ID_CHANGE_REPLACE_WHEN (GADGET_ID_SELECTBOX_FIRST + 23)
+#define GADGET_ID_ACTION_TYPE (GADGET_ID_SELECTBOX_FIRST + 24)
+#define GADGET_ID_ACTION_MODE (GADGET_ID_SELECTBOX_FIRST + 25)
+#define GADGET_ID_ACTION_ARG (GADGET_ID_SELECTBOX_FIRST + 26)
+#define GADGET_ID_SELECT_CHANGE_PAGE (GADGET_ID_SELECTBOX_FIRST + 27)
+#define GADGET_ID_GROUP_CHOICE_MODE (GADGET_ID_SELECTBOX_FIRST + 28)
/* textbutton identifiers */
-#define GADGET_ID_TEXTBUTTON_FIRST (GADGET_ID_SELECTBOX_FIRST + 27)
+#define GADGET_ID_TEXTBUTTON_FIRST (GADGET_ID_SELECTBOX_FIRST + 29)
#define GADGET_ID_PROPERTIES_INFO (GADGET_ID_TEXTBUTTON_FIRST + 0)
#define GADGET_ID_PROPERTIES_CONFIG (GADGET_ID_TEXTBUTTON_FIRST + 1)
#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_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)
-#define GADGET_ID_CAN_PASS_TO_WALKABLE (GADGET_ID_CHECKBUTTON_FIRST + 12)
-#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_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_HAS_ACTION (GADGET_ID_CHECKBUTTON_FIRST + 36)
-#define GADGET_ID_CHANGE_DELAY (GADGET_ID_CHECKBUTTON_FIRST + 37)
-#define GADGET_ID_CHANGE_BY_DIRECT_ACT (GADGET_ID_CHECKBUTTON_FIRST + 38)
-#define GADGET_ID_CHANGE_BY_OTHER_ACT (GADGET_ID_CHECKBUTTON_FIRST + 39)
+#define GADGET_ID_STICK_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 3)
+#define GADGET_ID_EM_SLIPPERY_GEMS (GADGET_ID_CHECKBUTTON_FIRST + 4)
+#define GADGET_ID_USE_SPRING_BUG (GADGET_ID_CHECKBUTTON_FIRST + 5)
+#define GADGET_ID_USE_TIME_ORB_BUG (GADGET_ID_CHECKBUTTON_FIRST + 6)
+#define GADGET_ID_RANDOM_BALL_CONTENT (GADGET_ID_CHECKBUTTON_FIRST + 7)
+#define GADGET_ID_INITIAL_BALL_STATE (GADGET_ID_CHECKBUTTON_FIRST + 8)
+#define GADGET_ID_GROW_INTO_DIGGABLE (GADGET_ID_CHECKBUTTON_FIRST + 9)
+#define GADGET_ID_CONTINUOUS_SNAPPING (GADGET_ID_CHECKBUTTON_FIRST + 10)
+#define GADGET_ID_BLOCK_SNAP_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 11)
+#define GADGET_ID_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 12)
+#define GADGET_ID_SP_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 13)
+#define GADGET_ID_INSTANT_RELOCATION (GADGET_ID_CHECKBUTTON_FIRST + 14)
+#define GADGET_ID_USE_START_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 15)
+#define GADGET_ID_USE_ARTWORK_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 16)
+#define GADGET_ID_USE_EXPLOSION_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 17)
+#define GADGET_ID_INITIAL_GRAVITY (GADGET_ID_CHECKBUTTON_FIRST + 18)
+#define GADGET_ID_CAN_PASS_TO_WALKABLE (GADGET_ID_CHECKBUTTON_FIRST + 19)
+#define GADGET_ID_CAN_FALL_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 20)
+#define GADGET_ID_CAN_MOVE_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 21)
+#define GADGET_ID_DONT_COLLIDE_WITH (GADGET_ID_CHECKBUTTON_FIRST + 22)
+#define GADGET_ID_ENVELOPE_AUTOWRAP (GADGET_ID_CHECKBUTTON_FIRST + 23)
+#define GADGET_ID_ENVELOPE_CENTERED (GADGET_ID_CHECKBUTTON_FIRST + 24)
+#define GADGET_ID_CUSTOM_INDESTRUCTIBLE (GADGET_ID_CHECKBUTTON_FIRST + 25)
+#define GADGET_ID_CUSTOM_CAN_EXPLODE (GADGET_ID_CHECKBUTTON_FIRST + 26)
+#define GADGET_ID_CUSTOM_EXPLODE_FIRE (GADGET_ID_CHECKBUTTON_FIRST + 27)
+#define GADGET_ID_CUSTOM_EXPLODE_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 28)
+#define GADGET_ID_CUSTOM_EXPLODE_IMPACT (GADGET_ID_CHECKBUTTON_FIRST + 29)
+#define GADGET_ID_CUSTOM_WALK_TO_OBJECT (GADGET_ID_CHECKBUTTON_FIRST + 30)
+#define GADGET_ID_CUSTOM_DEADLY (GADGET_ID_CHECKBUTTON_FIRST + 31)
+#define GADGET_ID_CUSTOM_CAN_MOVE (GADGET_ID_CHECKBUTTON_FIRST + 32)
+#define GADGET_ID_CUSTOM_CAN_FALL (GADGET_ID_CHECKBUTTON_FIRST + 33)
+#define GADGET_ID_CUSTOM_CAN_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 34)
+#define GADGET_ID_CUSTOM_SLIPPERY (GADGET_ID_CHECKBUTTON_FIRST + 35)
+#define GADGET_ID_CUSTOM_ACCESSIBLE (GADGET_ID_CHECKBUTTON_FIRST + 36)
+#define GADGET_ID_CUSTOM_GRAV_REACHABLE (GADGET_ID_CHECKBUTTON_FIRST + 37)
+#define GADGET_ID_CUSTOM_USE_LAST_VALUE (GADGET_ID_CHECKBUTTON_FIRST + 38)
+#define GADGET_ID_CUSTOM_USE_GRAPHIC (GADGET_ID_CHECKBUTTON_FIRST + 39)
+#define GADGET_ID_CUSTOM_USE_TEMPLATE (GADGET_ID_CHECKBUTTON_FIRST + 40)
+#define GADGET_ID_CUSTOM_CAN_CHANGE (GADGET_ID_CHECKBUTTON_FIRST + 41)
+#define GADGET_ID_CHANGE_USE_CONTENT (GADGET_ID_CHECKBUTTON_FIRST + 42)
+#define GADGET_ID_CHANGE_USE_EXPLOSION (GADGET_ID_CHECKBUTTON_FIRST + 43)
+#define GADGET_ID_CHANGE_ONLY_COMPLETE (GADGET_ID_CHECKBUTTON_FIRST + 44)
+#define GADGET_ID_CHANGE_USE_RANDOM (GADGET_ID_CHECKBUTTON_FIRST + 45)
+#define GADGET_ID_CHANGE_HAS_ACTION (GADGET_ID_CHECKBUTTON_FIRST + 46)
+#define GADGET_ID_CHANGE_DELAY (GADGET_ID_CHECKBUTTON_FIRST + 47)
+#define GADGET_ID_CHANGE_BY_DIRECT_ACT (GADGET_ID_CHECKBUTTON_FIRST + 48)
+#define GADGET_ID_CHANGE_BY_OTHER_ACT (GADGET_ID_CHECKBUTTON_FIRST + 49)
/* gadgets for buttons in element list */
-#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 40)
+#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 50)
#define GADGET_ID_ELEMENTLIST_LAST (GADGET_ID_ELEMENTLIST_FIRST + \
ED_NUM_ELEMENTLIST_BUTTONS - 1)
#define ED_COUNTER_ID_LEVEL_RANDOM 6
#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_ELEMENT_VALUE3 9
+#define ED_COUNTER_ID_ELEMENT_VALUE4 10
+#define ED_COUNTER_ID_YAMYAM_CONTENT 11
+#define ED_COUNTER_ID_BALL_CONTENT 12
+#define ED_COUNTER_ID_ANDROID_CONTENT 13
+#define ED_COUNTER_ID_ENVELOPE_XSIZE 14
+#define ED_COUNTER_ID_ENVELOPE_YSIZE 15
+#define ED_COUNTER_ID_CUSTOM_SCORE 16
+#define ED_COUNTER_ID_CUSTOM_GEMCOUNT 17
+#define ED_COUNTER_ID_CUSTOM_VALUE_FIX 18
+#define ED_COUNTER_ID_CUSTOM_VALUE_RND 19
+#define ED_COUNTER_ID_PUSH_DELAY_FIX 20
+#define ED_COUNTER_ID_PUSH_DELAY_RND 21
+#define ED_COUNTER_ID_DROP_DELAY_FIX 22
+#define ED_COUNTER_ID_DROP_DELAY_RND 23
+#define ED_COUNTER_ID_MOVE_DELAY_FIX 24
+#define ED_COUNTER_ID_MOVE_DELAY_RND 25
+#define ED_COUNTER_ID_EXPLOSION_DELAY 26
+#define ED_COUNTER_ID_IGNITION_DELAY 27
+#define ED_COUNTER_ID_GROUP_CONTENT 28
+#define ED_COUNTER_ID_CHANGE_DELAY_FIX 29
+#define ED_COUNTER_ID_CHANGE_DELAY_RND 30
+#define ED_COUNTER_ID_CHANGE_CONT_RND 31
+
+#define ED_NUM_COUNTERBUTTONS 32
#define ED_COUNTER_ID_LEVEL_FIRST ED_COUNTER_ID_LEVEL_XSIZE
#define ED_COUNTER_ID_LEVEL_LAST ED_COUNTER_ID_LEVEL_RANDOM
/* values for selectbox gadgets */
#define ED_SELECTBOX_ID_TIME_OR_STEPS 0
#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_ACTION_TYPE 22
-#define ED_SELECTBOX_ID_ACTION_MODE 23
-#define ED_SELECTBOX_ID_ACTION_ARG 24
-#define ED_SELECTBOX_ID_SELECT_CHANGE_PAGE 25
-#define ED_SELECTBOX_ID_GROUP_CHOICE_MODE 26
-
-#define ED_NUM_SELECTBOX 27
+#define ED_SELECTBOX_ID_WIND_DIRECTION 2
+#define ED_SELECTBOX_ID_PLAYER_SPEED 3
+#define ED_SELECTBOX_ID_CUSTOM_ACCESS_TYPE 4
+#define ED_SELECTBOX_ID_CUSTOM_ACCESS_LAYER 5
+#define ED_SELECTBOX_ID_CUSTOM_ACCESS_PROTECTED 6
+#define ED_SELECTBOX_ID_CUSTOM_ACCESS_DIRECTION 7
+#define ED_SELECTBOX_ID_CUSTOM_WALK_TO_ACTION 8
+#define ED_SELECTBOX_ID_CUSTOM_MOVE_PATTERN 9
+#define ED_SELECTBOX_ID_CUSTOM_MOVE_DIRECTION 10
+#define ED_SELECTBOX_ID_CUSTOM_MOVE_STEPSIZE 11
+#define ED_SELECTBOX_ID_CUSTOM_MOVE_LEAVE_TYPE 12
+#define ED_SELECTBOX_ID_CUSTOM_SMASH_TARGETS 13
+#define ED_SELECTBOX_ID_CUSTOM_SLIPPERY_TYPE 14
+#define ED_SELECTBOX_ID_CUSTOM_DEADLINESS 15
+#define ED_SELECTBOX_ID_CUSTOM_EXPLOSION_TYPE 16
+#define ED_SELECTBOX_ID_CHANGE_TIME_UNITS 17
+#define ED_SELECTBOX_ID_CHANGE_DIRECT_ACTION 18
+#define ED_SELECTBOX_ID_CHANGE_OTHER_ACTION 19
+#define ED_SELECTBOX_ID_CHANGE_SIDE 20
+#define ED_SELECTBOX_ID_CHANGE_PLAYER 21
+#define ED_SELECTBOX_ID_CHANGE_PAGE 22
+#define ED_SELECTBOX_ID_CHANGE_REPLACE_WHEN 23
+#define ED_SELECTBOX_ID_ACTION_TYPE 24
+#define ED_SELECTBOX_ID_ACTION_MODE 25
+#define ED_SELECTBOX_ID_ACTION_ARG 26
+#define ED_SELECTBOX_ID_SELECT_CHANGE_PAGE 27
+#define ED_SELECTBOX_ID_GROUP_CHOICE_MODE 28
+
+#define ED_NUM_SELECTBOX 29
#define ED_SELECTBOX_ID_LEVEL_FIRST ED_SELECTBOX_ID_TIME_OR_STEPS
-#define ED_SELECTBOX_ID_LEVEL_LAST ED_SELECTBOX_ID_GAME_ENGINE_TYPE
+#define ED_SELECTBOX_ID_LEVEL_LAST ED_SELECTBOX_ID_WIND_DIRECTION
#define ED_SELECTBOX_ID_CUSTOM1_FIRST ED_SELECTBOX_ID_CUSTOM_ACCESS_TYPE
#define ED_SELECTBOX_ID_CUSTOM1_LAST ED_SELECTBOX_ID_CUSTOM_WALK_TO_ACTION
#define ED_GRAPHICBUTTON_ID_CHANGE_LAST ED_GRAPHICBUTTON_ID_PASTE_CHANGE_PAGE
/* values for checkbutton gadgets */
-#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
-#define ED_CHECKBUTTON_ID_CAN_PASS_TO_WALKABLE 10
-#define ED_CHECKBUTTON_ID_CAN_FALL_INTO_ACID 11
-#define ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID 12
-#define ED_CHECKBUTTON_ID_DONT_COLLIDE_WITH 13
-#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_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_CHECKBUTTON_ID_CHANGE_HAS_ACTION 37
-
-#define ED_NUM_CHECKBUTTONS 38
-
-#define ED_CHECKBUTTON_ID_LEVEL_FIRST ED_CHECKBUTTON_ID_INITIAL_GRAVITY
+#define ED_CHECKBUTTON_ID_RANDOM_RESTRICTED 0
+#define ED_CHECKBUTTON_ID_STICK_ELEMENT 1
+#define ED_CHECKBUTTON_ID_EM_SLIPPERY_GEMS 2
+#define ED_CHECKBUTTON_ID_USE_SPRING_BUG 3
+#define ED_CHECKBUTTON_ID_USE_TIME_ORB_BUG 4
+#define ED_CHECKBUTTON_ID_RANDOM_BALL_CONTENT 5
+#define ED_CHECKBUTTON_ID_INITIAL_BALL_STATE 6
+#define ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE 7
+#define ED_CHECKBUTTON_ID_CONTINUOUS_SNAPPING 8
+#define ED_CHECKBUTTON_ID_BLOCK_SNAP_FIELD 9
+#define ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD 10
+#define ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD 11
+#define ED_CHECKBUTTON_ID_INSTANT_RELOCATION 12
+#define ED_CHECKBUTTON_ID_USE_START_ELEMENT 13
+#define ED_CHECKBUTTON_ID_USE_ARTWORK_ELEMENT 14
+#define ED_CHECKBUTTON_ID_USE_EXPLOSION_ELEMENT 15
+#define ED_CHECKBUTTON_ID_INITIAL_GRAVITY 16
+#define ED_CHECKBUTTON_ID_CAN_PASS_TO_WALKABLE 17
+#define ED_CHECKBUTTON_ID_CAN_FALL_INTO_ACID 18
+#define ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID 19
+#define ED_CHECKBUTTON_ID_DONT_COLLIDE_WITH 20
+#define ED_CHECKBUTTON_ID_ENVELOPE_AUTOWRAP 21
+#define ED_CHECKBUTTON_ID_ENVELOPE_CENTERED 22
+#define ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC 23
+#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE 24
+#define ED_CHECKBUTTON_ID_CUSTOM_ACCESSIBLE 25
+#define ED_CHECKBUTTON_ID_CUSTOM_GRAV_REACHABLE 26
+#define ED_CHECKBUTTON_ID_CUSTOM_USE_LAST_VALUE 27
+#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT 28
+#define ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE 29
+#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE 30
+#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 31
+#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 32
+#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 33
+#define ED_CHECKBUTTON_ID_CUSTOM_DEADLY 34
+#define ED_CHECKBUTTON_ID_CUSTOM_CAN_EXPLODE 35
+#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE 36
+#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH 37
+#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT 38
+#define ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE 39
+#define ED_CHECKBUTTON_ID_CHANGE_DELAY 40
+#define ED_CHECKBUTTON_ID_CHANGE_BY_DIRECT_ACT 41
+#define ED_CHECKBUTTON_ID_CHANGE_BY_OTHER_ACT 42
+#define ED_CHECKBUTTON_ID_CHANGE_USE_EXPLOSION 43
+#define ED_CHECKBUTTON_ID_CHANGE_USE_CONTENT 44
+#define ED_CHECKBUTTON_ID_CHANGE_ONLY_COMPLETE 45
+#define ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM 46
+#define ED_CHECKBUTTON_ID_CHANGE_HAS_ACTION 47
+
+#define ED_NUM_CHECKBUTTONS 48
+
+#define ED_CHECKBUTTON_ID_LEVEL_FIRST ED_CHECKBUTTON_ID_RANDOM_RESTRICTED
#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_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
+#define ED_DRAWING_ID_ANDROID_CONTENT 17
+#define ED_DRAWING_ID_AMOEBA_CONTENT 18
+#define ED_DRAWING_ID_START_ELEMENT 19
+#define ED_DRAWING_ID_ARTWORK_ELEMENT 20
+#define ED_DRAWING_ID_EXPLOSION_ELEMENT 21
+#define ED_DRAWING_ID_CUSTOM_GRAPHIC 22
+#define ED_DRAWING_ID_CUSTOM_CONTENT 23
+#define ED_DRAWING_ID_CUSTOM_MOVE_ENTER 24
+#define ED_DRAWING_ID_CUSTOM_MOVE_LEAVE 25
+#define ED_DRAWING_ID_CUSTOM_CHANGE_TARGET 26
+#define ED_DRAWING_ID_CUSTOM_CHANGE_CONTENT 27
+#define ED_DRAWING_ID_CUSTOM_CHANGE_TRIGGER 28
+#define ED_DRAWING_ID_GROUP_CONTENT 29
+#define ED_DRAWING_ID_RANDOM_BACKGROUND 30
+
+#define ED_NUM_DRAWING_AREAS 31
/*
NULL, " ", "height",
},
{
- ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(6),
+ ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(5),
0, 999,
GADGET_ID_LEVEL_GEMSLIMIT_DOWN, GADGET_ID_LEVEL_GEMSLIMIT_UP,
GADGET_ID_LEVEL_GEMSLIMIT_TEXT, GADGET_ID_NONE,
NULL, "number of gems to collect:", NULL
},
{
- ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(8),
+ ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(7),
0, 9999,
GADGET_ID_LEVEL_TIMELIMIT_DOWN, GADGET_ID_LEVEL_TIMELIMIT_UP,
GADGET_ID_LEVEL_TIMELIMIT_TEXT, GADGET_ID_NONE,
"time or step limit to solve level:", NULL, NULL
},
{
- ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(10),
+ ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(9),
0, 255,
GADGET_ID_LEVEL_TIMESCORE_DOWN, GADGET_ID_LEVEL_TIMESCORE_UP,
GADGET_ID_LEVEL_TIMESCORE_TEXT, GADGET_ID_NONE,
&level.score[SC_TIME_BONUS],
- "score for each 10 sec/steps left:", NULL, NULL
+ "score for each second/step left:", NULL, NULL
},
{
ED_LEVEL_SETTINGS_XPOS(0), ED_COUNTER2_YPOS(8),
NULL, /* will be set when used */
NULL, NULL, NULL
},
+ {
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(2),
+ MIN_SCORE, MAX_SCORE,
+ GADGET_ID_ELEMENT_VALUE3_DOWN, GADGET_ID_ELEMENT_VALUE3_UP,
+ GADGET_ID_ELEMENT_VALUE3_TEXT, GADGET_ID_NONE,
+ NULL, /* will be set when used */
+ NULL, NULL, NULL
+ },
+ {
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(3),
+ MIN_SCORE, MAX_SCORE,
+ GADGET_ID_ELEMENT_VALUE4_DOWN, GADGET_ID_ELEMENT_VALUE4_UP,
+ GADGET_ID_ELEMENT_VALUE4_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,
&level.num_yamyam_contents,
NULL, NULL, "number of content areas"
},
+ {
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(4),
+ MIN_ELEMENT_CONTENTS, MAX_ELEMENT_CONTENTS,
+ GADGET_ID_BALL_CONTENT_DOWN, GADGET_ID_BALL_CONTENT_UP,
+ GADGET_ID_BALL_CONTENT_TEXT, GADGET_ID_NONE,
+ &level.num_ball_contents,
+ NULL, NULL, "number of content areas"
+ },
+ {
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(4),
+ MIN_ANDROID_ELEMENTS, MAX_ANDROID_ELEMENTS,
+ GADGET_ID_ANDROID_CONTENT_DOWN, GADGET_ID_ANDROID_CONTENT_UP,
+ GADGET_ID_ANDROID_CONTENT_TEXT, GADGET_ID_NONE,
+ &level.num_android_clone_elements,
+ NULL, NULL, "number of clonable elements"
+ },
{
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,
- NULL,
+ NULL, /* will be set when used */
NULL, NULL, "width",
},
{
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,
- NULL,
+ NULL, /* will be set when used */
NULL, " ", "height",
},
GADGET_ID_CUSTOM_SCORE_DOWN, GADGET_ID_CUSTOM_SCORE_UP,
GADGET_ID_CUSTOM_SCORE_TEXT, GADGET_ID_NONE,
&custom_element.collect_score_initial,
- NULL, "score", " "
+ NULL, "CE score", " "
},
{
-1, ED_ELEMENT_SETTINGS_YPOS(6),
GADGET_ID_CUSTOM_GEMCOUNT_DOWN, GADGET_ID_CUSTOM_GEMCOUNT_UP,
GADGET_ID_CUSTOM_GEMCOUNT_TEXT, GADGET_ID_CUSTOM_SCORE_UP,
&custom_element.collect_count_initial,
- NULL, "count", NULL
+ NULL, "CE count", NULL
+ },
+ {
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(12),
+ 0, 9999,
+ GADGET_ID_CUSTOM_VALUE_FIX_DOWN, GADGET_ID_CUSTOM_VALUE_FIX_UP,
+ GADGET_ID_CUSTOM_VALUE_FIX_TEXT, GADGET_ID_NONE,
+ &custom_element.ce_value_fixed_initial,
+ NULL, "CE value", NULL
+ },
+ {
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(12),
+ 0, 9999,
+ GADGET_ID_CUSTOM_VALUE_RND_DOWN, GADGET_ID_CUSTOM_VALUE_RND_UP,
+ GADGET_ID_CUSTOM_VALUE_RND_TEXT, GADGET_ID_CUSTOM_VALUE_FIX_UP,
+ &custom_element.ce_value_random_initial,
+ NULL, "+random", NULL
},
{
ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(7),
GADGET_ID_CHANGE_DELAY_FIX_DOWN, GADGET_ID_CHANGE_DELAY_FIX_UP,
GADGET_ID_CHANGE_DELAY_FIX_TEXT, GADGET_ID_NONE,
&custom_element_change.delay_fixed,
- NULL, "delay", NULL,
+ NULL, "CE delay", NULL,
},
{
-1, ED_ELEMENT_SETTINGS_YPOS(2),
} textarea_info[ED_NUM_TEXTAREAS] =
{
{
- ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(2),
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(3),
GADGET_ID_ENVELOPE_INFO,
MAX_ENVELOPE_XSIZE, MAX_ENVELOPE_YSIZE,
NULL,
- "Envelope Info:", "Envelope Info"
+ "Envelope Content:", "Envelope Content"
}
};
{ -1, NULL }
};
+static struct ValueTextInfo options_wind_direction[] =
+{
+ { MV_START_NONE, "none" },
+ { MV_START_LEFT, "left" },
+ { MV_START_RIGHT, "right" },
+ { MV_START_UP, "up" },
+ { MV_START_DOWN, "down" },
+
+ { -1, NULL }
+};
+
+static struct ValueTextInfo options_player_speed[] =
+{
+ { 0, "frozen" },
+ { 1, "very slow" },
+ { 2, "slow" },
+ { 4, "normal" },
+ { 8, "fast" },
+ { 16, "very fast" },
+ { 32, "ultrafast" },
+
+ { -1, NULL }
+};
+
static struct ValueTextInfo options_access_type[] =
{
{ EP_WALKABLE, "walkable" },
static struct ValueTextInfo options_access_direction[] =
{
- { MV_NO_DIRECTIONS, "no direction" },
+ { MV_NO_DIRECTION, "no direction" },
{ MV_LEFT, "left" },
{ MV_RIGHT, "right" },
{ MV_UP, "up" },
{ MV_HORIZONTAL, "horizontal" },
{ MV_VERTICAL, "vertical" },
{ MV_ALL_DIRECTIONS, "all directions" },
+ { MV_WIND_DIRECTION, "wind direction" },
{ MV_TOWARDS_PLAYER, "towards player" },
{ MV_AWAY_FROM_PLAYER, "away from player" },
{ MV_ALONG_LEFT_SIDE, "along left side" },
{
{ CE_TOUCHED_BY_PLAYER, "touched by player" },
{ CE_PRESSED_BY_PLAYER, "pressed by player" },
+ { CE_SWITCHED_BY_PLAYER, "switched by player" },
+ { CE_SNAPPED_BY_PLAYER, "snapped by player" },
{ CE_PUSHED_BY_PLAYER, "pushed by player" },
{ CE_ENTERED_BY_PLAYER, "entered by player" },
{ CE_LEFT_BY_PLAYER, "left by player" },
#endif
{ CE_IMPACT, "impact (on something)" },
{ CE_SMASHED, "smashed (from above)" },
- { CE_COUNT_AT_ZERO, "CE count at zero" },
+#if 0
+ { CE_VALUE_CHANGES, "CE value changes" },
+ { CE_SCORE_CHANGES, "CE score changes" },
+#endif
+ { CE_VALUE_GETS_ZERO, "CE value gets 0" },
+ { CE_SCORE_GETS_ZERO, "CE score gets 0" },
{ -1, NULL }
};
{
{ CE_PLAYER_TOUCHES_X, "player touches" },
{ CE_PLAYER_PRESSES_X, "player presses" },
+ { CE_PLAYER_SWITCHES_X, "player switches" },
+ { CE_PLAYER_SNAPS_X, "player snaps" },
{ CE_PLAYER_PUSHES_X, "player pushes" },
{ CE_PLAYER_ENTERS_X, "player enters" },
{ CE_PLAYER_LEAVES_X, "player leaves" },
{ CE_PLAYER_DROPS_X, "player drops/throws" },
{ CE_TOUCHING_X, "touching" },
{ CE_HITTING_X, "hitting" },
+ { CE_DIGGING_X, "digging" },
{ CE_HIT_BY_X, "hit by" },
{ CE_SWITCH_OF_X, "switch of" },
{ CE_CHANGE_OF_X, "change by page of" },
{ CE_EXPLOSION_OF_X, "explosion of" },
- { CE_COUNT_AT_ZERO_OF_X, "CE count at zero of" },
+ { CE_MOVE_OF_X, "move of" },
+ { CE_CREATION_OF_X, "creation of" },
+ { CE_VALUE_CHANGES_OF_X, "CE value changes of" },
+ { CE_SCORE_CHANGES_OF_X, "CE score changes of" },
+ { CE_VALUE_GETS_ZERO_OF_X, "CE value gets 0 of" },
+ { CE_SCORE_GETS_ZERO_OF_X, "CE score gets 0 of" },
{ -1, NULL }
};
static struct ValueTextInfo options_action_type[] =
{
{ CA_NO_ACTION, "no action" },
- { CA_EXIT_PLAYER, "exit player" },
- { CA_KILL_PLAYER, "kill player" },
+ { CA_UNDEFINED, " " },
+ { CA_HEADLINE_LEVEL_ACTIONS, "[level actions]" },
{ CA_RESTART_LEVEL, "restart level" },
{ CA_SHOW_ENVELOPE, "show envelope" },
- { CA_ADD_KEY, "add key" },
- { CA_DEL_KEY, "remove key" },
- { CA_SET_PLAYER_SPEED, "set player speed" },
- { CA_SET_GEMS, "set gems" },
- { CA_SET_TIME, "set time" },
- { CA_SET_SCORE, "set score" },
+ { CA_SET_LEVEL_TIME, "set time" },
+ { CA_SET_LEVEL_SCORE, "set score" },
+ { CA_SET_LEVEL_GEMS, "set needed gems" },
+ { CA_SET_LEVEL_WIND, "set wind dir." },
+ { CA_UNDEFINED, " " },
+ { CA_HEADLINE_PLAYER_ACTIONS, "[player actions]" },
+ { CA_MOVE_PLAYER, "move player" },
+ { CA_EXIT_PLAYER, "exit player" },
+ { CA_KILL_PLAYER, "kill player" },
+ { CA_SET_PLAYER_KEYS, "set keys" },
+ { CA_SET_PLAYER_SPEED, "set speed" },
+ { CA_SET_PLAYER_SHIELD, "set shield" },
+ { CA_SET_PLAYER_GRAVITY, "set gravity" },
+ { CA_SET_PLAYER_ARTWORK, "set artwork" },
+ { CA_UNDEFINED, " " },
+ { CA_HEADLINE_CE_ACTIONS, "[CE actions]" },
+ { CA_SET_CE_VALUE, "set CE value" },
{ CA_SET_CE_SCORE, "set CE score" },
- { CA_SET_CE_COUNT, "set CE count" },
-#if 0
- { CA_SET_DYNABOMB_NUMBER, "set bomb number" },
- { CA_SET_DYNABOMB_SIZE, "set bomb size" },
- { CA_SET_DYNABOMB_POWER, "set bomb power" },
-#endif
- { CA_TOGGLE_PLAYER_GRAVITY, "toggle gravity" },
- { CA_ENABLE_PLAYER_GRAVITY, "enable gravity" },
- { CA_DISABLE_PLAYER_GRAVITY, "disable gravity" },
+ { CA_UNDEFINED, " " },
+ { CA_HEADLINE_ENGINE_ACTIONS, "[engine actions]" },
+ { CA_SET_ENGINE_SCAN_MODE, "set scan mode" },
{ -1, NULL }
};
-static struct ValueTextInfo options_action_mode[] =
+static struct ValueTextInfo options_action_mode_none[] =
{
{ CA_MODE_UNDEFINED, " " },
+
+ { -1, NULL }
+};
+
+static struct ValueTextInfo options_action_mode_assign[] =
+{
+ { CA_MODE_SET, "=" },
+
+ { -1, NULL }
+};
+
+static struct ValueTextInfo options_action_mode_add_remove[] =
+{
+ { CA_MODE_ADD, "+" },
+ { CA_MODE_SUBTRACT, "-" },
+
+ { -1, NULL }
+};
+
+static struct ValueTextInfo options_action_mode_calculate[] =
+{
+ { CA_MODE_SET, "=" },
{ CA_MODE_ADD, "+" },
{ CA_MODE_SUBTRACT, "-" },
{ CA_MODE_MULTIPLY, "*" },
{ CA_MODE_DIVIDE, "/" },
- { CA_MODE_SET, "=" },
+ { CA_MODE_MODULO, "%" },
+
+ { -1, NULL }
+};
+
+static struct ValueTextInfo options_action_arg_none[] =
+{
+ { CA_ARG_UNDEFINED, " " },
{ -1, NULL }
};
-static struct ValueTextInfo options_action_arg[] =
+static struct ValueTextInfo options_action_arg_player[] =
{
{ CA_ARG_PLAYER_HEADLINE, "[player]" },
{ CA_ARG_PLAYER_1, "1" },
{ CA_ARG_PLAYER_4, "4" },
{ CA_ARG_PLAYER_ANY, "any" },
{ CA_ARG_PLAYER_TRIGGER, "trigger" },
+
+ { -1, NULL }
+};
+
+static struct ValueTextInfo options_action_arg_number[] =
+{
+ { CA_ARG_NUMBER_HEADLINE, "[number]" },
+ { CA_ARG_0, "0" },
+ { CA_ARG_1, "1" },
+ { CA_ARG_2, "2" },
+ { CA_ARG_3, "3" },
+ { CA_ARG_4, "4" },
+ { CA_ARG_5, "5" },
+ { CA_ARG_10, "10" },
+ { CA_ARG_100, "100" },
+ { CA_ARG_1000, "1000" },
+ { CA_ARG_UNDEFINED, " " },
+ { CA_ARG_NUMBER_MIN, "min" },
+ { CA_ARG_NUMBER_MAX, "max" },
+ { CA_ARG_UNDEFINED, " " },
+ { CA_ARG_NUMBER_RESET, "reset" },
+ { CA_ARG_UNDEFINED, " " },
+ { CA_ARG_NUMBER_CE_VALUE, "CE value" },
+ { CA_ARG_NUMBER_CE_SCORE, "CE score" },
+ { CA_ARG_NUMBER_CE_DELAY, "CE delay" },
+ { CA_ARG_UNDEFINED, " " },
+ { CA_ARG_NUMBER_LEVEL_TIME, "time" },
+ { CA_ARG_NUMBER_LEVEL_GEMS, "gems" },
+ { CA_ARG_NUMBER_LEVEL_SCORE, "score" },
{ CA_ARG_UNDEFINED, " " },
+ { CA_ARG_ELEMENT_CV_HEADLINE, "[CE value]" },
+ { CA_ARG_ELEMENT_CV_TARGET, "target" },
+ { CA_ARG_ELEMENT_CV_TRIGGER, "trigger" },
+ { CA_ARG_UNDEFINED, " " },
+ { CA_ARG_ELEMENT_CS_HEADLINE, "[CE score]" },
+ { CA_ARG_ELEMENT_CS_TARGET, "target" },
+ { CA_ARG_ELEMENT_CS_TRIGGER, "trigger" },
+
+ { -1, NULL }
+};
+
+static struct ValueTextInfo options_action_arg_value[] =
+{
{ CA_ARG_NUMBER_HEADLINE, "[number]" },
{ CA_ARG_0, "0" },
{ CA_ARG_1, "1" },
{ CA_ARG_UNDEFINED, " " },
{ CA_ARG_NUMBER_MIN, "min" },
{ CA_ARG_NUMBER_MAX, "max" },
- { CA_ARG_NUMBER_NORMAL, "normal" },
+ { CA_ARG_UNDEFINED, " " },
{ CA_ARG_NUMBER_RESET, "reset" },
+ { CA_ARG_UNDEFINED, " " },
+ { CA_ARG_NUMBER_CE_VALUE, "CE value" },
{ CA_ARG_NUMBER_CE_SCORE, "CE score" },
- { CA_ARG_NUMBER_CE_COUNT, "CE count" },
{ CA_ARG_NUMBER_CE_DELAY, "CE delay" },
{ CA_ARG_UNDEFINED, " " },
+ { CA_ARG_NUMBER_LEVEL_TIME, "time" },
+ { CA_ARG_NUMBER_LEVEL_GEMS, "gems" },
+ { CA_ARG_NUMBER_LEVEL_SCORE, "score" },
+ { CA_ARG_UNDEFINED, " " },
+ { CA_ARG_ELEMENT_CV_HEADLINE, "[CE value]" },
+ { CA_ARG_ELEMENT_CV_TARGET, "target" },
+ { CA_ARG_ELEMENT_CV_TRIGGER, "trigger" },
+ { CA_ARG_UNDEFINED, " " },
+ { CA_ARG_ELEMENT_CS_HEADLINE, "[CE score]" },
+ { CA_ARG_ELEMENT_CS_TARGET, "target" },
+ { CA_ARG_ELEMENT_CS_TRIGGER, "trigger" },
+ { CA_ARG_UNDEFINED, " " },
+ { CA_ARG_ELEMENT_NR_HEADLINE, "[element]" },
+ { CA_ARG_ELEMENT_NR_TARGET, "target" },
+ { CA_ARG_ELEMENT_NR_TRIGGER, "trigger" },
+
+ { -1, NULL }
+};
+
+static struct ValueTextInfo options_action_arg_envelope[] =
+{
+ { CA_ARG_NUMBER_HEADLINE, "[number]" },
+ { CA_ARG_1, "1" },
+ { CA_ARG_2, "2" },
+ { CA_ARG_3, "3" },
+ { CA_ARG_4, "4" },
+ { CA_ARG_UNDEFINED, " " },
+ { CA_ARG_ELEMENT_HEADLINE, "[element]" },
+ { CA_ARG_ELEMENT_TARGET, "target" },
+ { CA_ARG_ELEMENT_TRIGGER, "trigger" },
+
+ { -1, NULL }
+};
+
+static struct ValueTextInfo options_action_arg_key[] =
+{
+ { CA_ARG_NUMBER_HEADLINE, "[number]" },
+ { CA_ARG_1, "1" },
+ { CA_ARG_2, "2" },
+ { CA_ARG_3, "3" },
+ { CA_ARG_4, "4" },
+ { CA_ARG_5, "5" },
+ { CA_ARG_6, "6" },
+ { CA_ARG_7, "7" },
+ { CA_ARG_8, "8" },
+ { CA_ARG_UNDEFINED, " " },
+ { CA_ARG_ELEMENT_HEADLINE, "[element]" },
+ { CA_ARG_ELEMENT_TARGET, "target" },
+ { CA_ARG_ELEMENT_TRIGGER, "trigger" },
+
+ { -1, NULL }
+};
+
+static struct ValueTextInfo options_action_arg_speed[] =
+{
+ { CA_ARG_SPEED_HEADLINE, "[speed]" },
+ { CA_ARG_SPEED_NOT_MOVING, "frozen" },
+ { CA_ARG_SPEED_VERY_SLOW, "very slow" },
+ { CA_ARG_SPEED_SLOW, "slow" },
+ { CA_ARG_SPEED_NORMAL, "normal" },
+ { CA_ARG_SPEED_FAST, "fast" },
+ { CA_ARG_SPEED_VERY_FAST, "very fast" },
+ { CA_ARG_SPEED_EVEN_FASTER, "ultrafast" },
+ { CA_ARG_UNDEFINED, " " },
+ { CA_ARG_SPEED_SLOWER, "slower" },
+ { CA_ARG_SPEED_FASTER, "faster" },
+ { CA_ARG_UNDEFINED, " " },
+ { CA_ARG_SPEED_RESET, "reset" },
+
+ { -1, NULL }
+};
+
+static struct ValueTextInfo options_action_arg_shield[] =
+{
+ { CA_ARG_SHIELD_HEADLINE, "[shield]" },
+ { CA_ARG_SHIELD_OFF, "off" },
+ { CA_ARG_SHIELD_NORMAL, "normal" },
+ { CA_ARG_SHIELD_DEADLY, "deadly" },
+
+ { -1, NULL }
+};
+
+static struct ValueTextInfo options_action_arg_artwork[] =
+{
{ CA_ARG_ELEMENT_HEADLINE, "[element]" },
{ CA_ARG_ELEMENT_TARGET, "target" },
{ CA_ARG_ELEMENT_TRIGGER, "trigger" },
+ { CA_ARG_UNDEFINED, " " },
+ { CA_ARG_ELEMENT_RESET, "reset" },
+
+ { -1, NULL }
+};
+
+static struct ValueTextInfo options_action_arg_gravity[] =
+{
+ { CA_ARG_GRAVITY_HEADLINE, "[gravity]" },
+ { CA_ARG_GRAVITY_ON, "on" },
+ { CA_ARG_GRAVITY_OFF, "off" },
+ { CA_ARG_GRAVITY_TOGGLE, "toggle" },
+
+ { -1, NULL }
+};
+
+static struct ValueTextInfo options_action_arg_direction[] =
+{
+ { CA_ARG_DIRECTION_HEADLINE, "[dir.]" },
+ { CA_ARG_DIRECTION_NONE, "none" },
+ { CA_ARG_DIRECTION_LEFT, "left" },
+ { CA_ARG_DIRECTION_RIGHT, "right" },
+ { CA_ARG_DIRECTION_UP, "up" },
+ { CA_ARG_DIRECTION_DOWN, "down" },
+ { CA_ARG_DIRECTION_TRIGGER, "trigger" },
+ { CA_ARG_DIRECTION_TRIGGER_BACK, "-trigger" },
+
+ { -1, NULL }
+};
+
+static struct ValueTextInfo options_action_arg_scan_mode[] =
+{
+ { CA_ARG_SCAN_MODE_HEADLINE, "[mode]" },
+ { CA_ARG_SCAN_MODE_NORMAL, "normal" },
+ { CA_ARG_SCAN_MODE_REVERSE, "reverse" },
{ -1, NULL }
};
{ -1, NULL }
};
+static struct ValueTextInfo *action_arg_modes[] =
+{
+ options_action_mode_none,
+ options_action_mode_assign,
+ options_action_mode_add_remove,
+ options_action_mode_calculate,
+};
+
+static struct
+{
+ int value;
+ int mode;
+ struct ValueTextInfo *options;
+}
+action_arg_options[] =
+{
+ { CA_NO_ACTION, 0, options_action_arg_none, },
+ { CA_EXIT_PLAYER, 0, options_action_arg_player, },
+ { CA_KILL_PLAYER, 0, options_action_arg_player, },
+ { CA_MOVE_PLAYER, 0, options_action_arg_direction, },
+ { CA_RESTART_LEVEL, 0, options_action_arg_none, },
+ { CA_SHOW_ENVELOPE, 0, options_action_arg_envelope, },
+ { CA_SET_LEVEL_TIME, 3, options_action_arg_number, },
+ { CA_SET_LEVEL_GEMS, 3, options_action_arg_number, },
+ { CA_SET_LEVEL_SCORE, 3, options_action_arg_number, },
+ { CA_SET_LEVEL_WIND, 1, options_action_arg_direction, },
+ { CA_SET_PLAYER_KEYS, 2, options_action_arg_key, },
+ { CA_SET_PLAYER_SPEED, 1, options_action_arg_speed, },
+ { CA_SET_PLAYER_SHIELD, 1, options_action_arg_shield, },
+ { CA_SET_PLAYER_GRAVITY, 1, options_action_arg_gravity, },
+ { CA_SET_PLAYER_ARTWORK, 1, options_action_arg_artwork, },
+ { CA_SET_CE_VALUE, 3, options_action_arg_value, },
+ { CA_SET_CE_SCORE, 3, options_action_arg_value, },
+ { CA_SET_ENGINE_SCAN_MODE, 1, options_action_arg_scan_mode, },
+
+ { -1, FALSE, NULL }
+};
+
static struct
{
int x, y;
/* ---------- level and editor settings ---------------------------------- */
{
- -1, ED_LEVEL_SETTINGS_YPOS(8),
+ -1, ED_LEVEL_SETTINGS_YPOS(7),
GADGET_ID_TIME_OR_STEPS, GADGET_ID_LEVEL_TIMELIMIT_UP,
-1,
options_time_or_steps,
NULL, "(0 => no limit)", "time or step limit"
},
{
- ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(5),
+ ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(11),
GADGET_ID_GAME_ENGINE_TYPE, GADGET_ID_NONE,
-1,
options_game_engine_type,
&level.game_engine_type,
"game engine:", NULL, "game engine"
},
+ {
+ ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(10),
+ GADGET_ID_WIND_DIRECTION, GADGET_ID_NONE,
+ -1,
+ options_wind_direction,
+ &level.wind_direction_initial,
+ "initial wind direction:", NULL, "initial wind direction"
+ },
- /* ---------- element settings: configure 1 (custom elements) ----------- */
+ /* ---------- element settings: configure (several elements) ------------- */
+
+ {
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(5),
+ GADGET_ID_PLAYER_SPEED, GADGET_ID_NONE,
+ -1,
+ options_player_speed,
+ &level.initial_player_stepsize[0],
+ "initial player speed:", NULL, "initial player speed"
+ },
+
+ /* ---------- element settings: configure 1 (custom elements) ------------ */
{
ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(3),
NULL, NULL, "diggable/collectible/pushable"
},
- /* ---------- element settings: configure 2 (custom elements) ----------- */
+ /* ---------- element settings: configure 2 (custom elements) ------------ */
{
ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(1),
-1,
options_change_trigger_side,
&custom_element_change.trigger_side,
- "at", "side", "element side that causes change"
+ "at", "side", "element side triggering change"
},
{
ED_ELEMENT_SETTINGS_XPOS(2), ED_ELEMENT_SETTINGS_YPOS(7),
-1, ED_ELEMENT_SETTINGS_YPOS(13),
GADGET_ID_ACTION_MODE, GADGET_ID_ACTION_TYPE,
-1,
- options_action_mode,
+ options_action_mode_none,
&custom_element_change.action_mode,
NULL, NULL, "action operator"
},
-1, ED_ELEMENT_SETTINGS_YPOS(13),
GADGET_ID_ACTION_ARG, GADGET_ID_ACTION_MODE,
-1,
- options_action_arg,
+ options_action_arg_none,
&custom_element_change.action_arg,
NULL, NULL, "action parameter"
},
int gd_x, gd_y;
int x, y;
int width, height;
+ int wheel_x, wheel_y;
+ int wheel_width, wheel_height;
int type;
int gadget_id;
char *infotext;
ED_SCROLLBAR_XPOS, ED_SCROLLBAR_YPOS,
SX + ED_SCROLL_HORIZONTAL_XPOS, SY + ED_SCROLL_HORIZONTAL_YPOS,
ED_SCROLL_HORIZONTAL_XSIZE, ED_SCROLL_HORIZONTAL_YSIZE,
+#if 1
+ SX, SY,
+ SXSIZE, SYSIZE,
+#else
+ 0, 0,
+ SX + SXSIZE + SX, WIN_YSIZE,
+#endif
GD_TYPE_SCROLLBAR_HORIZONTAL,
GADGET_ID_SCROLL_HORIZONTAL,
"scroll level editing area horizontally"
ED_SCROLLBAR_XPOS, ED_SCROLLBAR_YPOS,
SX + ED_SCROLL_VERTICAL_XPOS, SY + ED_SCROLL_VERTICAL_YPOS,
ED_SCROLL_VERTICAL_XSIZE, ED_SCROLL_VERTICAL_YSIZE,
+#if 1
+ SX, SY,
+ SXSIZE, SYSIZE,
+#else
+ 0, 0,
+ SX + SXSIZE + SX, WIN_YSIZE,
+#endif
GD_TYPE_SCROLLBAR_VERTICAL,
GADGET_ID_SCROLL_VERTICAL,
"scroll level editing area vertically"
ED_SCROLLBAR2_XPOS, ED_SCROLLBAR2_YPOS,
DX + ED_SCROLL2_VERTICAL_XPOS, DY + ED_SCROLL2_VERTICAL_YPOS,
ED_SCROLL2_VERTICAL_XSIZE, ED_SCROLL2_VERTICAL_YSIZE,
+#if 1
+ DX, DY,
+ DXSIZE, DYSIZE,
+#else
+ SX + SXSIZE + SX, 0,
+ WIN_XSIZE - (SX + SXSIZE + SX), WIN_YSIZE,
+#endif
GD_TYPE_SCROLLBAR_VERTICAL,
GADGET_ID_SCROLL_LIST_VERTICAL,
"scroll element list vertically"
{
/* ---------- level and editor settings ---------------------------------- */
- {
- ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(11),
- GADGET_ID_INITIAL_GRAVITY, GADGET_ID_NONE,
- &level.initial_gravity,
- NULL,
- "initial gravity", "set initial level gravity"
- },
{
ED_LEVEL_SETTINGS_XPOS(0), ED_COUNTER2_YPOS(9) - MINI_TILEY,
GADGET_ID_RANDOM_RESTRICTED, GADGET_ID_NONE,
GADGET_ID_EM_SLIPPERY_GEMS, GADGET_ID_NONE,
&level.em_slippery_gems,
NULL,
- "slip down from certain flat walls","use EM style slipping behaviour"
+ "slip down from certain flat walls","use EM/DC style slipping behaviour"
},
{
- ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1),
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(2),
GADGET_ID_USE_SPRING_BUG, GADGET_ID_NONE,
&level.use_spring_bug,
NULL,
"use spring pushing bug", "use odd spring pushing behaviour"
},
+ {
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1),
+ GADGET_ID_USE_TIME_ORB_BUG, GADGET_ID_NONE,
+ &level.use_time_orb_bug,
+ NULL,
+ "use time orb bug", "use odd time orb behaviour"
+ },
+ {
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(2),
+ GADGET_ID_RANDOM_BALL_CONTENT, GADGET_ID_NONE,
+ &level.ball_random,
+ NULL,
+ "create single random element", "only create one element from content"
+ },
+ {
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1),
+ GADGET_ID_INITIAL_BALL_STATE, GADGET_ID_NONE,
+ &level.ball_state_initial,
+ NULL,
+ "magic ball initially activated", "activate magic ball after level start"
+ },
{
ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(0),
GADGET_ID_GROW_INTO_DIGGABLE, GADGET_ID_NONE,
"can grow into anything diggable", "grow into more than just sand"
},
{
- ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(4),
- GADGET_ID_DOUBLE_SPEED, GADGET_ID_NONE,
- &level.double_speed,
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(7),
+ GADGET_ID_CONTINUOUS_SNAPPING, GADGET_ID_NONE,
+ &level.continuous_snapping,
NULL,
- "double speed movement", "set initial movement speed of player"
+ "continuos snapping", "use snapping without releasing key"
},
{
- ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1),
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(6),
+ GADGET_ID_BLOCK_SNAP_FIELD, GADGET_ID_NONE,
+ &level.block_snap_field,
+ NULL,
+ "block snapped field when snapping", "use snapping delay to show animation"
+ },
+ {
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(2),
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_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1),
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(2),
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_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(2),
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(3),
GADGET_ID_INSTANT_RELOCATION, GADGET_ID_NONE,
&level.instant_relocation,
NULL,
"no scrolling when relocating", "player gets relocated without delay"
},
{
- ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(3),
- GADGET_ID_CAN_PASS_TO_WALKABLE, GADGET_ID_NONE,
- &level.can_pass_to_walkable,
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(8),
+ GADGET_ID_USE_START_ELEMENT, GADGET_ID_NONE,
+ &level.use_start_element[0],
NULL,
- "can pass to walkable element", "player can pass to empty or walkable"
+ "use level start element:", "start level at this element's position"
},
{
- ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(0),
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(9),
+ GADGET_ID_USE_ARTWORK_ELEMENT, GADGET_ID_NONE,
+ &level.use_artwork_element[0],
+ NULL,
+ "use artwork from element:", "use player artwork from other element"
+ },
+ {
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(10),
+ GADGET_ID_USE_EXPLOSION_ELEMENT, GADGET_ID_NONE,
+ &level.use_explosion_element[0],
+ NULL,
+ "use explosion from element:", "use explosion properties from element"
+ },
+ {
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(11),
+ GADGET_ID_INITIAL_GRAVITY, GADGET_ID_NONE,
+ &level.initial_player_gravity[0],
+ NULL,
+ "use initial gravity", "set initial player gravity"
+ },
+ {
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(4),
+ 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_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1),
GADGET_ID_CAN_FALL_INTO_ACID, GADGET_ID_NONE,
&custom_element_properties[EP_CAN_MOVE_INTO_ACID],
NULL,
NULL,
"deadly when colliding with", "element is deadly when hitting player"
},
+ {
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1),
+ GADGET_ID_ENVELOPE_AUTOWRAP, GADGET_ID_NONE,
+ &level.envelope[0].autowrap,
+ NULL,
+ "auto-wrap", "automatically wrap envelope text"
+ },
+ {
+ -1, ED_ELEMENT_SETTINGS_YPOS(1),
+ GADGET_ID_ENVELOPE_CENTERED, GADGET_ID_ENVELOPE_AUTOWRAP,
+ &level.envelope[0].centered,
+ " ",
+ "centered", "automatically center envelope text"
+ },
/* ---------- element settings: configure 1 (custom elements) ----------- */
/* !!! add separate "use existing element sound" !!! */
#if 0
- NULL, "use graphic/sound of element:", "use existing graphic and sound"
+ NULL,
+ "use graphic/sound of element:", "use existing graphic and sound"
#else
- NULL, "use graphic of element:", "use existing element graphic"
+ NULL,
+ "use graphic of element:", "use existing element graphic"
#endif
},
{
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"
+ NULL,
+ "use template", "use template for custom properties"
},
{
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"
+ NULL,
+ NULL, "player can walk to or pass this field"
},
{
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"
+ NULL,
+ "reachable despite gravity", "player can walk/dig despite gravity"
+ },
+ {
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(13),
+ GADGET_ID_CUSTOM_USE_LAST_VALUE, GADGET_ID_NONE,
+ &custom_element.use_last_ce_value,
+ NULL,
+ "use last CE value after change", "use last CE value after change"
},
{
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"
+ NULL,
+ NULL, "player can dig/collect/push element"
},
{
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"
+ 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 with some pattern"
+ NULL,
+ NULL, "element can move with some pattern"
},
{
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"
+ NULL,
+ "can fall", "element can fall down"
},
{
-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"
+ " ",
+ NULL, "element can smash other elements"
},
{
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"
+ NULL,
+ NULL, "other elements can fall down from it"
},
{
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"
+ NULL,
+ NULL, "element can kill the player"
},
{
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"
+ NULL,
+ NULL, "element can explode"
},
{
ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(11),
GADGET_ID_CUSTOM_EXPLODE_FIRE, GADGET_ID_NONE,
&custom_element_properties[EP_EXPLODES_BY_FIRE],
- NULL, "by fire", "element can explode by fire/explosion"
+ NULL,
+ "by fire", "element can explode by fire/explosion"
},
{
-1, ED_ELEMENT_SETTINGS_YPOS(11),
GADGET_ID_CUSTOM_EXPLODE_SMASH, GADGET_ID_CUSTOM_EXPLODE_FIRE,
&custom_element_properties[EP_EXPLODES_SMASHED],
- " ", "smashed", "element can explode when smashed"
+ " ",
+ "smashed", "element can explode when smashed"
},
{
-1, ED_ELEMENT_SETTINGS_YPOS(11),
GADGET_ID_CUSTOM_EXPLODE_IMPACT, GADGET_ID_CUSTOM_EXPLODE_SMASH,
&custom_element_properties[EP_EXPLODES_IMPACT],
- " ", "impact", "element can explode on impact"
+ " ",
+ "impact", "element can explode on impact"
},
/* ---------- element settings: advanced (custom elements) --------------- */
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:", "change element on specified condition"
+ NULL,
+ "element changes to:", "change element on specified condition"
},
{
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"
+ NULL,
+ NULL, "element changes after delay"
},
{
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"
+ NULL,
+ NULL, "element changes by direct action"
},
{
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"
+ NULL,
+ NULL, "element changes by other element"
},
{
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"
+ NULL,
+ "explode instead of change", "element explodes instead of change"
},
{
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"
+ NULL,
+ "use extended change target:", "element changes to more elements"
},
{
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"
+ NULL,
+ "replace all or nothing", "only replace when all can be changed"
},
{
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"
+ NULL,
+ NULL, "use percentage for random replace"
},
{
ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(13),
GADGET_ID_CHANGE_HAS_ACTION, GADGET_ID_NONE,
&custom_element_change.has_action,
- NULL, NULL, "execute action on specified condition"
+ NULL,
+ NULL, "execute action on specified condition"
},
};
static struct
{
int x, y;
- int area_xsize, area_ysize;
int gadget_id;
int gadget_id_align;
- char *text_left, *text_right, *text_below;
+ int *value;
+ int area_xsize, area_ysize;
+ char *text_left, *text_right, *text_below, *infotext;
} drawingarea_info[ED_NUM_DRAWING_AREAS] =
{
/* ---------- level playfield content ------------------------------------ */
{
- 0, 0,
- MAX_ED_FIELDX, MAX_ED_FIELDY,
+ 0, 0,
GADGET_ID_DRAWING_LEVEL, GADGET_ID_NONE,
- NULL, NULL, NULL
+ NULL, MAX_ED_FIELDX, MAX_ED_FIELDY,
+ NULL, NULL, NULL, NULL
},
/* ---------- yam yam content -------------------------------------------- */
{
ED_AREA_YAMYAM_CONTENT_XPOS(0), ED_AREA_YAMYAM_CONTENT_YPOS(0),
- 3, 3,
GADGET_ID_YAMYAM_CONTENT_0, GADGET_ID_NONE,
- NULL, NULL, "1"
+ &level.yamyam_content[0].e[0][0], 3, 3,
+ NULL, NULL, "1", NULL
},
{
ED_AREA_YAMYAM_CONTENT_XPOS(1), ED_AREA_YAMYAM_CONTENT_YPOS(1),
- 3, 3,
GADGET_ID_YAMYAM_CONTENT_1, GADGET_ID_NONE,
- NULL, NULL, "2"
+ &level.yamyam_content[1].e[0][0], 3, 3,
+ NULL, NULL, "2", NULL
},
{
ED_AREA_YAMYAM_CONTENT_XPOS(2), ED_AREA_YAMYAM_CONTENT_YPOS(2),
- 3, 3,
GADGET_ID_YAMYAM_CONTENT_2, GADGET_ID_NONE,
- NULL, NULL, "3"
+ &level.yamyam_content[2].e[0][0], 3, 3,
+ NULL, NULL, "3", NULL
},
{
ED_AREA_YAMYAM_CONTENT_XPOS(3), ED_AREA_YAMYAM_CONTENT_YPOS(3),
- 3, 3,
GADGET_ID_YAMYAM_CONTENT_3, GADGET_ID_NONE,
- NULL, NULL, "4"
+ &level.yamyam_content[3].e[0][0], 3, 3,
+ NULL, NULL, "4", NULL
},
{
ED_AREA_YAMYAM_CONTENT_XPOS(4), ED_AREA_YAMYAM_CONTENT_YPOS(4),
- 3, 3,
GADGET_ID_YAMYAM_CONTENT_4, GADGET_ID_NONE,
- NULL, NULL, "5"
+ &level.yamyam_content[4].e[0][0], 3, 3,
+ NULL, NULL, "5", NULL
},
{
ED_AREA_YAMYAM_CONTENT_XPOS(5), ED_AREA_YAMYAM_CONTENT_YPOS(5),
- 3, 3,
GADGET_ID_YAMYAM_CONTENT_5, GADGET_ID_NONE,
- NULL, NULL, "6"
+ &level.yamyam_content[5].e[0][0], 3, 3,
+ NULL, NULL, "6", NULL
},
{
ED_AREA_YAMYAM_CONTENT_XPOS(6), ED_AREA_YAMYAM_CONTENT_YPOS(6),
- 3, 3,
GADGET_ID_YAMYAM_CONTENT_6, GADGET_ID_NONE,
- NULL, NULL, "7"
+ &level.yamyam_content[6].e[0][0], 3, 3,
+ NULL, NULL, "7", NULL
},
{
ED_AREA_YAMYAM_CONTENT_XPOS(7), ED_AREA_YAMYAM_CONTENT_YPOS(7),
- 3, 3,
GADGET_ID_YAMYAM_CONTENT_7, GADGET_ID_NONE,
- NULL, NULL, "8"
+ &level.yamyam_content[7].e[0][0], 3, 3,
+ NULL, NULL, "8", NULL
},
/* ---------- 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"
+ &level.ball_content[0].e[0][0], 3, 3,
+ NULL, NULL, "1", NULL
},
{
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"
+ &level.ball_content[1].e[0][0], 3, 3,
+ NULL, NULL, "2", NULL
},
{
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"
+ &level.ball_content[2].e[0][0], 3, 3,
+ NULL, NULL, "3", NULL
},
{
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"
+ &level.ball_content[3].e[0][0], 3, 3,
+ NULL, NULL, "4", NULL
},
{
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"
+ &level.ball_content[4].e[0][0], 3, 3,
+ NULL, NULL, "5", NULL
},
{
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"
+ &level.ball_content[5].e[0][0], 3, 3,
+ NULL, NULL, "6", NULL
},
{
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"
+ &level.ball_content[6].e[0][0], 3, 3,
+ NULL, NULL, "7", NULL
},
{
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"
+ &level.ball_content[7].e[0][0], 3, 3,
+ NULL, NULL, "8", NULL
+ },
+
+ /* ---------- android content -------------------------------------------- */
+
+ {
+ ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(5),
+ GADGET_ID_ANDROID_CONTENT, GADGET_ID_NONE,
+ &level.android_clone_element[0], MAX_ANDROID_ELEMENTS, 1,
+ "elements:", NULL, NULL, "elements android can clone"
},
/* ---------- amoeba content --------------------------------------------- */
{
ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(3),
- 1, 1,
GADGET_ID_AMOEBA_CONTENT, GADGET_ID_NONE,
- "content:", NULL, NULL
+ &level.amoeba_content, 1, 1,
+ "content:", NULL, NULL, "amoeba content"
+ },
+
+ /* ---------- level start element ---------------------------------------- */
+
+ {
+ -1, ED_AREA_1X1_SETTINGS_YPOS(8),
+ GADGET_ID_START_ELEMENT, GADGET_ID_USE_START_ELEMENT,
+ &level.start_element[0], 1, 1,
+ NULL, NULL, NULL, "level start element"
+ },
+
+ /* ---------- player artwork element ------------------------------------- */
+
+ {
+ -1, ED_AREA_1X1_SETTINGS_YPOS(9),
+ GADGET_ID_ARTWORK_ELEMENT, GADGET_ID_USE_ARTWORK_ELEMENT,
+ &level.artwork_element[0], 1, 1,
+ NULL, NULL, NULL, "element for player artwork"
+ },
+
+ /* ---------- player explosion element ----------------------------------- */
+
+ {
+ -1, ED_AREA_1X1_SETTINGS_YPOS(10),
+ GADGET_ID_EXPLOSION_ELEMENT, GADGET_ID_USE_EXPLOSION_ELEMENT,
+ &level.explosion_element[0], 1, 1,
+ NULL, NULL, NULL, "element for player explosion"
},
/* ---------- element settings: configure 1 (custom elements) ----------- */
{
-1, ED_AREA_1X1_SETTINGS_YPOS(1),
- 1, 1,
GADGET_ID_CUSTOM_GRAPHIC, GADGET_ID_CUSTOM_USE_GRAPHIC,
- NULL, NULL, NULL
+ &custom_element.gfx_element, 1, 1,
+ NULL, NULL, NULL, "custom graphic element"
},
/* ---------- element settings: configure 2 (custom elements) ----------- */
{
-1, ED_AREA_3X3_SETTINGS_YPOS(10),
- 3, 3,
GADGET_ID_CUSTOM_CONTENT, GADGET_ID_NONE, /* align three rows */
- "content:", NULL, NULL
+ &custom_element.content.e[0][0], 3, 3,
+ "content:", NULL, NULL, NULL
},
/* ---------- custom enter and leave element (when moving) --------------- */
{
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
+ &custom_element.move_enter_element, 1, 1,
+ "can dig:", " ", NULL, "element that can be digged/collected"
},
{
-1, ED_AREA_1X1_SETTINGS_YPOS(3),
- 1, 1,
GADGET_ID_CUSTOM_MOVE_LEAVE, GADGET_ID_CUSTOM_MOVE_LEAVE_TYPE,
- NULL, NULL, NULL
+ &custom_element.move_leave_element, 1, 1,
+ NULL, NULL, NULL, "element that will be left behind"
},
/* ---------- element settings: advanced (custom elements) --------------- */
{
-1, ED_AREA_1X1_SETTINGS_YPOS(1),
- 1, 1,
GADGET_ID_CUSTOM_CHANGE_TARGET, GADGET_ID_CUSTOM_CAN_CHANGE,
- NULL, "after/when:", NULL
+ &custom_element_change.target_element, 1, 1,
+ NULL, "after/when:", NULL, "new target element after change"
},
/* ---------- custom change content (extended change target) ------------- */
{
- -1, ED_AREA_3X3_SETTINGS_YPOS(10),
- 3, 3,
+ -1, ED_AREA_3X3_SETTINGS_YPOS(9),
GADGET_ID_CUSTOM_CHANGE_CONTENT, GADGET_ID_NONE, /* align three rows */
- NULL, NULL, NULL
+ &custom_element_change.target_content.e[0][0], 3, 3,
+ NULL, NULL, NULL, "new extended elements after change"
},
/* ---------- custom change trigger (element causing change) ------------- */
{
-1, ED_AREA_1X1_SETTINGS_YPOS(5),
- 1, 1,
GADGET_ID_CUSTOM_CHANGE_TRIGGER, GADGET_ID_CHANGE_OTHER_ACTION,
- NULL, NULL, NULL
+ &custom_element_change.trigger_element, 1, 1,
+ NULL, NULL, NULL, "other element triggering change"
},
/* ---------- group element content -------------------------------------- */
{
ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(4),
- MAX_ELEMENTS_IN_GROUP, 1,
GADGET_ID_GROUP_CONTENT, GADGET_ID_NONE,
- "content:", NULL, NULL
+ &group_element_info.element[0], MAX_ELEMENTS_IN_GROUP, 1,
+ "content:", NULL, NULL, NULL
},
/* ---------- random background (for random painting) -------------------- */
{
-1, ED_ELEMENT_SETTINGS_YPOS(14),
- 1, 1,
GADGET_ID_RANDOM_BACKGROUND, GADGET_ID_RANDOM_RESTRICTED,
- NULL, NULL, NULL
+ &random_placement_background_element, 1, 1,
+ NULL, NULL, NULL, "random placement background"
},
};
/* actual position of level editor drawing area in level playfield */
static int level_xpos = -1, level_ypos = -1;
+#if 1
+#define IN_ED_FIELD(x,y) IN_FIELD(x, y, ed_fieldx, ed_fieldy)
+#else
#define IN_ED_FIELD(x,y) ((x)>=0 && (x)<ed_fieldx && (y)>=0 &&(y)<ed_fieldy)
+#endif
/* drawing elements on the three mouse buttons */
static int new_element1 = EL_WALL;
#define BUTTON_STEPSIZE(button) ((button) == 1 ? 1 : (button) == 2 ? 5 : 10)
/* forward declaration for internal use */
-static void ModifyEditorCounter(int, int);
+static void ModifyEditorCounterValue(int, int);
static void ModifyEditorCounterLimits(int, int, int);
-static void ModifyEditorSelectbox(int, int);
+static void ModifyEditorSelectboxValue(int, int);
+static void ModifyEditorSelectboxOptions(int, struct ValueTextInfo *);
static void ModifyEditorDrawingArea(int, int, int);
static void ModifyEditorElementList();
+static void AdjustElementListScrollbar();
static void RedrawDrawingElements();
static void DrawDrawingWindow();
static void DrawLevelInfoWindow();
static void HandleCheckbuttons(struct GadgetInfo *);
static void HandleControlButtons(struct GadgetInfo *);
static void HandleDrawingAreaInfo(struct GadgetInfo *);
+static void PrintEditorGadgetInfoText(struct GadgetInfo *);
static struct GadgetInfo *level_editor_gadget[NUM_EDITOR_GADGETS];
static int right_gadget_border[NUM_EDITOR_GADGETS];
static short FieldBackup[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
static short UndoBuffer[NUM_UNDO_STEPS][MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+static short IntelliDrawBuffer[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
static int undo_buffer_position = 0;
static int undo_buffer_steps = 0;
static int element_shift = 0;
+static int editor_el_players[] =
+{
+ EL_PLAYER_1,
+ EL_PLAYER_2,
+ EL_PLAYER_3,
+ EL_PLAYER_4
+};
+static int *editor_el_players_ptr = editor_el_players;
+static int num_editor_el_players = SIZEOF_ARRAY_INT(editor_el_players);
+
static int editor_hl_boulderdash[] =
{
+ EL_INTERNAL_CASCADE_BD_ACTIVE,
EL_CHAR('B'),
- EL_CHAR('O'),
- EL_CHAR('U'),
- EL_CHAR('L'),
-
- EL_CHAR('-'),
- EL_CHAR('D'),
- EL_CHAR('E'),
- EL_CHAR('R'),
-
EL_CHAR('D'),
- EL_CHAR('A'),
- EL_CHAR('S'),
- EL_CHAR('H'),
+ EL_EMPTY,
};
static int editor_el_boulderdash[] =
{
- EL_PLAYER_1,
EL_EMPTY,
EL_SAND,
- EL_STEELWALL,
+ EL_BD_ROCK,
+ EL_BD_DIAMOND,
+ EL_STEELWALL,
EL_BD_WALL,
+ EL_BD_EXPANDABLE_WALL,
EL_BD_MAGIC_WALL,
- EL_EXIT_CLOSED,
- EL_EXIT_OPEN,
- EL_BD_DIAMOND,
+ EL_BD_AMOEBA,
EL_BD_BUTTERFLY_UP,
EL_BD_FIREFLY_UP,
- EL_BD_ROCK,
+ EL_EXIT_CLOSED,
EL_BD_BUTTERFLY_LEFT,
EL_BD_FIREFLY_LEFT,
EL_BD_BUTTERFLY_RIGHT,
EL_BD_FIREFLY_RIGHT,
- EL_BD_AMOEBA,
+ EL_EMPTY,
EL_BD_BUTTERFLY_DOWN,
EL_BD_FIREFLY_DOWN,
- EL_EMPTY,
+ EL_EXIT_OPEN,
};
static int *editor_hl_boulderdash_ptr = editor_hl_boulderdash;
static int *editor_el_boulderdash_ptr = editor_el_boulderdash;
static int editor_hl_emerald_mine[] =
{
+ EL_INTERNAL_CASCADE_EM_ACTIVE,
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_EMPTY,
};
static int editor_el_emerald_mine[] =
{
- EL_PLAYER_1,
- EL_PLAYER_2,
- EL_PLAYER_3,
- EL_PLAYER_4,
-
- EL_PLAYER_1,
- EL_EMPTY,
EL_SAND,
EL_ROCK,
+ EL_QUICKSAND_EMPTY,
+ EL_QUICKSAND_FULL,
EL_STEELWALL,
EL_WALL,
EL_WALL_EMERALD,
EL_WALL_DIAMOND,
- EL_QUICKSAND_EMPTY,
- EL_QUICKSAND_FULL,
-
EL_DYNAMITE,
EL_DYNAMITE_ACTIVE,
- EL_EXIT_CLOSED,
- EL_EXIT_OPEN,
EL_YAMYAM,
EL_BUG_UP,
EL_ACID_POOL_TOPLEFT,
EL_ACID,
EL_ACID_POOL_TOPRIGHT,
- EL_EMPTY,
+ EL_AMOEBA_DROP,
EL_ACID_POOL_BOTTOMLEFT,
EL_ACID_POOL_BOTTOM,
EL_ACID_POOL_BOTTOMRIGHT,
- EL_EMPTY,
-
- EL_AMOEBA_DROP,
- EL_AMOEBA_DEAD,
EL_AMOEBA_WET,
- EL_AMOEBA_DRY,
EL_EM_KEY_1,
EL_EM_KEY_2,
static int editor_hl_emerald_mine_club[] =
{
+ EL_INTERNAL_CASCADE_EMC_ACTIVE,
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_WALL_11,
EL_EMC_WALL_12,
-#if RELEASE_311
- EL_EMPTY,
-#else
- EL_EMC_ANDROID,
-#endif
- EL_BALLOON,
- EL_BALLOON_SWITCH_ANY,
-#if RELEASE_311
- EL_EMPTY,
-#else
- EL_BALLOON_SWITCH_NONE,
-#endif
-
- EL_BALLOON_SWITCH_LEFT,
- EL_BALLOON_SWITCH_RIGHT,
- EL_BALLOON_SWITCH_UP,
- EL_BALLOON_SWITCH_DOWN,
-
EL_EMC_GRASS,
+ EL_EMC_FAKE_GRASS,
EL_EMC_PLANT,
-#if RELEASE_311
- EL_EMPTY,
- EL_EMPTY,
-#else
- EL_EMC_LENSES,
- EL_EMC_MAGNIFIER,
-#endif
+ EL_EMC_DRIPPER,
-#if RELEASE_311
- EL_EMPTY,
- EL_EMPTY,
-#else
EL_EMC_MAGIC_BALL,
EL_EMC_MAGIC_BALL_SWITCH,
-#endif
EL_SPRING,
-#if RELEASE_311
- EL_EMPTY,
-#else
EL_EMC_SPRING_BUMPER,
-#endif
-#if RELEASE_311
- EL_EMPTY,
-#else
- EL_EMC_DRIPPER,
-#endif
- EL_EMC_FAKE_GRASS,
- EL_EMPTY,
- EL_EMPTY,
+ EL_EMC_LENSES,
+ EL_EMC_MAGNIFIER,
+ EL_EM_DYNAMITE,
+ EL_EM_DYNAMITE_ACTIVE,
+
+ EL_BALLOON,
+ EL_YAMYAM_UP,
+ EL_BALLOON_SWITCH_UP,
+ EL_BALLOON_SWITCH_ANY,
+
+ EL_YAMYAM_LEFT,
+ EL_BALLOON_SWITCH_LEFT,
+ EL_YAMYAM_RIGHT,
+ EL_BALLOON_SWITCH_RIGHT,
+
+ EL_EMC_ANDROID,
+ EL_YAMYAM_DOWN,
+ EL_BALLOON_SWITCH_DOWN,
+ EL_BALLOON_SWITCH_NONE,
};
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[] =
+static int editor_hl_rnd[] =
{
- EL_CHAR('M'),
- EL_CHAR('O'),
+ EL_INTERNAL_CASCADE_RND_ACTIVE,
EL_CHAR('R'),
- EL_CHAR('E'),
+ EL_CHAR('N'),
+ EL_CHAR('D'),
};
-static int editor_el_more[] =
+static int editor_el_rnd[] =
{
EL_KEY_1,
EL_KEY_2,
EL_ARROW_UP,
EL_ARROW_DOWN,
+ EL_AMOEBA_DEAD,
+ EL_AMOEBA_DRY,
EL_AMOEBA_FULL,
+ EL_GAME_OF_LIFE,
+
EL_EMERALD_YELLOW,
EL_EMERALD_RED,
EL_EMERALD_PURPLE,
+ EL_BIOMAZE,
- EL_WALL_BD_DIAMOND,
EL_WALL_EMERALD_YELLOW,
EL_WALL_EMERALD_RED,
EL_WALL_EMERALD_PURPLE,
+ EL_WALL_BD_DIAMOND,
- EL_GAME_OF_LIFE,
+ EL_SPEED_PILL,
EL_PACMAN_UP,
EL_TIME_ORB_FULL,
EL_TIME_ORB_EMPTY,
EL_PACMAN_LEFT,
EL_DARK_YAMYAM,
EL_PACMAN_RIGHT,
- EL_EXPANDABLE_WALL,
+ EL_EMPTY,
- EL_BIOMAZE,
+ EL_BLACK_ORB,
EL_PACMAN_DOWN,
EL_LAMP,
EL_LAMP_ACTIVE,
EL_BD_FIREFLY,
EL_MOLE_LEFT,
- EL_EMPTY,
+ EL_SATELLITE,
EL_MOLE_RIGHT,
EL_PACMAN,
EL_SPACESHIP,
EL_MOLE_DOWN,
- EL_EMPTY,
- EL_EMPTY,
+ EL_INVISIBLE_STEELWALL,
+ EL_INVISIBLE_WALL,
- EL_SATELLITE,
+ EL_EXPANDABLE_WALL,
EL_EXPANDABLE_WALL_HORIZONTAL,
EL_EXPANDABLE_WALL_VERTICAL,
EL_EXPANDABLE_WALL_ANY,
-
- EL_INVISIBLE_STEELWALL,
- EL_INVISIBLE_WALL,
- EL_SPEED_PILL,
- EL_BLACK_ORB,
};
-static int *editor_hl_more_ptr = editor_hl_more;
-static int *editor_el_more_ptr = editor_el_more;
-static int num_editor_hl_more = SIZEOF_ARRAY_INT(editor_hl_more);
-static int num_editor_el_more = SIZEOF_ARRAY_INT(editor_el_more);
+static int *editor_hl_rnd_ptr = editor_hl_rnd;
+static int *editor_el_rnd_ptr = editor_el_rnd;
+static int num_editor_hl_rnd = SIZEOF_ARRAY_INT(editor_hl_rnd);
+static int num_editor_el_rnd = SIZEOF_ARRAY_INT(editor_el_rnd);
static int editor_hl_sokoban[] =
{
+ EL_INTERNAL_CASCADE_SB_ACTIVE,
EL_CHAR('S'),
- EL_CHAR('O'),
- EL_CHAR('K'),
- EL_CHAR('O'),
-
- EL_CHAR('-'),
EL_CHAR('B'),
- EL_CHAR('A'),
- EL_CHAR('N'),
+ EL_EMPTY,
};
static int editor_el_sokoban[] =
static int editor_hl_supaplex[] =
{
+ EL_INTERNAL_CASCADE_SP_ACTIVE,
EL_CHAR('S'),
- EL_CHAR('U'),
- EL_CHAR('P'),
- EL_CHAR('A'),
-
EL_CHAR('P'),
- EL_CHAR('L'),
- EL_CHAR('E'),
- EL_CHAR('X'),
+ EL_EMPTY,
};
static int editor_el_supaplex[] =
{
-#if 1
+ EL_SP_MURPHY,
EL_EMPTY,
-#else
- EL_SP_EMPTY,
-#endif
- EL_SP_ZONK,
EL_SP_BASE,
- EL_SP_MURPHY,
+ EL_SP_BUGGY_BASE,
EL_SP_INFOTRON,
- EL_SP_CHIP_SINGLE,
- EL_SP_HARDWARE_GRAY,
- EL_SP_EXIT_CLOSED,
+ EL_SP_ZONK,
+ EL_SP_SNIKSNAK,
+ EL_SP_ELECTRON,
+ EL_SP_DISK_RED,
EL_SP_DISK_ORANGE,
- EL_SP_PORT_RIGHT,
- EL_SP_PORT_DOWN,
- EL_SP_PORT_LEFT,
-
- EL_SP_PORT_UP,
- EL_SP_GRAVITY_PORT_RIGHT,
- EL_SP_GRAVITY_PORT_DOWN,
- EL_SP_GRAVITY_PORT_LEFT,
-
- EL_SP_GRAVITY_PORT_UP,
- EL_SP_SNIKSNAK,
EL_SP_DISK_YELLOW,
EL_SP_TERMINAL,
- EL_SP_DISK_RED,
- EL_SP_PORT_VERTICAL,
+ EL_SP_EXIT_CLOSED,
EL_SP_PORT_HORIZONTAL,
+ EL_SP_PORT_VERTICAL,
EL_SP_PORT_ANY,
- EL_SP_ELECTRON,
- EL_SP_BUGGY_BASE,
- EL_SP_CHIP_LEFT,
- EL_SP_CHIP_RIGHT,
+ EL_SP_PORT_LEFT,
+ EL_SP_PORT_RIGHT,
+ EL_SP_PORT_UP,
+ EL_SP_PORT_DOWN,
- EL_SP_HARDWARE_BASE_1,
+ EL_SP_GRAVITY_PORT_LEFT,
+ EL_SP_GRAVITY_PORT_RIGHT,
+ EL_SP_GRAVITY_PORT_UP,
+ EL_SP_GRAVITY_PORT_DOWN,
+
+ EL_SP_HARDWARE_GRAY,
EL_SP_HARDWARE_GREEN,
EL_SP_HARDWARE_BLUE,
EL_SP_HARDWARE_RED,
- EL_SP_HARDWARE_YELLOW,
+ EL_SP_HARDWARE_BASE_1,
EL_SP_HARDWARE_BASE_2,
EL_SP_HARDWARE_BASE_3,
EL_SP_HARDWARE_BASE_4,
EL_SP_HARDWARE_BASE_5,
EL_SP_HARDWARE_BASE_6,
+ EL_SP_HARDWARE_YELLOW,
EL_SP_CHIP_TOP,
+
+ EL_SP_CHIP_SINGLE,
+ EL_SP_CHIP_LEFT,
+ EL_SP_CHIP_RIGHT,
EL_SP_CHIP_BOTTOM,
};
static int *editor_hl_supaplex_ptr = editor_hl_supaplex;
static int editor_hl_diamond_caves[] =
{
+ EL_INTERNAL_CASCADE_DC_ACTIVE,
EL_CHAR('D'),
- EL_CHAR('I'),
- EL_CHAR('A'),
- EL_CHAR('-'),
-
- EL_CHAR('M'),
- EL_CHAR('O'),
- EL_CHAR('N'),
- EL_CHAR('D'),
-
EL_CHAR('C'),
- EL_CHAR('A'),
- EL_CHAR('V'),
- EL_CHAR('E'),
-
- EL_CHAR('S'),
- EL_CHAR(' '),
- EL_CHAR('I'),
- EL_CHAR('I'),
+ EL_CHAR('2'),
};
static int editor_el_diamond_caves[] =
EL_CONVEYOR_BELT_3_SWITCH_RIGHT,
EL_CONVEYOR_BELT_4_SWITCH_RIGHT,
- EL_SWITCHGATE_OPEN,
- EL_SWITCHGATE_CLOSED,
- EL_SWITCHGATE_SWITCH_UP,
- EL_EMPTY,
-
- EL_ENVELOPE_1,
- EL_ENVELOPE_2,
- EL_ENVELOPE_3,
- EL_ENVELOPE_4,
-
EL_TIMEGATE_CLOSED,
EL_TIMEGATE_OPEN,
EL_TIMEGATE_SWITCH,
- EL_EMPTY,
+ EL_DC_TIMEGATE_SWITCH,
- EL_LANDMINE,
- EL_INVISIBLE_SAND,
- EL_STEELWALL_SLIPPERY,
+ EL_SWITCHGATE_CLOSED,
+ EL_SWITCHGATE_OPEN,
+ EL_SWITCHGATE_SWITCH_UP,
+ EL_SWITCHGATE_SWITCH_DOWN,
+
+ EL_EMPTY,
EL_EMPTY,
+ EL_DC_SWITCHGATE_SWITCH_UP,
+ EL_DC_SWITCHGATE_SWITCH_DOWN,
EL_SIGN_EXCLAMATION,
EL_SIGN_STOP,
EL_LIGHT_SWITCH,
EL_LIGHT_SWITCH_ACTIVE,
+ EL_STEELWALL_SLIPPERY,
+ EL_INVISIBLE_SAND,
+ EL_LANDMINE,
+ EL_DC_LANDMINE,
+
EL_SHIELD_NORMAL,
EL_SHIELD_DEADLY,
EL_EXTRA_TIME,
EL_EMPTY,
+
+ EL_ENVELOPE_1,
+ EL_ENVELOPE_2,
+ EL_ENVELOPE_3,
+ EL_ENVELOPE_4,
+
+ EL_SIGN_RADIOACTIVITY,
+ EL_SIGN_WHEELCHAIR,
+ EL_SIGN_PARKING,
+ EL_SIGN_NO_ENTRY,
+
+ EL_SIGN_GIVE_WAY,
+ EL_SIGN_ENTRY_FORBIDDEN,
+ EL_SIGN_EMERGENCY_EXIT,
+ EL_SIGN_YIN_YANG,
+
+ EL_SIGN_SPERMS,
+ EL_SIGN_BULLET,
+ EL_SIGN_HEART,
+ EL_SIGN_CROSS,
+
+ EL_SIGN_FRANKIE,
+ EL_EMPTY,
+ EL_EMPTY,
+ EL_EMPTY,
+
+ EL_SPERMS,
+ EL_BULLET,
+ EL_HEART,
+ EL_CROSS,
+
+ EL_FRANKIE,
+ EL_EMPTY,
+ EL_EMPTY,
+ EL_EMPTY,
+
+ EL_DC_STEELWALL_2_SINGLE,
+ EL_DC_STEELWALL_2_TOP,
+ EL_STEEL_EXIT_CLOSED,
+ EL_STEEL_EXIT_OPEN,
+
+ EL_DC_STEELWALL_2_LEFT,
+ EL_DC_STEELWALL_2_MIDDLE,
+ EL_DC_STEELWALL_2_HORIZONTAL,
+ EL_DC_STEELWALL_2_RIGHT,
+
+ EL_DC_STEELWALL_1_TOPLEFT,
+ EL_DC_STEELWALL_2_VERTICAL,
+ EL_DC_STEELWALL_1_TOPRIGHT,
+ EL_EMPTY,
+
+ EL_DC_STEELWALL_1_VERTICAL,
+ EL_DC_STEELWALL_2_BOTTOM,
+ EL_EMPTY,
+ EL_EMPTY,
+
+ EL_DC_STEELWALL_1_BOTTOMLEFT,
+ EL_DC_STEELWALL_1_HORIZONTAL,
+ EL_DC_STEELWALL_1_BOTTOMRIGHT,
+ EL_EMPTY,
+
+ EL_DC_STEELWALL_1_BOTTOMRIGHT_2,
+ EL_DC_STEELWALL_1_BOTTOM,
+ EL_DC_STEELWALL_1_BOTTOMLEFT_2,
+ EL_EMPTY,
+
+ EL_DC_STEELWALL_1_RIGHT,
+ EL_EMPTY,
+ EL_DC_STEELWALL_1_LEFT,
+ EL_EMPTY,
+
+ EL_DC_STEELWALL_1_TOPRIGHT_2,
+ EL_DC_STEELWALL_1_TOP,
+ EL_DC_STEELWALL_1_TOPLEFT_2,
+ EL_EMPTY,
+
+ EL_EXPANDABLE_STEELWALL_HORIZONTAL,
+ EL_EXPANDABLE_STEELWALL_VERTICAL,
+ EL_EXPANDABLE_STEELWALL_ANY,
+ EL_EMPTY,
+
+ EL_EM_EXIT_CLOSED,
+ EL_EM_EXIT_OPEN,
+ EL_EM_STEEL_EXIT_CLOSED,
+ EL_EM_STEEL_EXIT_OPEN,
+
+ EL_DC_KEY_WHITE,
+ EL_DC_GATE_WHITE,
+ EL_DC_GATE_WHITE_GRAY,
+ EL_DC_GATE_FAKE_GRAY,
+
+ EL_DC_MAGIC_WALL,
+ EL_QUICKSAND_FAST_EMPTY,
+ EL_QUICKSAND_FAST_FULL,
+ EL_EMPTY,
};
static int *editor_hl_diamond_caves_ptr = editor_hl_diamond_caves;
static int *editor_el_diamond_caves_ptr = editor_el_diamond_caves;
static int editor_hl_dx_boulderdash[] =
{
+ EL_INTERNAL_CASCADE_DX_ACTIVE,
EL_CHAR('D'),
EL_CHAR('X'),
- EL_CHAR('-'),
- EL_CHAR(' '),
-
- EL_CHAR('B'),
- EL_CHAR('O'),
- EL_CHAR('U'),
- EL_CHAR('L'),
-
- EL_CHAR('-'),
- EL_CHAR('D'),
- EL_CHAR('E'),
- EL_CHAR('R'),
-
- EL_CHAR('D'),
- EL_CHAR('A'),
- EL_CHAR('S'),
- EL_CHAR('H'),
+ EL_EMPTY,
};
static int editor_el_dx_boulderdash[] =
static int editor_hl_chars[] =
{
+ EL_INTERNAL_CASCADE_CHARS_ACTIVE,
EL_CHAR('T'),
- EL_CHAR('E'),
EL_CHAR('X'),
EL_CHAR('T'),
};
EL_CHAR('°'),
EL_CHAR('®'),
EL_CHAR(FONT_ASCII_CURSOR),
+ EL_CHAR(FONT_ASCII_BUTTON),
+
+ EL_CHAR(FONT_ASCII_UP),
+ EL_CHAR(FONT_ASCII_DOWN),
+ EL_CHAR(' '),
EL_CHAR(' ')
};
static int *editor_hl_chars_ptr = editor_hl_chars;
static int num_editor_hl_chars = SIZEOF_ARRAY_INT(editor_hl_chars);
static int num_editor_el_chars = SIZEOF_ARRAY_INT(editor_el_chars);
-static int editor_hl_custom[] =
+static int editor_hl_steel_chars[] =
{
- EL_CHAR('C'),
- EL_CHAR('U'),
- EL_CHAR('S'),
- EL_CHAR('-'),
-
- EL_CHAR('T'),
- EL_CHAR('O'),
- EL_CHAR('M'),
- EL_CHAR(' '),
+ EL_INTERNAL_CASCADE_STEEL_CHARS_ACTIVE,
+ EL_STEEL_CHAR('T'),
+ EL_STEEL_CHAR('X'),
+ EL_STEEL_CHAR('T'),
+};
- EL_CHAR('E'),
- EL_CHAR('L'),
- EL_CHAR('E'),
- EL_CHAR('M'),
+static int editor_el_steel_chars[] =
+{
+ EL_STEEL_CHAR(' '),
+ EL_STEEL_CHAR('!'),
+ EL_STEEL_CHAR('"'),
+ EL_STEEL_CHAR('#'),
+
+ EL_STEEL_CHAR('$'),
+ EL_STEEL_CHAR('%'),
+ EL_STEEL_CHAR('&'),
+ EL_STEEL_CHAR('\''),
+
+ EL_STEEL_CHAR('('),
+ EL_STEEL_CHAR(')'),
+ EL_STEEL_CHAR('*'),
+ EL_STEEL_CHAR('+'),
+
+ EL_STEEL_CHAR(','),
+ EL_STEEL_CHAR('-'),
+ EL_STEEL_CHAR('.'),
+ EL_STEEL_CHAR('/'),
+
+ EL_STEEL_CHAR('0'),
+ EL_STEEL_CHAR('1'),
+ EL_STEEL_CHAR('2'),
+ EL_STEEL_CHAR('3'),
+
+ EL_STEEL_CHAR('4'),
+ EL_STEEL_CHAR('5'),
+ EL_STEEL_CHAR('6'),
+ EL_STEEL_CHAR('7'),
+
+ EL_STEEL_CHAR('8'),
+ EL_STEEL_CHAR('9'),
+ EL_STEEL_CHAR(':'),
+ EL_STEEL_CHAR(';'),
+
+ EL_STEEL_CHAR('<'),
+ EL_STEEL_CHAR('='),
+ EL_STEEL_CHAR('>'),
+ EL_STEEL_CHAR('?'),
+
+ EL_STEEL_CHAR('@'),
+ EL_STEEL_CHAR('A'),
+ EL_STEEL_CHAR('B'),
+ EL_STEEL_CHAR('C'),
+
+ EL_STEEL_CHAR('D'),
+ EL_STEEL_CHAR('E'),
+ EL_STEEL_CHAR('F'),
+ EL_STEEL_CHAR('G'),
+
+ EL_STEEL_CHAR('H'),
+ EL_STEEL_CHAR('I'),
+ EL_STEEL_CHAR('J'),
+ EL_STEEL_CHAR('K'),
+
+ EL_STEEL_CHAR('L'),
+ EL_STEEL_CHAR('M'),
+ EL_STEEL_CHAR('N'),
+ EL_STEEL_CHAR('O'),
+
+ EL_STEEL_CHAR('P'),
+ EL_STEEL_CHAR('Q'),
+ EL_STEEL_CHAR('R'),
+ EL_STEEL_CHAR('S'),
+
+ EL_STEEL_CHAR('T'),
+ EL_STEEL_CHAR('U'),
+ EL_STEEL_CHAR('V'),
+ EL_STEEL_CHAR('W'),
+
+ EL_STEEL_CHAR('X'),
+ EL_STEEL_CHAR('Y'),
+ EL_STEEL_CHAR('Z'),
+ EL_STEEL_CHAR('['),
+
+ EL_STEEL_CHAR('\\'),
+ EL_STEEL_CHAR(']'),
+ EL_STEEL_CHAR('^'),
+ EL_STEEL_CHAR('_'),
+
+ EL_STEEL_CHAR('©'),
+ EL_STEEL_CHAR('Ä'),
+ EL_STEEL_CHAR('Ö'),
+ EL_STEEL_CHAR('Ü'),
+
+ EL_STEEL_CHAR('°'),
+ EL_STEEL_CHAR('®'),
+ EL_STEEL_CHAR(FONT_ASCII_CURSOR),
+ EL_STEEL_CHAR(FONT_ASCII_BUTTON),
+
+ EL_STEEL_CHAR(FONT_ASCII_UP),
+ EL_STEEL_CHAR(FONT_ASCII_DOWN),
+ EL_STEEL_CHAR(' '),
+ EL_STEEL_CHAR(' ')
+};
+static int *editor_hl_steel_chars_ptr = editor_hl_steel_chars;
+static int *editor_el_steel_chars_ptr = editor_el_steel_chars;
+static int num_editor_hl_steel_chars = SIZEOF_ARRAY_INT(editor_hl_steel_chars);
+static int num_editor_el_steel_chars = SIZEOF_ARRAY_INT(editor_el_steel_chars);
+static int editor_hl_custom[] =
+{
+ EL_INTERNAL_CASCADE_CE_ACTIVE,
+ EL_CHAR('C'),
EL_CHAR('E'),
- EL_CHAR('N'),
- EL_CHAR('T'),
- EL_CHAR('S'),
+ EL_EMPTY,
};
static int editor_el_custom[] =
EL_CUSTOM_START + 124,
EL_CUSTOM_START + 125,
EL_CUSTOM_START + 126,
- EL_CUSTOM_START + 127
-};
-static int *editor_hl_custom_ptr = editor_hl_custom;
-static int *editor_el_custom_ptr = editor_el_custom;
-static int num_editor_hl_custom = SIZEOF_ARRAY_INT(editor_hl_custom);
-static int num_editor_el_custom = SIZEOF_ARRAY_INT(editor_el_custom);
+ EL_CUSTOM_START + 127,
-static int editor_hl_custom_more[] =
-{
-};
-
-static int editor_el_custom_more[] =
-{
EL_CUSTOM_START + 128,
EL_CUSTOM_START + 129,
EL_CUSTOM_START + 130,
EL_CUSTOM_START + 254,
EL_CUSTOM_START + 255
};
-static int *editor_hl_custom_more_ptr = editor_hl_custom_more;
-static int *editor_el_custom_more_ptr = editor_el_custom_more;
-static int num_editor_hl_custom_more = SIZEOF_ARRAY_INT(editor_hl_custom_more);
-static int num_editor_el_custom_more = SIZEOF_ARRAY_INT(editor_el_custom_more);
-
-static int editor_hl_custom_special[] =
-{
-};
-
-static int editor_el_custom_special[] =
-{
- EL_TRIGGER_ELEMENT,
- EL_TRIGGER_PLAYER,
- EL_EMPTY,
- EL_EMPTY
-};
-static int *editor_hl_custom_special_ptr = editor_hl_custom_special;
-static int *editor_el_custom_special_ptr = editor_el_custom_special;
-static int num_editor_hl_custom_special = SIZEOF_ARRAY_INT(editor_hl_custom_special);
-static int num_editor_el_custom_special = SIZEOF_ARRAY_INT(editor_el_custom_special);
+static int *editor_hl_custom_ptr = editor_hl_custom;
+static int *editor_el_custom_ptr = editor_el_custom;
+static int num_editor_hl_custom = SIZEOF_ARRAY_INT(editor_hl_custom);
+static int num_editor_el_custom = SIZEOF_ARRAY_INT(editor_el_custom);
static int editor_hl_group[] =
{
+ EL_INTERNAL_CASCADE_GE_ACTIVE,
EL_CHAR('G'),
- EL_CHAR('R'),
- EL_CHAR('O'),
- EL_CHAR('U'),
-
- EL_CHAR('P'),
- EL_CHAR(' '),
- EL_CHAR(' '),
- EL_CHAR(' '),
-
- EL_CHAR('E'),
- EL_CHAR('L'),
- EL_CHAR('E'),
- EL_CHAR('M'),
-
EL_CHAR('E'),
- EL_CHAR('N'),
- EL_CHAR('T'),
- EL_CHAR('S'),
+ EL_EMPTY,
};
static int editor_el_group[] =
EL_GROUP_START + 12,
EL_GROUP_START + 13,
EL_GROUP_START + 14,
- EL_GROUP_START + 15
-};
-static int *editor_hl_group_ptr = editor_hl_group;
-static int *editor_el_group_ptr = editor_el_group;
-static int num_editor_hl_group = SIZEOF_ARRAY_INT(editor_hl_group);
-static int num_editor_el_group = SIZEOF_ARRAY_INT(editor_el_group);
-
-static int editor_hl_group_more[] =
-{
-};
+ EL_GROUP_START + 15,
-static int editor_el_group_more[] =
-{
EL_GROUP_START + 16,
EL_GROUP_START + 17,
EL_GROUP_START + 18,
EL_GROUP_START + 30,
EL_GROUP_START + 31
};
-static int *editor_hl_group_more_ptr = editor_hl_group_more;
-static int *editor_el_group_more_ptr = editor_el_group_more;
-static int num_editor_hl_group_more = SIZEOF_ARRAY_INT(editor_hl_group_more);
-static int num_editor_el_group_more = SIZEOF_ARRAY_INT(editor_el_group_more);
+static int *editor_hl_group_ptr = editor_hl_group;
+static int *editor_el_group_ptr = editor_el_group;
+static int num_editor_hl_group = SIZEOF_ARRAY_INT(editor_hl_group);
+static int num_editor_el_group = SIZEOF_ARRAY_INT(editor_el_group);
-static int editor_hl_user_defined[] =
+static int editor_hl_reference[] =
{
- EL_CHAR('U'),
- EL_CHAR('S'),
- EL_CHAR('E'),
+ EL_INTERNAL_CASCADE_REF_ACTIVE,
EL_CHAR('R'),
-
- EL_CHAR('D'),
EL_CHAR('E'),
- EL_CHAR('F'),
- EL_CHAR('I'),
+ EL_CHAR('F')
+};
- EL_CHAR('-'),
- EL_CHAR('N'),
- EL_CHAR('E'),
- EL_CHAR('D'),
+static int editor_el_reference[] =
+{
+ EL_TRIGGER_PLAYER,
+ EL_TRIGGER_ELEMENT,
+ EL_TRIGGER_CE_VALUE,
+ EL_TRIGGER_CE_SCORE,
+
+ EL_SELF,
+ EL_ANY_ELEMENT,
+ EL_CURRENT_CE_VALUE,
+ EL_CURRENT_CE_SCORE,
+
+ EL_PREV_CE_8,
+ EL_PREV_CE_7,
+ EL_PREV_CE_6,
+ EL_PREV_CE_5,
+
+ EL_PREV_CE_4,
+ EL_PREV_CE_3,
+ EL_PREV_CE_2,
+ EL_PREV_CE_1,
+
+ EL_NEXT_CE_1,
+ EL_NEXT_CE_2,
+ EL_NEXT_CE_3,
+ EL_NEXT_CE_4,
+
+ EL_NEXT_CE_5,
+ EL_NEXT_CE_6,
+ EL_NEXT_CE_7,
+ EL_NEXT_CE_8,
+};
+static int *editor_hl_reference_ptr = editor_hl_reference;
+static int *editor_el_reference_ptr = editor_el_reference;
+static int num_editor_hl_reference = SIZEOF_ARRAY_INT(editor_hl_reference);
+static int num_editor_el_reference = SIZEOF_ARRAY_INT(editor_el_reference);
+
+static int editor_hl_user_defined[] =
+{
+ EL_INTERNAL_CASCADE_USER_ACTIVE,
+ EL_CHAR('M'),
+ EL_CHAR('Y'),
+ EL_EMPTY,
};
static int *editor_hl_user_defined_ptr = editor_hl_user_defined;
static int num_editor_hl_user_defined=SIZEOF_ARRAY_INT(editor_hl_user_defined);
static int num_editor_el_user_defined = 0;
-static int editor_hl_empty[] = { };
-static int editor_el_empty[ED_NUM_ELEMENTLIST_BUTTONS];
-
-static int *editor_hl_empty_ptr = editor_hl_empty;
+static int editor_hl_dynamic[] =
+{
+ EL_INTERNAL_CASCADE_DYNAMIC_ACTIVE,
+ EL_CHAR('U'),
+ EL_CHAR('S'),
+ EL_CHAR('E'),
+};
+
+static int *editor_hl_dynamic_ptr = editor_hl_dynamic;
+static int *editor_el_dynamic_ptr = NULL;
+static int num_editor_hl_dynamic = SIZEOF_ARRAY_INT(editor_hl_dynamic);
+static int num_editor_el_dynamic = 0;
+
+static int editor_hl_empty[] = { };
+static int editor_el_empty[ED_NUM_ELEMENTLIST_BUTTONS];
+
+static int *editor_hl_empty_ptr = editor_hl_empty;
static int *editor_el_empty_ptr = editor_el_empty;
static int num_editor_hl_empty = 0;
static int num_editor_el_empty = 0; /* dynamically determined, if needed */
static int *editor_elements = NULL; /* dynamically allocated */
static int num_editor_elements = 0; /* dynamically determined */
+static boolean setup_editor_show_always = TRUE;
+static boolean setup_editor_cascade_never = FALSE;
+
+static int editor_hl_unused[] = { EL_EMPTY };
+static int *editor_hl_unused_ptr = editor_hl_unused;
+static int num_editor_hl_unused = 0;
+
static struct
{
boolean *setup_value;
+ boolean *setup_cascade_value;
int **headline_list;
int *headline_list_size;
}
editor_elements_info[] =
{
+ {
+ &setup_editor_show_always,
+ &setup_editor_cascade_never,
+ &editor_hl_unused_ptr, &num_editor_hl_unused,
+ &editor_el_players_ptr, &num_editor_el_players
+ },
{
&setup.editor.el_boulderdash,
+ &setup.editor_cascade.el_bd,
&editor_hl_boulderdash_ptr, &num_editor_hl_boulderdash,
&editor_el_boulderdash_ptr, &num_editor_el_boulderdash
},
{
&setup.editor.el_emerald_mine,
+ &setup.editor_cascade.el_em,
&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,
+ &setup.editor_cascade.el_emc,
&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,
- &editor_el_more_ptr, &num_editor_el_more
+ &setup.editor_cascade.el_rnd,
+ &editor_hl_rnd_ptr, &num_editor_hl_rnd,
+ &editor_el_rnd_ptr, &num_editor_el_rnd
},
{
&setup.editor.el_sokoban,
+ &setup.editor_cascade.el_sb,
&editor_hl_sokoban_ptr, &num_editor_hl_sokoban,
&editor_el_sokoban_ptr, &num_editor_el_sokoban
},
{
&setup.editor.el_supaplex,
+ &setup.editor_cascade.el_sp,
&editor_hl_supaplex_ptr, &num_editor_hl_supaplex,
&editor_el_supaplex_ptr, &num_editor_el_supaplex
},
{
&setup.editor.el_diamond_caves,
+ &setup.editor_cascade.el_dc,
&editor_hl_diamond_caves_ptr, &num_editor_hl_diamond_caves,
&editor_el_diamond_caves_ptr, &num_editor_el_diamond_caves
},
{
&setup.editor.el_dx_boulderdash,
+ &setup.editor_cascade.el_dx,
&editor_hl_dx_boulderdash_ptr, &num_editor_hl_dx_boulderdash,
&editor_el_dx_boulderdash_ptr, &num_editor_el_dx_boulderdash
},
{
&setup.editor.el_chars,
+ &setup.editor_cascade.el_chars,
&editor_hl_chars_ptr, &num_editor_hl_chars,
&editor_el_chars_ptr, &num_editor_el_chars
},
{
- &setup.editor.el_custom,
- &editor_hl_custom_ptr, &num_editor_hl_custom,
- &editor_el_custom_ptr, &num_editor_el_custom
- },
- {
- &setup.editor.el_custom_more,
- &editor_hl_custom_more_ptr, &num_editor_hl_custom_more,
- &editor_el_custom_more_ptr, &num_editor_el_custom_more
+ &setup.editor.el_steel_chars,
+ &setup.editor_cascade.el_steel_chars,
+ &editor_hl_steel_chars_ptr, &num_editor_hl_steel_chars,
+ &editor_el_steel_chars_ptr, &num_editor_el_steel_chars
},
{
&setup.editor.el_custom,
- &editor_hl_custom_special_ptr, &num_editor_hl_custom_special,
- &editor_el_custom_special_ptr, &num_editor_el_custom_special
+ &setup.editor_cascade.el_ce,
+ &editor_hl_custom_ptr, &num_editor_hl_custom,
+ &editor_el_custom_ptr, &num_editor_el_custom
},
{
&setup.editor.el_custom,
+ &setup.editor_cascade.el_ge,
&editor_hl_group_ptr, &num_editor_hl_group,
&editor_el_group_ptr, &num_editor_el_group
},
{
- &setup.editor.el_custom_more,
- &editor_hl_group_more_ptr, &num_editor_hl_group_more,
- &editor_el_group_more_ptr, &num_editor_el_group_more
+ &setup.editor.el_custom,
+ &setup.editor_cascade.el_ref,
+ &editor_hl_reference_ptr, &num_editor_hl_reference,
+ &editor_el_reference_ptr, &num_editor_el_reference
},
{
&setup.editor.el_user_defined,
+ &setup.editor_cascade.el_user,
&editor_hl_user_defined_ptr, &num_editor_hl_user_defined,
&editor_el_user_defined_ptr, &num_editor_el_user_defined
},
{
+ &setup.editor.el_dynamic,
+ &setup.editor_cascade.el_dynamic,
+ &editor_hl_dynamic_ptr, &num_editor_hl_dynamic,
+ &editor_el_dynamic_ptr, &num_editor_el_dynamic,
+ },
+ {
+ &use_el_empty,
&use_el_empty,
&editor_hl_empty_ptr, &num_editor_hl_empty,
&editor_el_empty_ptr, &num_editor_el_empty,
},
{
+ NULL,
NULL,
NULL, NULL,
NULL, NULL
{
char *info_text = NULL;
- if (element < NUM_FILE_ELEMENTS)
+ if (element < MAX_NUM_ELEMENTS)
{
if (strlen(element_info[element].description) > 0)
info_text = element_info[element].description;
return info_text;
}
+char *getElementDescriptionFilename(int element)
+{
+ char *docs_dir = options.docs_directory;
+ char *elements_subdir = "elements";
+ static char *filename = NULL;
+ char basename[MAX_FILENAME_LEN];
+
+ checked_free(filename);
+
+ /* 1st try: look for element description file for exactly this element */
+ sprintf(basename, "%s.txt", element_info[element].token_name);
+ filename = getPath3(docs_dir, elements_subdir, basename);
+ if (fileExists(filename))
+ return filename;
+
+ free(filename);
+
+ /* 2nd try: look for element description file for this element's class */
+ sprintf(basename, "%s.txt", element_info[element].class_name);
+ filename = getPath3(docs_dir, elements_subdir, basename);
+ if (fileExists(filename))
+ return filename;
+
+ return NULL;
+}
+
+static void InitDynamicEditorElementList(int **elements, int *num_elements)
+{
+ boolean element_found[NUM_FILE_ELEMENTS];
+ int i, x, y;
+
+ /* initialize list of used elements to "not used" */
+ for (i = 0; i < NUM_FILE_ELEMENTS; i++)
+ element_found[i] = FALSE;
+
+ /* find all elements used in current level */
+ for (y = 0; y < lev_fieldy; y++)
+ for (x = 0; x < lev_fieldx; x++)
+ if (Feld[x][y] < NUM_FILE_ELEMENTS) /* should always be true */
+ element_found[Feld[x][y]] = TRUE;
+
+ *num_elements = 0;
+
+ /* count number of elements used in current level */
+ for (i = 0; i < NUM_FILE_ELEMENTS; i++)
+ if (element_found[i])
+ (*num_elements)++;
+
+ /* add space for up to 3 more elements for padding that may be needed */
+ *num_elements += 3;
+
+ /* free memory for old list of elements, if needed */
+ checked_free(*elements);
+
+ /* allocate memory for new list of elements */
+ *elements = checked_malloc(*num_elements * sizeof(int));
+
+ *num_elements = 0;
+
+ /* add all elements used in current level (non-custom/group elements) */
+ for (i = 0; i < NUM_FILE_ELEMENTS; i++)
+ if (element_found[i] && !(IS_CUSTOM_ELEMENT(i) || IS_GROUP_ELEMENT(i)))
+ (*elements)[(*num_elements)++] = i;
+
+ /* add all elements used in current level (custom/group elements) */
+ for (i = 0; i < NUM_FILE_ELEMENTS; i++)
+ if (element_found[i] && (IS_CUSTOM_ELEMENT(i) || IS_GROUP_ELEMENT(i)))
+ (*elements)[(*num_elements)++] = i;
+
+ while (*num_elements % 4) /* pad with empty elements, if needed */
+ (*elements)[(*num_elements)++] = EL_EMPTY;
+}
+
static void ReinitializeElementList()
{
+ static boolean initialization_needed = TRUE;
int pos = 0;
int i, j;
+ if (initialization_needed)
+ {
+ LoadSetup_EditorCascade(); /* load last editor cascade state */
+
+ /* initialize editor cascade element from saved cascade state */
+ for (i = 0; editor_elements_info[i].setup_value != NULL; i++)
+ {
+ int *cascade_element = &(*editor_elements_info[i].headline_list)[0];
+ boolean cascade_value = *editor_elements_info[i].setup_cascade_value;
+
+ if (IS_EDITOR_CASCADE(*cascade_element))
+ *cascade_element =
+ (cascade_value ? EL_CASCADE_ACTIVE(*cascade_element) :
+ EL_CASCADE_INACTIVE(*cascade_element));
+ }
+
+ initialization_needed = FALSE;
+ }
+
checked_free(editor_elements);
/* reload optional user defined element list for each invocation of editor */
LoadUserDefinedEditorElementList(&editor_el_user_defined_ptr,
&num_editor_el_user_defined);
+ /* initialize dynamic level element list for each invocation of editor */
+ InitDynamicEditorElementList(&editor_el_dynamic_ptr,
+ &num_editor_el_dynamic);
+
/* initialize list of empty elements (used for padding, if needed) */
for (i = 0; i < ED_NUM_ELEMENTLIST_BUTTONS; i++)
editor_el_empty[i] = EL_EMPTY;
if (element >= NUM_FILE_ELEMENTS)
Error(ERR_WARN, "editor element %d is runtime element", element);
- if (strcmp(getElementInfoText(element), INFOTEXT_UNKNOWN_ELEMENT) == 0)
+ if (strEqual(getElementInfoText(element), INFOTEXT_UNKNOWN_ELEMENT))
Error(ERR_WARN, "no element description for element %d", element);
}
}
/* determine size of element list */
for (i = 0; editor_elements_info[i].setup_value != NULL; i++)
{
+ boolean found_inactive_cascade = FALSE;
+
if (*editor_elements_info[i].setup_value)
{
if (setup.editor.el_headlines)
+ {
num_editor_elements += *editor_elements_info[i].headline_list_size;
+ for (j = 0; j < *editor_elements_info[i].headline_list_size; j++)
+ {
+ int element = (*editor_elements_info[i].headline_list)[j];
+
+ if (IS_EDITOR_CASCADE_INACTIVE(element))
+ found_inactive_cascade = TRUE;
+ }
+ }
+
+ if (found_inactive_cascade)
+ continue;
+
num_editor_elements += *editor_elements_info[i].element_list_size;
}
}
/* fill element list */
for (i = 0; editor_elements_info[i].setup_value != NULL; i++)
{
+ boolean found_inactive_cascade = FALSE;
+
if (*editor_elements_info[i].setup_value)
{
if (setup.editor.el_headlines)
+ {
for (j = 0; j < *editor_elements_info[i].headline_list_size; j++)
- editor_elements[pos++] = (*editor_elements_info[i].headline_list)[j];
+ {
+ int element = (*editor_elements_info[i].headline_list)[j];
+
+ editor_elements[pos++] = element;
+
+ if (IS_EDITOR_CASCADE_INACTIVE(element))
+ found_inactive_cascade = TRUE;
+ }
+ }
+
+ if (found_inactive_cascade)
+ continue;
for (j = 0; j < *editor_elements_info[i].element_list_size; j++)
editor_elements[pos++] = (*editor_elements_info[i].element_list)[j];
}
}
- /* correct position of element list scrollbar */
- if (element_shift < 0)
- element_shift = 0;
- if (element_shift > num_editor_elements - ED_NUM_ELEMENTLIST_BUTTONS)
- element_shift = num_editor_elements - ED_NUM_ELEMENTLIST_BUTTONS;
+ /* (this function is also called before editor gadgets are initialized!) */
+ AdjustElementListScrollbar();
}
void PrintEditorElementList()
for (i = 0; editor_elements_info[i].setup_value != stop; i++)
{
+ int cascade_element = (*editor_elements_info[i].headline_list)[0];
+
+ if (IS_EDITOR_CASCADE(cascade_element))
+ {
+ int cascade_element_show = EL_CASCADE_INACTIVE(cascade_element);
+ char *headline = element_info[cascade_element_show].editor_description;
+
+ printf_line_with_prefix("# ", "-", 77);
+ printf("# %s\n", headline);
+ printf_line_with_prefix("# ", "-", 77);
+ }
+
for (j = 0; j < *editor_elements_info[i].headline_list_size; j++)
{
int element = (*editor_elements_info[i].headline_list)[j];
+ if (IS_EDITOR_CASCADE(element))
+ element = EL_CHAR_MINUS;
+
printf("# %s\n", element_info[element].token_name);
}
int src_x, src_y;
int num_mini_tilex = width / MINI_TILEX + 1;
int num_mini_tiley = height / MINI_TILEY + 1;
+ int from_x = dest_x - MINI_TILEX / 2;
+ int from_y = dest_y - MINI_TILEY / 2;
+ int to_x = from_x + num_mini_tilex * MINI_TILEX - 1;
+ int to_y = from_y + num_mini_tiley * MINI_TILEY - 1;
int x, y;
getMiniGraphicSource(border_graphic, &src_bitmap, &src_x, &src_y);
for (y = 0; y < num_mini_tiley; y++)
for (x = 0; x < num_mini_tilex; x++)
BlitBitmap(src_bitmap, drawto, src_x, src_y, MINI_TILEX, MINI_TILEY,
- dest_x - MINI_TILEX / 2 + x * MINI_TILEX,
- dest_y - MINI_TILEY / 2 + y * MINI_TILEY);
+ from_x + x * MINI_TILEX, from_y + y * MINI_TILEY);
ClearRectangle(drawto, dest_x - 1, dest_y - 1, width + 2, height + 2);
+
+ DrawSimpleBlackLine(drawto, from_x, from_y, to_x, from_y);
+ DrawSimpleBlackLine(drawto, to_x, from_y, to_x, to_y);
+ DrawSimpleBlackLine(drawto, to_x, to_y, from_x, to_y);
+ DrawSimpleBlackLine(drawto, from_x, to_y, from_x, from_y);
}
static void DrawDrawingArea(int id)
struct GadgetInfo *gi = level_editor_gadget[drawingarea_info[id].gadget_id];
int x, y;
- if (id == ED_DRAWING_ID_RANDOM_BACKGROUND)
- DrawMiniGraphicExt(drawto, gi->x, gi->y,
- el2edimg(random_placement_background_element));
- else if (id == ED_DRAWING_ID_AMOEBA_CONTENT)
- DrawMiniGraphicExt(drawto, gi->x, gi->y, el2edimg(level.amoeba_content));
- else if (id == ED_DRAWING_ID_CUSTOM_GRAPHIC)
- DrawMiniGraphicExt(drawto, gi->x, gi->y,
- el2edimg(custom_element.gfx_element));
- else if (id == ED_DRAWING_ID_CUSTOM_CONTENT)
- 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(custom_element.content[x][y]));
- else if (id == ED_DRAWING_ID_CUSTOM_MOVE_ENTER)
- DrawMiniGraphicExt(drawto, gi->x, gi->y,
- el2edimg(custom_element.move_enter_element));
- else if (id == ED_DRAWING_ID_CUSTOM_MOVE_LEAVE)
- DrawMiniGraphicExt(drawto, gi->x, gi->y,
- el2edimg(custom_element.move_leave_element));
- else if (id == ED_DRAWING_ID_CUSTOM_CHANGE_TARGET)
- DrawMiniGraphicExt(drawto, gi->x, gi->y,
- el2edimg(custom_element_change.target_element));
- else if (id == ED_DRAWING_ID_CUSTOM_CHANGE_CONTENT)
- 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(custom_element_change.target_content[x][y]));
- else if (id == ED_DRAWING_ID_CUSTOM_CHANGE_TRIGGER)
- DrawMiniGraphicExt(drawto, gi->x, gi->y,
- el2edimg(custom_element_change.trigger_element));
- else if (id == ED_DRAWING_ID_GROUP_CONTENT)
- 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_YAMYAM_CONTENT_0 &&
- id <= ED_DRAWING_ID_YAMYAM_CONTENT_7)
- {
- int nr = id - ED_DRAWING_ID_YAMYAM_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.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;
+ int *value = drawingarea_info[id].value;
+ int area_xsize = drawingarea_info[id].area_xsize;
+ int area_ysize = drawingarea_info[id].area_ysize;
- 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]));
- }
+ for (x = 0; x < area_xsize; x++)
+ for (y = 0; y < area_ysize; y++)
+ DrawMiniGraphicExt(drawto,
+ gi->x + x * MINI_TILEX,
+ gi->y + y * MINI_TILEY,
+ el2edimg(value[x * area_ysize + y]));
}
static void ScrollMiniLevel(int from_x, int from_y, int scroll)
if (i == ED_COUNTER_ID_SELECT_LEVEL)
{
font_type = FONT_LEVEL_NUMBER;
+#if 1
+ font_type_active = FONT_LEVEL_NUMBER_ACTIVE;
+#else
font_type_active = FONT_LEVEL_NUMBER;
-
+#endif
x += 2 * ED_GADGET_DISTANCE;
y -= ED_GADGET_DISTANCE;
GDI_SCROLLBAR_ITEMS_MAX, items_max,
GDI_SCROLLBAR_ITEMS_VISIBLE, items_visible,
GDI_SCROLLBAR_ITEM_POSITION, item_position,
+ GDI_WHEEL_AREA_X, scrollbar_info[i].wheel_x,
+ GDI_WHEEL_AREA_Y, scrollbar_info[i].wheel_y,
+ GDI_WHEEL_AREA_WIDTH, scrollbar_info[i].wheel_width,
+ GDI_WHEEL_AREA_HEIGHT, scrollbar_info[i].wheel_height,
GDI_STATE, GD_BUTTON_UNPRESSED,
GDI_DESIGN_UNPRESSED, gd_bitmap, gd_x1, gd_y1,
GDI_DESIGN_PRESSED, gd_bitmap, gd_x2, gd_y2,
int i;
for (i = 0; i < NUM_EDITOR_GADGETS; i++)
+ {
FreeGadget(level_editor_gadget[i]);
+
+ level_editor_gadget[i] = NULL;
+ }
}
static void MapCounterButtons(int id)
int yoffset_above = MINI_TILEX + ED_GADGET_DISTANCE;
int yoffset = ED_BORDER_SIZE;
int x_left = gi_down->x - xoffset_left;
- int x_right = gi_up->x + gi_up->width + xoffset_right;
+ int x_right; /* set after gadget position was modified */
int y_above = gi_down->y - yoffset_above;
int x = gi_down->x;
int y; /* set after gadget position was modified */
- /* set position for "value1/value2" counter gadgets (score in most cases) */
- if (id == ED_COUNTER_ID_ELEMENT_VALUE1 ||
- id == ED_COUNTER_ID_ELEMENT_VALUE2)
+ /* counter limits must be changed first to prevent value truncation */
+ ModifyEditorCounterLimits(id, counterbutton_info[id].min_value,
+ counterbutton_info[id].max_value);
+
+ /* right text position might have changed after setting position above */
+ x_right = gi_up->x + gi_up->width + xoffset_right;
+
+ ModifyEditorCounterValue(id, *counterbutton_info[id].value);
+
+ /* set position for "value[1,2,3,4]" counter gadgets (score in most cases) */
+ if (id >= ED_COUNTER_ID_ELEMENT_VALUE1 &&
+ id <= ED_COUNTER_ID_ELEMENT_VALUE4)
{
ModifyGadget(gi_down, GDI_Y, SY + counterbutton_info[id].y, GDI_END);
ModifyGadget(gi_text, GDI_Y, SY + counterbutton_info[id].y, GDI_END);
ModifyGadget(gi_up, GDI_Y, SY + counterbutton_info[id].y, GDI_END);
}
+ /* vertical position might have changed after setting position above */
y = gi_up->y + yoffset;
if (counterbutton_info[id].text_above)
if (counterbutton_info[id].text_right)
DrawText(x_right, y, counterbutton_info[id].text_right, FONT_TEXT_1);
- ModifyEditorCounter(id, *counterbutton_info[id].value);
-
MapGadget(gi_down);
MapGadget(gi_text);
MapGadget(gi_up);
/* map buttons to select level */
counter_id = ED_COUNTER_ID_SELECT_LEVEL;
- ModifyEditorCounterLimits(counter_id,
- leveldir_current->first_level,
- leveldir_current->last_level);
+ counterbutton_info[counter_id].min_value = leveldir_current->first_level;
+ counterbutton_info[counter_id].max_value = leveldir_current->last_level;
MapCounterButtons(counter_id);
}
if (selectbox_info[id].text_right)
DrawText(x_right, y, selectbox_info[id].text_right, FONT_TEXT_1);
- ModifyEditorSelectbox(id, *selectbox_info[id].value);
+ ModifyEditorSelectboxValue(id, *selectbox_info[id].value);
MapGadget(gi);
}
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 ||
- Feld[x][y] == EL_SP_MURPHY)
- player_found = TRUE;
+ for (y = 0; y < lev_fieldy; y++) for (x = 0; x < lev_fieldx; x++)
+ {
+ if (Feld[x][y] == EL_PLAYER_1 ||
+ Feld[x][y] == EL_SP_MURPHY)
+ player_found = TRUE;
+ }
return player_found;
}
return new_index_value;
}
-static void copy_custom_element_settings(int element_from, int element_to)
+static void setSelectboxSpecialActionVariablesIfNeeded()
{
- struct ElementInfo *ei_from = &element_info[element_from];
- struct ElementInfo *ei_to = &element_info[element_to];
- int i, x, y;
-
- /* ---------- copy element description ---------- */
- for (i = 0; i < MAX_ELEMENT_NAME_LEN + 1; i++)
- ei_to->description[i] = ei_from->description[i];
-
- /* ---------- copy element base properties ---------- */
- Properties[element_to][EP_BITFIELD_BASE] =
- Properties[element_from][EP_BITFIELD_BASE];
-
- /* ---------- copy custom property values ---------- */
-
- ei_to->use_gfx_element = ei_from->use_gfx_element;
- ei_to->gfx_element = ei_from->gfx_element;
-
- ei_to->access_direction = ei_from->access_direction;
-
- ei_to->collect_score_initial = ei_from->collect_score_initial;
- ei_to->collect_count_initial = ei_from->collect_count_initial;
-
- ei_to->push_delay_fixed = ei_from->push_delay_fixed;
- ei_to->push_delay_random = ei_from->push_delay_random;
- ei_to->drop_delay_fixed = ei_from->drop_delay_fixed;
- ei_to->drop_delay_random = ei_from->drop_delay_random;
- ei_to->move_delay_fixed = ei_from->move_delay_fixed;
- ei_to->move_delay_random = ei_from->move_delay_random;
-
- ei_to->move_pattern = ei_from->move_pattern;
- ei_to->move_direction_initial = ei_from->move_direction_initial;
- ei_to->move_stepsize = ei_from->move_stepsize;
+ int i;
- ei_to->move_enter_element = ei_from->move_enter_element;
- ei_to->move_leave_element = ei_from->move_leave_element;
- ei_to->move_leave_type = ei_from->move_leave_type;
+ /* change action mode and arg variables according to action type variable */
+ for (i = 0; action_arg_options[i].value != -1; i++)
+ {
+ if (action_arg_options[i].value == custom_element_change.action_type)
+ {
+ int mode = action_arg_options[i].mode;
- ei_to->slippery_type = ei_from->slippery_type;
+ /* only change if corresponding selectbox has changed */
+ if (selectbox_info[ED_SELECTBOX_ID_ACTION_MODE].options !=
+ action_arg_modes[mode])
+ custom_element_change.action_mode = -1;
- for (y = 0; y < 3; y++)
- for (x = 0; x < 3; x++)
- ei_to->content[x][y] = ei_from->content[x][y];
+ /* only change if corresponding selectbox has changed */
+ if (selectbox_info[ED_SELECTBOX_ID_ACTION_ARG].options !=
+ action_arg_options[i].options)
+ custom_element_change.action_arg = -1;
- ei_to->explosion_type = ei_from->explosion_type;
- ei_to->explosion_delay = ei_from->explosion_delay;
- ei_to->ignition_delay = ei_from->ignition_delay;
+ break;
+ }
+ }
+}
- /* ---------- reinitialize and copy change pages ---------- */
+static void setSelectboxSpecialActionOptions()
+{
+ int i;
- ei_to->num_change_pages = ei_from->num_change_pages;
- ei_to->current_change_page = ei_from->current_change_page;
+ /* change action mode and arg selectbox according to action type selectbox */
+ for (i = 0; action_arg_options[i].value != -1; i++)
+ {
+ if (action_arg_options[i].value == custom_element_change.action_type)
+ {
+ int mode = action_arg_options[i].mode;
- setElementChangePages(ei_to, ei_to->num_change_pages);
+ ModifyEditorSelectboxOptions(ED_SELECTBOX_ID_ACTION_MODE,
+ action_arg_modes[mode]);
+ ModifyEditorSelectboxValue(ED_SELECTBOX_ID_ACTION_MODE,
+ custom_element_change.action_mode);
- for (i=0; i < ei_to->num_change_pages; i++)
- ei_to->change_page[i] = ei_from->change_page[i];
+ ModifyEditorSelectboxOptions(ED_SELECTBOX_ID_ACTION_ARG,
+ action_arg_options[i].options);
+ ModifyEditorSelectboxValue(ED_SELECTBOX_ID_ACTION_ARG,
+ custom_element_change.action_arg);
+ break;
+ }
+ }
+}
- /* ---------- copy group element info ---------- */
- if (ei_from->group != NULL && ei_to->group != NULL) /* group or internal */
- *ei_to->group = *ei_from->group;
+static void copy_custom_element_settings(int element_from, int element_to)
+{
+ struct ElementInfo *ei_from = &element_info[element_from];
+ struct ElementInfo *ei_to = &element_info[element_to];
- /* mark this custom element as modified */
- ei_to->modified_settings = TRUE;
+ copyElementInfo(ei_from, ei_to);
}
static void replace_custom_element_in_settings(int element_from,
for (y = 0; y < 3; y++)
for (x = 0; x < 3; x++)
- if (ei->content[x][y] == element_from)
- ei->content[x][y] = element_to;
+ if (ei->content.e[x][y] == element_from)
+ ei->content.e[x][y] = element_to;
for (j = 0; j < ei->num_change_pages; j++)
{
for (y = 0; y < 3; y++)
for (x = 0; x < 3; x++)
- if (change->target_content[x][y] == element_from)
- change->target_content[x][y] = element_to;
+ if (change->target_content.e[x][y] == element_from)
+ change->target_content.e[x][y] = element_to;
}
if (ei->group != NULL) /* group or internal */
custom_element = element_info[element];
custom_element_change = *element_info[element].change;
+ /* needed to initially set selectbox options for special action options */
+ setSelectboxSpecialActionOptions();
+
/* needed to initially set selectbox value variables to reliable defaults */
for (i = 0; i < ED_NUM_SELECTBOX; i++)
setSelectboxValue(i, *selectbox_info[i].value);
custom_element_change.direct_action =
(HAS_CHANGE_EVENT(element, CE_TOUCHED_BY_PLAYER) ? CE_TOUCHED_BY_PLAYER :
HAS_CHANGE_EVENT(element, CE_PRESSED_BY_PLAYER) ? CE_PRESSED_BY_PLAYER :
+ HAS_CHANGE_EVENT(element, CE_SWITCHED_BY_PLAYER) ? CE_SWITCHED_BY_PLAYER :
+ HAS_CHANGE_EVENT(element, CE_SNAPPED_BY_PLAYER) ? CE_SNAPPED_BY_PLAYER :
HAS_CHANGE_EVENT(element, CE_PUSHED_BY_PLAYER) ? CE_PUSHED_BY_PLAYER :
HAS_CHANGE_EVENT(element, CE_ENTERED_BY_PLAYER) ? CE_ENTERED_BY_PLAYER :
HAS_CHANGE_EVENT(element, CE_LEFT_BY_PLAYER) ? CE_LEFT_BY_PLAYER :
HAS_CHANGE_EVENT(element, CE_BLOCKED) ? CE_BLOCKED :
HAS_CHANGE_EVENT(element, CE_IMPACT) ? CE_IMPACT :
HAS_CHANGE_EVENT(element, CE_SMASHED) ? CE_SMASHED :
- HAS_CHANGE_EVENT(element, CE_COUNT_AT_ZERO) ? CE_COUNT_AT_ZERO :
+ HAS_CHANGE_EVENT(element, CE_VALUE_CHANGES) ? CE_VALUE_CHANGES :
+ HAS_CHANGE_EVENT(element, CE_SCORE_CHANGES) ? CE_SCORE_CHANGES :
+ HAS_CHANGE_EVENT(element, CE_VALUE_GETS_ZERO) ? CE_VALUE_GETS_ZERO :
+ HAS_CHANGE_EVENT(element, CE_SCORE_GETS_ZERO) ? CE_SCORE_GETS_ZERO :
custom_element_change.direct_action);
/* set "change by other element action" selectbox help value */
custom_element_change.other_action =
(HAS_CHANGE_EVENT(element, CE_PLAYER_TOUCHES_X) ? CE_PLAYER_TOUCHES_X :
HAS_CHANGE_EVENT(element, CE_PLAYER_PRESSES_X) ? CE_PLAYER_PRESSES_X :
+ HAS_CHANGE_EVENT(element, CE_PLAYER_SWITCHES_X) ? CE_PLAYER_SWITCHES_X :
+ HAS_CHANGE_EVENT(element, CE_PLAYER_SNAPS_X) ? CE_PLAYER_SNAPS_X :
HAS_CHANGE_EVENT(element, CE_PLAYER_PUSHES_X) ? CE_PLAYER_PUSHES_X :
HAS_CHANGE_EVENT(element, CE_PLAYER_ENTERS_X) ? CE_PLAYER_ENTERS_X :
HAS_CHANGE_EVENT(element, CE_PLAYER_LEAVES_X) ? CE_PLAYER_LEAVES_X :
HAS_CHANGE_EVENT(element, CE_PLAYER_DROPS_X) ? CE_PLAYER_DROPS_X :
HAS_CHANGE_EVENT(element, CE_TOUCHING_X) ? CE_TOUCHING_X :
HAS_CHANGE_EVENT(element, CE_HITTING_X) ? CE_HITTING_X :
+ HAS_CHANGE_EVENT(element, CE_DIGGING_X) ? CE_DIGGING_X :
HAS_CHANGE_EVENT(element, CE_HIT_BY_X) ? CE_HIT_BY_X :
HAS_CHANGE_EVENT(element, CE_SWITCH_OF_X) ? CE_SWITCH_OF_X :
HAS_CHANGE_EVENT(element, CE_CHANGE_OF_X) ? CE_CHANGE_OF_X :
HAS_CHANGE_EVENT(element, CE_EXPLOSION_OF_X) ? CE_EXPLOSION_OF_X :
- HAS_CHANGE_EVENT(element, CE_COUNT_AT_ZERO_OF_X) ? CE_COUNT_AT_ZERO_OF_X :
+ HAS_CHANGE_EVENT(element, CE_MOVE_OF_X) ? CE_MOVE_OF_X :
+ HAS_CHANGE_EVENT(element, CE_CREATION_OF_X) ? CE_CREATION_OF_X :
+ HAS_CHANGE_EVENT(element, CE_VALUE_CHANGES_OF_X) ? CE_VALUE_CHANGES_OF_X :
+ HAS_CHANGE_EVENT(element, CE_SCORE_CHANGES_OF_X) ? CE_SCORE_CHANGES_OF_X :
+ HAS_CHANGE_EVENT(element, CE_VALUE_GETS_ZERO_OF_X) ? CE_VALUE_GETS_ZERO_OF_X :
+ HAS_CHANGE_EVENT(element, CE_SCORE_GETS_ZERO_OF_X) ? CE_SCORE_GETS_ZERO_OF_X :
custom_element_change.other_action);
}
/* set player change event from checkbox and selectbox */
custom_element_change_events[CE_TOUCHED_BY_PLAYER] = FALSE;
custom_element_change_events[CE_PRESSED_BY_PLAYER] = FALSE;
+ custom_element_change_events[CE_SWITCHED_BY_PLAYER] = FALSE;
+ custom_element_change_events[CE_SNAPPED_BY_PLAYER] = FALSE;
custom_element_change_events[CE_PUSHED_BY_PLAYER] = FALSE;
custom_element_change_events[CE_ENTERED_BY_PLAYER] = FALSE;
custom_element_change_events[CE_LEFT_BY_PLAYER] = FALSE;
custom_element_change_events[CE_BLOCKED] = FALSE;
custom_element_change_events[CE_IMPACT] = FALSE;
custom_element_change_events[CE_SMASHED] = FALSE;
- custom_element_change_events[CE_COUNT_AT_ZERO] = FALSE;
+ custom_element_change_events[CE_VALUE_CHANGES] = FALSE;
+ custom_element_change_events[CE_SCORE_CHANGES] = FALSE;
+ custom_element_change_events[CE_VALUE_GETS_ZERO] = FALSE;
+ custom_element_change_events[CE_SCORE_GETS_ZERO] = FALSE;
custom_element_change_events[custom_element_change.direct_action] =
custom_element_change_events[CE_BY_DIRECT_ACTION];
/* set other element action change event from checkbox and selectbox */
custom_element_change_events[CE_PLAYER_TOUCHES_X] = FALSE;
custom_element_change_events[CE_PLAYER_PRESSES_X] = FALSE;
+ custom_element_change_events[CE_PLAYER_SWITCHES_X] = FALSE;
+ custom_element_change_events[CE_PLAYER_SNAPS_X] = FALSE;
custom_element_change_events[CE_PLAYER_PUSHES_X] = FALSE;
custom_element_change_events[CE_PLAYER_ENTERS_X] = FALSE;
custom_element_change_events[CE_PLAYER_LEAVES_X] = FALSE;
custom_element_change_events[CE_PLAYER_DROPS_X] = FALSE;
custom_element_change_events[CE_TOUCHING_X] = FALSE;
custom_element_change_events[CE_HITTING_X] = FALSE;
+ custom_element_change_events[CE_DIGGING_X] = FALSE;
custom_element_change_events[CE_HIT_BY_X] = FALSE;
custom_element_change_events[CE_SWITCH_OF_X] = FALSE;
custom_element_change_events[CE_CHANGE_OF_X] = FALSE;
custom_element_change_events[CE_EXPLOSION_OF_X] = FALSE;
- custom_element_change_events[CE_COUNT_AT_ZERO_OF_X] = FALSE;
+ custom_element_change_events[CE_MOVE_OF_X] = FALSE;
+ custom_element_change_events[CE_CREATION_OF_X] = FALSE;
+ custom_element_change_events[CE_VALUE_CHANGES_OF_X] = FALSE;
+ custom_element_change_events[CE_SCORE_CHANGES_OF_X] = FALSE;
+ custom_element_change_events[CE_VALUE_GETS_ZERO_OF_X] = FALSE;
+ custom_element_change_events[CE_SCORE_GETS_ZERO_OF_X] = FALSE;
custom_element_change_events[custom_element_change.other_action] =
custom_element_change_events[CE_BY_OTHER_ACTION];
CopyClassicElementPropertiesToGame(element);
}
+void CheckElementDescriptions()
+{
+ int i;
+
+ for (i = 0; i < NUM_FILE_ELEMENTS; i++)
+ if (getElementDescriptionFilename(i) == NULL && !IS_OBSOLETE(i))
+ Error(ERR_WARN, "no element description for element '%s'", EL_NAME(i));
+}
+
void DrawLevelEd()
{
CloseDoor(DOOR_CLOSE_ALL);
OpenDoor(DOOR_OPEN_2 | DOOR_NO_DELAY);
+#if DEBUG
+ CheckElementDescriptions();
+#endif
+
if (level_editor_test_game)
{
CopyPlayfield(level.field, Feld);
redraw_mask |= REDRAW_ALL;
+ ReinitializeElementList(); /* update dynamic level element list */
ReinitializeElementListButtons(); /* custom element may look different */
+#if 1
+ UnmapAllGadgets();
+#else
UnmapTapeButtons();
+#endif
MapControlButtons();
DrawEditModeWindow();
GDI_SCROLLBAR_ITEM_POSITION, item_position, GDI_END);
}
-static void ModifyEditorCounter(int counter_id, int new_value)
+static void AdjustElementListScrollbar()
+{
+ struct GadgetInfo *gi = level_editor_gadget[GADGET_ID_SCROLL_LIST_VERTICAL];
+ int items_max, items_visible, item_position;
+
+ /* correct position of element list scrollbar */
+ if (element_shift < 0)
+ element_shift = 0;
+ if (element_shift > num_editor_elements - ED_NUM_ELEMENTLIST_BUTTONS)
+ element_shift = num_editor_elements - ED_NUM_ELEMENTLIST_BUTTONS;
+
+ items_max = num_editor_elements / ED_ELEMENTLIST_BUTTONS_HORIZ;
+ items_visible = ED_ELEMENTLIST_BUTTONS_VERT;
+ item_position = element_shift / ED_ELEMENTLIST_BUTTONS_HORIZ;
+
+ ModifyGadget(gi, GDI_SCROLLBAR_ITEMS_MAX, items_max,
+ GDI_SCROLLBAR_ITEMS_VISIBLE, items_visible,
+ GDI_SCROLLBAR_ITEM_POSITION, item_position, GDI_END);
+}
+
+static void ModifyEditorCounterValue(int counter_id, int new_value)
{
int *counter_value = counterbutton_info[counter_id].value;
int gadget_id = counterbutton_info[counter_id].gadget_id_text;
struct GadgetInfo *gi = level_editor_gadget[gadget_id];
ModifyGadget(gi, GDI_NUMBER_MIN, min, GDI_NUMBER_MAX, max, GDI_END);
+
+ if (counter_id >= ED_COUNTER_ID_ELEMENT_VALUE1 &&
+ counter_id <= ED_COUNTER_ID_ELEMENT_VALUE4)
+ {
+ int gadget_id_up = counterbutton_info[counter_id].gadget_id_up;
+ struct GadgetInfo *gi_up = level_editor_gadget[gadget_id_up];
+
+ ModifyGadget(gi, GDI_TEXT_SIZE, (max < 10 ? 1 : 3), GDI_END);
+ ModifyGadget(gi_up, GDI_X, gi->x + gi->width + ED_GADGET_DISTANCE,GDI_END);
+ }
}
-static void ModifyEditorSelectbox(int selectbox_id, int new_value)
+static void ModifyEditorSelectboxValue(int selectbox_id, int new_value)
{
int gadget_id = selectbox_info[selectbox_id].gadget_id;
struct GadgetInfo *gi = level_editor_gadget[gadget_id];
ModifyGadget(gi, GDI_SELECTBOX_INDEX, new_index_value, GDI_END);
}
+static void ModifyEditorSelectboxOptions(int selectbox_id,
+ struct ValueTextInfo *options)
+{
+ int gadget_id = selectbox_info[selectbox_id].gadget_id;
+ struct GadgetInfo *gi = level_editor_gadget[gadget_id];
+
+ selectbox_info[selectbox_id].options = options;
+
+ /* set index to zero -- list may be shorter now (correct later, if needed) */
+ ModifyGadget(gi, GDI_SELECTBOX_INDEX, 0,
+ GDI_SELECTBOX_OPTIONS, options, GDI_END);
+}
+
static void ModifyEditorDrawingArea(int drawingarea_id, int xsize, int ysize)
{
int gadget_id = drawingarea_info[drawingarea_id].gadget_id;
struct GadgetInfo *gi = level_editor_gadget[gadget_id];
+ drawingarea_info[drawingarea_id].area_xsize = xsize;
+ drawingarea_info[drawingarea_id].area_ysize = ysize;
+
ModifyGadget(gi, GDI_AREA_SIZE, xsize, ysize, GDI_END);
}
int element = editor_elements[element_shift + i];
UnmapGadget(gi);
+
getMiniGraphicSource(el2edimg(element), &gd->bitmap, &gd->x, &gd->y);
ModifyGadget(gi, GDI_INFO_TEXT, getElementInfoText(element), GDI_END);
+
MapGadget(gi);
}
}
ClearWindow();
UnmapLevelEditorWindowGadgets();
+#if 0
+ DrawTextSCentered(ED_SETTINGS1_YPOS, FONT_TITLE_1, "Level Settings");
+ DrawTextSCentered(ED_SETTINGS2_YPOS, FONT_TITLE_1, "Editor Settings");
+#else
DrawText(SX + ED_SETTINGS2_XPOS, SY + ED_SETTINGS1_YPOS,
"Level Settings", FONT_TITLE_1);
DrawText(SX + ED_SETTINGS2_XPOS, SY + ED_SETTINGS2_YPOS,
"Editor Settings", FONT_TITLE_1);
+#endif
/* draw counter gadgets */
for (i = ED_COUNTER_ID_LEVEL_FIRST; i <= ED_COUNTER_ID_LEVEL_LAST; i++)
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);
+ /* display counter to choose number of element content areas */
+ MapCounterButtons(ED_COUNTER_ID_BALL_CONTENT);
+
+ for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
+ {
+ int id = ED_DRAWING_ID_MAGIC_BALL_CONTENT_0 + i;
+
+ if (i < level.num_ball_contents)
+ {
+ MapDrawingArea(id);
+ }
+ else
+ {
+ int font_height = getFontHeight(FONT_TEXT_1);
+
+ UnmapDrawingArea(id);
+
+ /* delete content areas in case of reducing number of them */
+ DrawBackground(SX + drawingarea_info[id].x - MINI_TILEX / 2,
+ SY + drawingarea_info[id].y - MINI_TILEY / 2,
+ 4 * MINI_TILEX,
+ 4 * MINI_TILEY + ED_GADGET_TEXT_DISTANCE + font_height);
+ }
+ }
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 DrawAndroidElementArea(int element)
+{
+ int num_elements = level.num_android_clone_elements;
+ int id = ED_DRAWING_ID_ANDROID_CONTENT;
+ int sx = SX + drawingarea_info[id].x - MINI_TILEX / 2;
+ int sy = SY + drawingarea_info[id].y - MINI_TILEY / 2;
+ int xsize = MAX_ANDROID_ELEMENTS;
+ int ysize = 1;
+
+ /* display counter to choose number of element areas */
+ MapCounterButtons(ED_COUNTER_ID_ANDROID_CONTENT);
+
+ if (drawingarea_info[id].text_left != NULL)
+ sx += getTextWidthForDrawingArea(drawingarea_info[id].text_left);
+
+ UnmapDrawingArea(id);
+
+ ModifyEditorDrawingArea(id, num_elements, 1);
+
+ /* delete content areas in case of reducing number of them */
+ DrawBackground(sx, sy, (xsize + 1) * MINI_TILEX, (ysize + 1) * MINI_TILEY);
+
+ MapDrawingArea(id);
+}
+
static void DrawGroupElementArea(int element)
{
int num_elements = group_element_info.num_elements;
DrawBackground(gi->x, gi->y, gi->width, gi->height);
if (envelope_nr != -1)
- textarea_info[id].value = level.envelope_text[envelope_nr];
+ textarea_info[id].value = level.envelope[envelope_nr].text;
ModifyGadget(gi, GDI_AREA_SIZE,
*counterbutton_info[ED_COUNTER_ID_ENVELOPE_XSIZE].value,
MapTextAreaGadget(ED_TEXTAREA_ID_ENVELOPE_INFO);
}
-char *getElementDescriptionFilename(int element)
-{
- char *docs_dir = options.docs_directory;
- char *elements_subdir = "elements";
- static char *filename = NULL;
- char basename[MAX_FILENAME_LEN];
-
- checked_free(filename);
-
- /* 1st try: look for element description file for exactly this element */
- sprintf(basename, "%s.txt", element_info[element].token_name);
- filename = getPath3(docs_dir, elements_subdir, basename);
- if (fileExists(filename))
- return filename;
-
- free(filename);
-
- /* 2nd try: look for element description file for this element's class */
- sprintf(basename, "%s.txt", element_info[element].class_name);
- filename = getPath3(docs_dir, elements_subdir, basename);
- if (fileExists(filename))
- return filename;
-
- return NULL;
-}
-
static boolean PrintInfoText(char *text, int font_nr, int start_line)
{
int font_height = getFontHeight(font_nr);
int max_chars_per_line = (SXSIZE - 2 * pad_x) / font_width;
int max_lines_per_screen = (SYSIZE - pad_y) / font_height - 1;
- return DrawTextFromFile(sx, sy, filename, font_nr, max_chars_per_line,
- max_lines_per_screen);
+ return DrawTextFile(sx, sy, filename, font_nr, max_chars_per_line, -1,
+ max_lines_per_screen, -1, TRUE, FALSE, FALSE);
}
static void DrawPropertiesTabulatorGadgets()
{
- struct GadgetInfo *gd_gi = level_editor_gadget[GADGET_ID_PROPERTIES_INFO];
- struct GadgetDesign *gd = &gd_gi->alt_design[GD_BUTTON_UNPRESSED];
- int gd_x = gd->x + gd_gi->border.width / 2;
- int gd_y = gd->y + gd_gi->height - 1;
+ struct GadgetInfo *gd_gi1 = level_editor_gadget[GADGET_ID_PROPERTIES_INFO];
+ struct GadgetInfo *gd_gi4 = level_editor_gadget[GADGET_ID_PROPERTIES_CHANGE];
+ struct GadgetDesign *gd = &gd_gi1->alt_design[GD_BUTTON_UNPRESSED];
+ int gd_x = gd->x + gd_gi1->border.width / 2;
+ int gd_y = gd->y + gd_gi1->height - 1;
Pixel tab_color = GetPixel(gd->bitmap, gd_x, gd_y);
int id_first = ED_TEXTBUTTON_ID_PROPERTIES_INFO;
int id_last = ED_TEXTBUTTON_ID_PROPERTIES_CONFIG;
+#if 1
+#else
int max_tabs = 4;
+#endif
int i;
- /* draw additional "advanced" tabulator for custom elements */
+ /* draw additional "change" tabulator for custom elements */
if (IS_CUSTOM_ELEMENT(properties_element))
id_last = ED_TEXTBUTTON_ID_PROPERTIES_CHANGE;
continue;
/* draw background line below tabulator button */
- ClearRectangleOnBackground(drawto, gi->x, gi->y + gi->height, gi->width,1);
+ ClearRectangleOnBackground(drawto, gi->x, gi->y + gi->height, gi->width, 1);
/* draw solid line below inactive tabulator buttons */
if (!active && tab_color != BLACK_PIXEL) /* black => transparent */
- FillRectangle(drawto, gi->x, gi->y + gi->height, gi->width,1, tab_color);
+ FillRectangle(drawto, gi->x, gi->y + gi->height, gi->width, 1, tab_color);
ModifyGadget(gi, GDI_ACTIVE, active, GDI_END);
MapTextbuttonGadget(i);
}
+#if 1
+ /* draw little border line below tabulator buttons */
+ if (tab_color != BLACK_PIXEL) /* black => transparent */
+ FillRectangle(drawto, gd_gi1->x, gd_gi1->y + gd_gi1->height + 1,
+ gd_gi4->x - gd_gi1->x + gd_gi4->width, ED_GADGET_DISTANCE,
+ tab_color);
+#else
/* draw little border line below tabulator buttons */
if (tab_color != BLACK_PIXEL) /* black => transparent */
- FillRectangle(drawto, gd_gi->x, gd_gi->y + gd_gi->height + 1,
- max_tabs * gd_gi->width + (max_tabs -1) * ED_GADGET_DISTANCE,
+ FillRectangle(drawto, gd_gi1->x, gd_gi1->y + gd_gi1->height + 1,
+ max_tabs * gd_gi1->width + (max_tabs -1) * ED_GADGET_DISTANCE,
ED_GADGET_DISTANCE, tab_color);
+#endif
}
static void DrawPropertiesInfo()
/* pre-defined properties */
{ EP_CAN_PASS_MAGIC_WALL, "- can pass magic walls" },
+ { EP_CAN_PASS_DC_MAGIC_WALL,"- can pass magic walls (DC style)" },
{ EP_SWITCHABLE, "- can be switched" },
- { EP_HAS_CONTENT, "- can contain other elements" },
+#if 0
+ { EP_HAS_EDITOR_CONTENT, "- can contain other elements" },
+#endif
{ -1, NULL }
};
int screen_line = 0;
int i, x, y;
-#if DEBUG
- if (IS_CUSTOM_ELEMENT(properties_element))
- {
- DrawTextF(pad_x, pad_y + screen_line++ * font2_height, FONT_TEXT_3,
- "[Custom Element %d]", properties_element - EL_CUSTOM_START + 1);
- screen_line++;
- }
- else if (IS_GROUP_ELEMENT(properties_element))
+ if (setup.editor.show_element_token)
{
DrawTextF(pad_x, pad_y + screen_line++ * font2_height, FONT_TEXT_3,
- "[Group Element %d]", properties_element - EL_GROUP_START + 1);
+ "[%s]", element_info[properties_element].token_name);
screen_line++;
}
-#endif
/* ----- print number of elements / percentage of this element in level */
#define TEXT_COLLECTING "Score for collecting"
#define TEXT_SMASHING "Score for smashing"
-#define TEXT_SLURPING "Score for slurping"
+#define TEXT_SLURPING "Score for slurping robot"
#define TEXT_CRACKING "Score for cracking"
#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"
+#define TEXT_GAME_OF_LIFE_1 "Min neighbours to survive"
+#define TEXT_GAME_OF_LIFE_2 "Max neighbours to survive"
+#define TEXT_GAME_OF_LIFE_3 "Min neighbours to create"
+#define TEXT_GAME_OF_LIFE_4 "Max neighbours to create"
+#define TEXT_TIME_BONUS "Extra time to solve level"
static struct
{
{ EL_BD_FIREFLY_DOWN, &level.score[SC_SPACESHIP], TEXT_SMASHING },
{ EL_SP_SNIKSNAK, &level.score[SC_SPACESHIP], TEXT_SMASHING },
{ EL_YAMYAM, &level.score[SC_YAMYAM], TEXT_SMASHING },
+ { EL_YAMYAM_LEFT, &level.score[SC_YAMYAM], TEXT_SMASHING },
+ { EL_YAMYAM_RIGHT, &level.score[SC_YAMYAM], TEXT_SMASHING },
+ { EL_YAMYAM_UP, &level.score[SC_YAMYAM], TEXT_SMASHING },
+ { EL_YAMYAM_DOWN, &level.score[SC_YAMYAM], TEXT_SMASHING },
{ EL_DARK_YAMYAM, &level.score[SC_YAMYAM], TEXT_SMASHING },
{ EL_ROBOT, &level.score[SC_ROBOT], TEXT_SMASHING },
{ EL_PACMAN, &level.score[SC_PACMAN], TEXT_SMASHING },
{ EL_PACMAN_DOWN, &level.score[SC_PACMAN], TEXT_SMASHING },
{ EL_NUT, &level.score[SC_NUT], TEXT_CRACKING },
{ EL_DYNAMITE, &level.score[SC_DYNAMITE], TEXT_COLLECTING },
+ { EL_EM_DYNAMITE, &level.score[SC_DYNAMITE], TEXT_COLLECTING },
{ EL_DYNABOMB_INCREASE_NUMBER,&level.score[SC_DYNAMITE],TEXT_COLLECTING },
{ EL_DYNABOMB_INCREASE_SIZE, &level.score[SC_DYNAMITE],TEXT_COLLECTING },
{ EL_DYNABOMB_INCREASE_POWER, &level.score[SC_DYNAMITE],TEXT_COLLECTING },
{ EL_SHIELD_NORMAL, &level.score[SC_SHIELD], TEXT_COLLECTING },
{ EL_SHIELD_DEADLY, &level.score[SC_SHIELD], TEXT_COLLECTING },
- { EL_EXTRA_TIME, &level.score[SC_TIME_BONUS], TEXT_COLLECTING },
+ { EL_EXTRA_TIME, &level.extra_time_score, TEXT_COLLECTING },
{ EL_KEY_1, &level.score[SC_KEY], TEXT_COLLECTING },
{ EL_KEY_2, &level.score[SC_KEY], TEXT_COLLECTING },
{ EL_KEY_3, &level.score[SC_KEY], TEXT_COLLECTING },
{ 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_EMC_DRIPPER, &level.amoeba_speed, TEXT_AMOEBA_SPEED },
{ EL_MAGIC_WALL, &level.time_magic_wall, TEXT_DURATION },
+ { EL_BD_MAGIC_WALL, &level.time_magic_wall, TEXT_DURATION },
+ { EL_DC_MAGIC_WALL, &level.time_magic_wall, TEXT_DURATION },
{ EL_ROBOT_WHEEL, &level.time_wheel, TEXT_DURATION },
-#if 1
+ { EL_TIMEGATE_SWITCH, &level.time_timegate, TEXT_DURATION },
+ { EL_DC_TIMEGATE_SWITCH,&level.time_timegate, TEXT_DURATION },
+ { EL_LIGHT_SWITCH, &level.time_light, TEXT_DURATION },
+ { EL_LIGHT_SWITCH_ACTIVE, &level.time_light, TEXT_DURATION },
+ { EL_SHIELD_NORMAL, &level.shield_normal_time, TEXT_DURATION },
+ { EL_SHIELD_DEADLY, &level.shield_deadly_time, TEXT_DURATION },
+ { EL_EXTRA_TIME, &level.extra_time, TEXT_TIME_BONUS },
+ { EL_TIME_ORB_FULL, &level.time_orb_time, TEXT_TIME_BONUS },
+ { EL_GAME_OF_LIFE, &level.game_of_life[0], TEXT_GAME_OF_LIFE_1 },
+ { EL_GAME_OF_LIFE, &level.game_of_life[1], TEXT_GAME_OF_LIFE_2 },
+ { EL_GAME_OF_LIFE, &level.game_of_life[2], TEXT_GAME_OF_LIFE_3 },
+ { EL_GAME_OF_LIFE, &level.game_of_life[3], TEXT_GAME_OF_LIFE_4 },
+ { EL_BIOMAZE, &level.biomaze[0], TEXT_GAME_OF_LIFE_1 },
+ { EL_BIOMAZE, &level.biomaze[1], TEXT_GAME_OF_LIFE_2 },
+ { EL_BIOMAZE, &level.biomaze[2], TEXT_GAME_OF_LIFE_3 },
+ { EL_BIOMAZE, &level.biomaze[3], TEXT_GAME_OF_LIFE_4 },
+
{ 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_SPRING, &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 }
};
IS_GROUP_ELEMENT(element) ||
IS_ENVELOPE(element) ||
ELEM_IS_PLAYER(element) ||
- HAS_CONTENT(element) ||
+ HAS_EDITOR_CONTENT(element) ||
CAN_GROW(element) ||
COULD_MOVE_INTO_ACID(element) ||
MAYBE_DONT_COLLIDE_WITH(element))
static void DrawPropertiesConfig()
{
- int max_num_element_counters = 2;
+ int max_num_element_counters = 4;
int num_element_counters = 0;
int i;
int counter_id = ED_COUNTER_ID_ELEMENT_VALUE1 + num_element_counters;
counterbutton_info[counter_id].y =
- 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)+
- num_element_counters);
+ ED_ELEMENT_SETTINGS_YPOS(
+ (HAS_EDITOR_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) +
+ (properties_element == EL_EMC_MAGIC_BALL ? 2 : 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;
+ if (properties_element == EL_GAME_OF_LIFE ||
+ properties_element == EL_BIOMAZE)
+ {
+ counterbutton_info[counter_id].min_value = 0; /* min neighbours */
+ counterbutton_info[counter_id].max_value = 8; /* max neighbours */
+ }
+ else
+ {
+ /* !!! CHANGE THIS FOR CERTAIN ELEMENTS !!! */
+ counterbutton_info[counter_id].min_value = MIN_SCORE;
+ counterbutton_info[counter_id].max_value = MAX_SCORE;
+ }
MapCounterButtons(counter_id);
}
}
- if (HAS_CONTENT(properties_element))
+ if (HAS_EDITOR_CONTENT(properties_element))
{
/* draw stickybutton gadget */
MapCheckbuttonGadget(ED_CHECKBUTTON_ID_STICK_ELEMENT);
if (IS_AMOEBOID(properties_element))
MapDrawingArea(ED_DRAWING_ID_AMOEBA_CONTENT);
- else if (properties_element == EL_YAMYAM)
+ else if (properties_element == EL_YAMYAM ||
+ properties_element == EL_YAMYAM_LEFT ||
+ properties_element == EL_YAMYAM_RIGHT ||
+ properties_element == EL_YAMYAM_UP ||
+ properties_element == EL_YAMYAM_DOWN)
DrawYamYamContentAreas();
- }
+ else if (properties_element == EL_EMC_MAGIC_BALL)
+ {
+ DrawMagicBallContentAreas();
- if (properties_element == EL_EMC_MAGIC_BALL)
- DrawMagicBallContentAreas();
+ MapCheckbuttonGadget(ED_CHECKBUTTON_ID_RANDOM_BALL_CONTENT);
+ MapCheckbuttonGadget(ED_CHECKBUTTON_ID_INITIAL_BALL_STATE);
+ }
+ else if (properties_element == EL_EMC_ANDROID)
+ DrawAndroidElementArea(properties_element);
+ }
if (ELEM_IS_PLAYER(properties_element))
{
+ int player_nr = GET_PLAYER_NR(properties_element);
+
+ /* these properties can be set for every player individually */
+
+ drawingarea_info[ED_DRAWING_ID_START_ELEMENT].value =
+ &level.start_element[player_nr];
+ drawingarea_info[ED_DRAWING_ID_ARTWORK_ELEMENT].value =
+ &level.artwork_element[player_nr];
+ drawingarea_info[ED_DRAWING_ID_EXPLOSION_ELEMENT].value =
+ &level.explosion_element[player_nr];
+
+ checkbutton_info[ED_CHECKBUTTON_ID_USE_START_ELEMENT].value =
+ &level.use_start_element[player_nr];
+ checkbutton_info[ED_CHECKBUTTON_ID_USE_ARTWORK_ELEMENT].value =
+ &level.use_artwork_element[player_nr];
+ checkbutton_info[ED_CHECKBUTTON_ID_USE_EXPLOSION_ELEMENT].value =
+ &level.use_explosion_element[player_nr];
+ checkbutton_info[ED_CHECKBUTTON_ID_INITIAL_GRAVITY].value =
+ &level.initial_player_gravity[player_nr];
+
+ selectbox_info[ED_SELECTBOX_ID_PLAYER_SPEED].value =
+ &level.initial_player_stepsize[player_nr];
+
MapCheckbuttonGadget(ED_CHECKBUTTON_ID_CAN_FALL_INTO_ACID);
MapCheckbuttonGadget(properties_element == EL_SP_MURPHY ?
ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD :
ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD);
+ MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BLOCK_SNAP_FIELD);
+ MapCheckbuttonGadget(ED_CHECKBUTTON_ID_CONTINUOUS_SNAPPING);
MapCheckbuttonGadget(ED_CHECKBUTTON_ID_INSTANT_RELOCATION);
+ MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_START_ELEMENT);
+ MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_ARTWORK_ELEMENT);
+ MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_EXPLOSION_ELEMENT);
+ MapCheckbuttonGadget(ED_CHECKBUTTON_ID_INITIAL_GRAVITY);
MapCheckbuttonGadget(ED_CHECKBUTTON_ID_CAN_PASS_TO_WALKABLE);
- MapCheckbuttonGadget(ED_CHECKBUTTON_ID_DOUBLE_SPEED);
+
+ MapDrawingArea(ED_DRAWING_ID_START_ELEMENT);
+ MapDrawingArea(ED_DRAWING_ID_ARTWORK_ELEMENT);
+ MapDrawingArea(ED_DRAWING_ID_EXPLOSION_ELEMENT);
+
+ MapSelectboxGadget(ED_SELECTBOX_ID_PLAYER_SPEED);
}
if (IS_GEM(properties_element))
ED_ELEMENT_SETTINGS_XPOS(IS_CUSTOM_ELEMENT(properties_element) ? 1 : 0);
checkbutton_info[ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID].y =
ED_ELEMENT_SETTINGS_YPOS(IS_CUSTOM_ELEMENT(properties_element) ? 6 :
- HAS_CONTENT(properties_element) ? 1 : 0);
+ HAS_EDITOR_CONTENT(properties_element) ? 1 : 0);
MapCheckbuttonGadget(ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID);
}
if (properties_element == EL_SPRING)
MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_SPRING_BUG);
+ if (properties_element == EL_TIME_ORB_FULL)
+ MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_TIME_ORB_BUG);
+
if (CAN_GROW(properties_element))
{
checkbutton_info[ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE].y =
- ED_ELEMENT_SETTINGS_YPOS(HAS_CONTENT(properties_element) ? 1 : 0);
+ ED_ELEMENT_SETTINGS_YPOS(HAS_EDITOR_CONTENT(properties_element) ? 1 : 0);
MapCheckbuttonGadget(ED_CHECKBUTTON_ID_GROW_INTO_DIGGABLE);
}
{
int counter1_id = ED_COUNTER_ID_ENVELOPE_XSIZE;
int counter2_id = ED_COUNTER_ID_ENVELOPE_YSIZE;
+ int button1_id = ED_CHECKBUTTON_ID_ENVELOPE_AUTOWRAP;
+ int button2_id = ED_CHECKBUTTON_ID_ENVELOPE_CENTERED;
int envelope_nr = properties_element - EL_ENVELOPE_1;
- counterbutton_info[counter1_id].value = &level.envelope_xsize[envelope_nr];
- counterbutton_info[counter2_id].value = &level.envelope_ysize[envelope_nr];
+ counterbutton_info[counter1_id].value = &level.envelope[envelope_nr].xsize;
+ counterbutton_info[counter2_id].value = &level.envelope[envelope_nr].ysize;
+
+ checkbutton_info[button1_id].value = &level.envelope[envelope_nr].autowrap;
+ checkbutton_info[button2_id].value = &level.envelope[envelope_nr].centered;
/* display counter to choose size of envelope text area */
- MapCounterButtons(ED_COUNTER_ID_ENVELOPE_XSIZE);
- MapCounterButtons(ED_COUNTER_ID_ENVELOPE_YSIZE);
+ MapCounterButtons(counter1_id);
+ MapCounterButtons(counter2_id);
+
+ /* display checkbuttons to choose auto-wrap and alignment properties */
+ MapCheckbuttonGadget(button1_id);
+ MapCheckbuttonGadget(button2_id);
DrawEnvelopeTextArea(envelope_nr);
}
{
int i;
+ /* needed to initially set selectbox options for special action options */
+ setSelectboxSpecialActionOptions();
+
/* draw stickybutton gadget */
MapCheckbuttonGadget(ED_CHECKBUTTON_ID_STICK_ELEMENT);
DrawPropertiesChangeDrawingAreas();
}
-static void DrawElementName(int x, int y, int element)
+static void DrawEditorElementAnimation(int x, int y)
+{
+ int graphic = el2img(properties_element);
+ int frame = (ANIM_MODE(graphic) == ANIM_CE_VALUE ?
+ custom_element.ce_value_fixed_initial :
+ ANIM_MODE(graphic) == ANIM_CE_SCORE ?
+ custom_element.collect_score_initial : FrameCounter);
+
+ DrawGraphicAnimationExt(drawto, x, y, graphic, frame, NO_MASKING);
+}
+
+static void DrawEditorElementName(int x, int y, int element)
{
char *element_name = getElementInfoText(element);
int font_nr = FONT_TEXT_1;
stick_element_properties_window = FALSE;
- /* make sure that previous properties edit mode exists for this element */
- if (edit_mode_properties > ED_MODE_PROPERTIES_CONFIG &&
- !IS_CUSTOM_ELEMENT(properties_element))
- edit_mode_properties = ED_MODE_PROPERTIES_CONFIG;
+ /* make sure that previous properties edit mode exists for this element */
+ if (edit_mode_properties > ED_MODE_PROPERTIES_CONFIG &&
+ !IS_CUSTOM_ELEMENT(properties_element))
+ edit_mode_properties = ED_MODE_PROPERTIES_CONFIG;
+
+ if (edit_mode_properties == ED_MODE_PROPERTIES_CONFIG &&
+ IS_CUSTOM_ELEMENT(properties_element))
+ edit_mode_properties = ED_MODE_PROPERTIES_CONFIG_1;
+
+ CopyElementPropertiesToEditor(properties_element);
+
+ UnmapLevelEditorWindowGadgets();
+ UnmapLevelEditorToolboxDrawingGadgets();
+ UnmapLevelEditorToolboxCustomGadgets();
+
+ if (IS_CUSTOM_ELEMENT(properties_element) ||
+ IS_GROUP_ELEMENT(properties_element))
+ MapLevelEditorToolboxCustomGadgets();
+
+ SetMainBackgroundImage(IMG_BACKGROUND_EDITOR);
+ ClearWindow();
+
+#if 0
+ DrawTextSCentered(ED_SETTINGS1_YPOS, FONT_TITLE_1, "Element Settings");
+#else
+ DrawText(SX + ED_SETTINGS2_XPOS, SY + ED_SETTINGS1_YPOS,
+ "Element Settings", FONT_TITLE_1);
+#endif
+
+ FrameCounter = 0; /* restart animation frame counter */
+
+ DrawElementBorder(SX + xstart * MINI_TILEX,
+ SY + ystart * MINI_TILEY + MINI_TILEY / 2,
+ TILEX, TILEY, FALSE);
+
+ DrawEditorElementAnimation(SX + xstart * MINI_TILEX,
+ SY + ystart * MINI_TILEY + MINI_TILEY / 2);
+
+ DrawEditorElementName((xstart + 3) * MINI_TILEX + 1,
+ (ystart + 1) * MINI_TILEY + 1,
+ properties_element);
+
+ DrawPropertiesTabulatorGadgets();
+
+ if (edit_mode_properties == ED_MODE_PROPERTIES_INFO)
+ DrawPropertiesInfo();
+ else if (edit_mode_properties == ED_MODE_PROPERTIES_CHANGE)
+ DrawPropertiesChange();
+ else /* (edit_mode_properties == ED_MODE_PROPERTIES_CONFIG[_1|_2]) */
+ DrawPropertiesConfig();
+}
+
+static void UpdateCustomElementGraphicGadgets()
+{
+ int i;
+
+ ModifyEditorElementList();
+ RedrawDrawingElements();
+
+ /* force redraw of all mapped drawing area gadgets */
+ for (i = 0; i < ED_NUM_DRAWING_AREAS; i++)
+ {
+ struct GadgetInfo *gi = level_editor_gadget[drawingarea_info[i].gadget_id];
+
+ if (gi->mapped)
+ MapDrawingArea(i);
+ }
+}
+
+static int getOpenDirectionFromTube(int element)
+{
+ switch (element)
+ {
+ case EL_TUBE_LEFT_UP: return (MV_LEFT | MV_UP);
+ case EL_TUBE_LEFT_DOWN: return (MV_LEFT | MV_DOWN);
+ case EL_TUBE_RIGHT_UP: return (MV_RIGHT | MV_UP);
+ case EL_TUBE_RIGHT_DOWN: return (MV_RIGHT | MV_DOWN);
+ case EL_TUBE_HORIZONTAL: return (MV_HORIZONTAL);
+ case EL_TUBE_HORIZONTAL_UP: return (MV_HORIZONTAL | MV_UP);
+ case EL_TUBE_HORIZONTAL_DOWN: return (MV_HORIZONTAL | MV_DOWN);
+ case EL_TUBE_VERTICAL: return (MV_VERTICAL);
+ case EL_TUBE_VERTICAL_LEFT: return (MV_VERTICAL | MV_LEFT);
+ case EL_TUBE_VERTICAL_RIGHT: return (MV_VERTICAL | MV_RIGHT);
+ case EL_TUBE_ANY: return (MV_ANY_DIRECTION);
+ }
+
+ return MV_NONE;
+}
+
+static int getTubeFromOpenDirection(int direction)
+{
+ switch (direction)
+ {
+ case (MV_LEFT | MV_UP): return EL_TUBE_LEFT_UP;
+ case (MV_LEFT | MV_DOWN): return EL_TUBE_LEFT_DOWN;
+ case (MV_RIGHT | MV_UP): return EL_TUBE_RIGHT_UP;
+ case (MV_RIGHT | MV_DOWN): return EL_TUBE_RIGHT_DOWN;
+ case (MV_HORIZONTAL): return EL_TUBE_HORIZONTAL;
+ case (MV_HORIZONTAL | MV_UP): return EL_TUBE_HORIZONTAL_UP;
+ case (MV_HORIZONTAL | MV_DOWN): return EL_TUBE_HORIZONTAL_DOWN;
+ case (MV_VERTICAL): return EL_TUBE_VERTICAL;
+ case (MV_VERTICAL | MV_LEFT): return EL_TUBE_VERTICAL_LEFT;
+ case (MV_VERTICAL | MV_RIGHT): return EL_TUBE_VERTICAL_RIGHT;
+ case (MV_ANY_DIRECTION): return EL_TUBE_ANY;
+
+ /* if only one direction, fall back to simple tube with that direction */
+ case (MV_LEFT): return EL_TUBE_HORIZONTAL;
+ case (MV_RIGHT): return EL_TUBE_HORIZONTAL;
+ case (MV_UP): return EL_TUBE_VERTICAL;
+ case (MV_DOWN): return EL_TUBE_VERTICAL;
+ }
+
+ return EL_EMPTY;
+}
+
+static int getTubeFromOpenDirectionNotEmpty(int direction, int element_old)
+{
+ int element_new = getTubeFromOpenDirection(direction);
+
+ return (element_new != EL_EMPTY ? element_new : element_old);
+}
+
+static int getOpenDirectionFromBelt(int element)
+{
+ int belt_dir = getBeltDirFromBeltElement(element);
+
+ return (belt_dir == MV_LEFT ? MV_RIGHT :
+ belt_dir == MV_RIGHT ? MV_LEFT :
+ belt_dir == MV_NONE ? MV_HORIZONTAL : belt_dir);
+}
+
+static int getBeltFromNrAndOpenDirection(int nr, int direction)
+{
+ int belt_dir = (direction == MV_LEFT ? MV_RIGHT :
+ direction == MV_RIGHT ? MV_LEFT :
+ direction == MV_HORIZONTAL ? MV_NONE : direction);
+
+ if (direction == MV_NONE)
+ return EL_EMPTY;
+
+ return getBeltElementFromBeltNrAndBeltDir(nr, belt_dir);
+}
+
+static int getBeltFromNrAndOpenDirectionNotEmpty(int nr, int direction,
+ int element_old)
+{
+ int element_new = getBeltFromNrAndOpenDirection(nr, direction);
+
+ return (element_new != EL_EMPTY ? element_new : element_old);
+}
+
+static int getOpenDirectionFromPool(int element)
+{
+ switch (element)
+ {
+ case EL_ACID_POOL_TOPLEFT: return (MV_DOWN | MV_RIGHT);
+ case EL_ACID_POOL_TOPRIGHT: return (MV_DOWN | MV_LEFT);
+ case EL_ACID_POOL_BOTTOMLEFT: return (MV_UP | MV_RIGHT);
+ case EL_ACID_POOL_BOTTOMRIGHT: return (MV_UP | MV_LEFT);
+ case EL_ACID_POOL_BOTTOM: return (MV_HORIZONTAL | MV_UP);
+ case EL_ACID: return (MV_HORIZONTAL | MV_DOWN);
+ }
+
+ return MV_NONE;
+}
+
+static int getPoolFromOpenDirection(int direction)
+{
+ switch (direction)
+ {
+ case (MV_DOWN | MV_RIGHT): return EL_ACID_POOL_TOPLEFT;
+ case (MV_DOWN | MV_LEFT): return EL_ACID_POOL_TOPRIGHT;
+ case (MV_UP | MV_RIGHT): return EL_ACID_POOL_BOTTOMLEFT;
+ case (MV_UP | MV_LEFT): return EL_ACID_POOL_BOTTOMRIGHT;
+ case (MV_HORIZONTAL | MV_UP): return EL_ACID_POOL_BOTTOM;
+ case (MV_HORIZONTAL | MV_DOWN): return EL_ACID;
+ }
+
+ return EL_EMPTY;
+}
+
+static int getPoolFromOpenDirectionExt(int direction, int help_element)
+{
+ int element = getPoolFromOpenDirection(direction);
+ int help_direction = getOpenDirectionFromPool(help_element);
+
+ if (element == EL_EMPTY)
+ {
+ int help_direction_vertical = help_direction & MV_VERTICAL;
+
+ element = getPoolFromOpenDirection(direction | help_direction_vertical);
+ }
+
+ if (element == EL_EMPTY)
+ {
+ int help_direction_horizontal = help_direction & MV_HORIZONTAL;
+
+ element = getPoolFromOpenDirection(direction | help_direction_horizontal);
+ }
+
+ return element;
+}
+
+static int getPoolFromOpenDirectionNotEmpty(int direction, int element_old)
+{
+ int element_new = getPoolFromOpenDirectionExt(direction, element_old);
+
+ return (element_new != EL_EMPTY ? element_new : element_old);
+}
+
+static int getOpenDirectionFromPillar(int element)
+{
+ switch (element)
+ {
+ case EL_EMC_WALL_1: return (MV_DOWN);
+ case EL_EMC_WALL_2: return (MV_VERTICAL);
+ case EL_EMC_WALL_3: return (MV_UP);
+ }
+
+ return MV_NONE;
+}
+
+static int getPillarFromOpenDirection(int direction)
+{
+ switch (direction)
+ {
+ case (MV_DOWN): return EL_EMC_WALL_1;
+ case (MV_VERTICAL): return EL_EMC_WALL_2;
+ case (MV_UP): return EL_EMC_WALL_3;
+ }
+
+ return EL_EMPTY;
+}
+
+static int getPillarFromOpenDirectionNotEmpty(int direction, int element_old)
+{
+ int element_new = getPillarFromOpenDirection(direction);
+
+ return (element_new != EL_EMPTY ? element_new : element_old);
+}
+
+static int getClosedTube(int x, int y)
+{
+ static int xy[4][2] =
+ {
+ { -1, 0 },
+ { +1, 0 },
+ { 0, -1 },
+ { 0, +1 }
+ };
+ int element_old = IntelliDrawBuffer[x][y];
+ int tube_direction_old = getOpenDirectionFromTube(element_old);
+ int tube_direction_new = MV_NONE;
+ int i;
+
+ for (i = 0; i < NUM_DIRECTIONS; i++)
+ {
+ int xx = x + xy[i][0];
+ int yy = y + xy[i][1];
+ int dir = MV_DIR_FROM_BIT(i);
+ int dir_opposite = MV_DIR_OPPOSITE(dir);
+
+ if (IN_LEV_FIELD(xx, yy) && IS_TUBE(IntelliDrawBuffer[xx][yy]) &&
+ (tube_direction_old & dir) &&
+ (getOpenDirectionFromTube(IntelliDrawBuffer[xx][yy]) & dir_opposite))
+ tube_direction_new |= dir;
+ }
+
+ return getTubeFromOpenDirectionNotEmpty(tube_direction_new, element_old);
+}
+
+static int getClosedBelt(int x, int y)
+{
+ static int xy[4][2] =
+ {
+ { -1, 0 },
+ { +1, 0 },
+ { 0, -1 },
+ { 0, +1 }
+ };
+ int element_old = IntelliDrawBuffer[x][y];
+ int belt_nr = getBeltNrFromBeltElement(element_old);
+ int belt_direction_old = getOpenDirectionFromBelt(element_old);
+ int belt_direction_new = MV_NONE;
+ int i;
+
+ for (i = MV_BIT_LEFT; i <= MV_BIT_RIGHT; i++)
+ {
+ int xx = x + xy[i][0];
+ int yy = y + xy[i][1];
+ int dir = MV_DIR_FROM_BIT(i);
+ int dir_opposite = MV_DIR_OPPOSITE(dir);
+
+ if (IN_LEV_FIELD(xx, yy) && IS_BELT(IntelliDrawBuffer[xx][yy]) &&
+ (belt_direction_old & dir) &&
+ (getOpenDirectionFromBelt(IntelliDrawBuffer[xx][yy]) & dir_opposite))
+ belt_direction_new |= dir;
+ }
+
+ return getBeltFromNrAndOpenDirection(belt_nr, belt_direction_new);
+}
+
+static int getClosedPool(int x, int y)
+{
+ static int xy[4][2] =
+ {
+ { -1, 0 },
+ { +1, 0 },
+ { 0, -1 },
+ { 0, +1 }
+ };
+ int element_old = IntelliDrawBuffer[x][y];
+ int pool_direction_old = getOpenDirectionFromPool(element_old);
+ int pool_direction_new = MV_NONE;
+ int i;
+
+ for (i = 0; i < NUM_DIRECTIONS; i++)
+ {
+ int xx = x + xy[i][0];
+ int yy = y + xy[i][1];
+ int dir = MV_DIR_FROM_BIT(i);
+ int dir_opposite = MV_DIR_OPPOSITE(dir);
+
+ if (IN_LEV_FIELD(xx, yy) &&
+ IS_ACID_POOL_OR_ACID(IntelliDrawBuffer[xx][yy]) &&
+ (pool_direction_old & dir) &&
+ (getOpenDirectionFromPool(IntelliDrawBuffer[xx][yy]) & dir_opposite))
+ pool_direction_new |= dir;
+ }
+
+ return getPoolFromOpenDirectionNotEmpty(pool_direction_new, element_old);
+}
+
+static int getClosedPillar(int x, int y)
+{
+ static int xy[4][2] =
+ {
+ { -1, 0 },
+ { +1, 0 },
+ { 0, -1 },
+ { 0, +1 }
+ };
+ int element_old = IntelliDrawBuffer[x][y];
+ int pillar_direction_old = getOpenDirectionFromPillar(element_old);
+ int pillar_direction_new = MV_NONE;
+ int i;
+
+ for (i = MV_BIT_UP; i <= MV_BIT_DOWN; i++)
+ {
+ int xx = x + xy[i][0];
+ int yy = y + xy[i][1];
+ int dir = MV_DIR_FROM_BIT(i);
+ int dir_opposite = MV_DIR_OPPOSITE(dir);
+
+ if (IN_LEV_FIELD(xx, yy) && IS_EMC_PILLAR(IntelliDrawBuffer[xx][yy]) &&
+ (pillar_direction_old & dir) &&
+ (getOpenDirectionFromPillar(IntelliDrawBuffer[xx][yy]) & dir_opposite))
+ pillar_direction_new |= dir;
+ }
+
+ return getPillarFromOpenDirectionNotEmpty(pillar_direction_new, element_old);
+}
+
+static void SetElementSimple(int x, int y, int element, boolean change_level)
+{
+ int sx = x - level_xpos;
+ int sy = y - level_ypos;
+
+ IntelliDrawBuffer[x][y] = element;
+
+ if (change_level)
+ Feld[x][y] = element;
+
+ if (IN_ED_FIELD(sx, sy))
+ DrawMiniElement(sx, sy, element);
+}
+
+static void MergeAndCloseNeighbourElements(int x1, int y1, int *element1,
+ int x2, int y2, int *element2,
+ int (*close_function)(int, int),
+ boolean change_level)
+{
+ /* set neighbour elements to newly determined connections */
+ SetElementSimple(x1, y1, *element1, change_level);
+ SetElementSimple(x2, y2, *element2, change_level);
+
+ /* remove all open connections of neighbour elements */
+ *element1 = close_function(x1, y1);
+ *element2 = close_function(x2, y2);
+
+ /* set neighbour elements to new, minimized connections */
+ SetElementSimple(x1, y1, *element1, change_level);
+ SetElementSimple(x2, y2, *element2, change_level);
+}
+
+static void SetElementIntelliDraw(int x, int y, int new_element,
+ boolean change_level)
+{
+ static int xy[4][2] =
+ {
+ { -1, 0 },
+ { +1, 0 },
+ { 0, -1 },
+ { 0, +1 }
+ };
+ static int last_x = -1;
+ static int last_y = -1;
+ int old_element = IntelliDrawBuffer[x][y];
+
+ if (new_element == EL_UNDEFINED)
+ {
+ last_x = -1;
+ last_y = -1;
+
+ return;
+ }
+
+ if (IS_TUBE(new_element))
+ {
+ int last_element_new = EL_UNDEFINED;
+ int direction = MV_NONE;
+ int i;
+
+ /* if existing element is tube, keep all existing tube directions */
+ if (IS_TUBE(old_element))
+ direction |= getOpenDirectionFromTube(old_element);
+
+ for (i = 0; i < NUM_DIRECTIONS; i++)
+ {
+ int xx = x + xy[i][0];
+ int yy = y + xy[i][1];
+
+ if (last_x == xx && last_y == yy && IN_LEV_FIELD(last_x, last_y) &&
+ IS_TUBE(IntelliDrawBuffer[last_x][last_y]))
+ {
+ int dir = MV_DIR_FROM_BIT(i);
+ int dir_opposite = MV_DIR_OPPOSITE(dir);
+ int last_element_old = IntelliDrawBuffer[last_x][last_y];
+ int last_direction_old = getOpenDirectionFromTube(last_element_old);
+ int last_direction_new = last_direction_old | dir_opposite;
+
+ last_element_new = getTubeFromOpenDirection(last_direction_new);
+
+ direction |= dir;
+ }
+ }
+
+ new_element = getTubeFromOpenDirectionNotEmpty(direction, new_element);
+
+ if (last_element_new != EL_UNDEFINED)
+ MergeAndCloseNeighbourElements(x, y, &new_element,
+ last_x, last_y, &last_element_new,
+ getClosedTube, change_level);
+ }
+ else if (IS_BELT(new_element))
+ {
+ int belt_nr = getBeltNrFromBeltElement(new_element);
+ int last_element_new = EL_UNDEFINED;
+ int direction = MV_NONE;
+ int i;
+
+ /* if existing element is belt, keep all existing belt directions */
+ if (IS_BELT(old_element))
+ direction |= getOpenDirectionFromBelt(old_element);
+
+ for (i = MV_BIT_LEFT; i <= MV_BIT_RIGHT; i++)
+ {
+ int xx = x + xy[i][0];
+ int yy = y + xy[i][1];
+
+ if (last_x == xx && last_y == yy && IN_LEV_FIELD(last_x, last_y) &&
+ IS_BELT(IntelliDrawBuffer[last_x][last_y]))
+ {
+ int dir = MV_DIR_FROM_BIT(i);
+ int dir_opposite = MV_DIR_OPPOSITE(dir);
+ int last_element_old = IntelliDrawBuffer[last_x][last_y];
+ int last_belt_nr = getBeltNrFromBeltElement(last_element_old);
+ int last_direction_old = getOpenDirectionFromBelt(last_element_old);
+ int last_direction_new = last_direction_old | dir_opposite;
+
+ last_element_new = getBeltFromNrAndOpenDirection(last_belt_nr,
+ last_direction_new);
+ direction |= dir;
+ }
+ }
+
+ new_element = getBeltFromNrAndOpenDirectionNotEmpty(belt_nr, direction,
+ new_element);
+ if (last_element_new != EL_UNDEFINED)
+ MergeAndCloseNeighbourElements(x, y, &new_element,
+ last_x, last_y, &last_element_new,
+ getClosedBelt, change_level);
+ }
+ else if (IS_ACID_POOL_OR_ACID(new_element))
+ {
+ int last_element_new = EL_UNDEFINED;
+ int direction = MV_NONE;
+ int i;
+
+ /* if existing element is pool, keep all existing pool directions */
+ if (IS_ACID_POOL_OR_ACID(old_element))
+ direction |= getOpenDirectionFromPool(old_element);
+
+ for (i = 0; i < NUM_DIRECTIONS; i++)
+ {
+ int xx = x + xy[i][0];
+ int yy = y + xy[i][1];
+
+ if (last_x == xx && last_y == yy && IN_LEV_FIELD(last_x, last_y) &&
+ IS_ACID_POOL_OR_ACID(IntelliDrawBuffer[last_x][last_y]))
+ {
+ int dir = MV_DIR_FROM_BIT(i);
+ int dir_opposite = MV_DIR_OPPOSITE(dir);
+ int last_element_old = IntelliDrawBuffer[last_x][last_y];
+ int last_direction_old = getOpenDirectionFromPool(last_element_old);
+ int last_direction_new = last_direction_old | dir_opposite;
+
+ last_element_new = getPoolFromOpenDirection(last_direction_new);
+
+ direction |= dir;
+ }
+ }
+
+#if 1
+ int foo = last_element_new;
+
+ if (foo == EL_EMPTY)
+ foo = EL_ACID;
+
+ if (last_element_new == EL_EMPTY)
+ last_element_new = old_element;
+
+ if (last_element_new != EL_UNDEFINED)
+ new_element = getPoolFromOpenDirectionNotEmpty(direction,
+ foo);
+ else
+ new_element = getPoolFromOpenDirectionNotEmpty(direction, new_element);
+
+#else
+
+#if 0
+ if (last_element_new == EL_EMPTY)
+ last_element_new = new_element;
+#else
+ if (last_element_new == EL_EMPTY)
+ last_element_new = EL_ACID;
+#endif
+
+#if 1
+ if (last_element_new != EL_UNDEFINED)
+ new_element = getPoolFromOpenDirectionNotEmpty(direction,
+ last_element_new);
+ else
+ new_element = getPoolFromOpenDirectionNotEmpty(direction, new_element);
+#else
+ new_element = getPoolFromOpenDirectionNotEmpty(direction, new_element);
+#endif
+
+#endif
+
+ if (last_element_new != EL_UNDEFINED)
+ MergeAndCloseNeighbourElements(x, y, &new_element,
+ last_x, last_y, &last_element_new,
+ getClosedPool, change_level);
+ }
+ else if (IS_EMC_PILLAR(new_element))
+ {
+ int last_element_new = EL_UNDEFINED;
+ int direction = MV_NONE;
+ int i;
+
+ /* if existing element is pillar, keep all existing pillar directions */
+ if (IS_EMC_PILLAR(old_element))
+ direction |= getOpenDirectionFromPillar(old_element);
- if (edit_mode_properties == ED_MODE_PROPERTIES_CONFIG &&
- IS_CUSTOM_ELEMENT(properties_element))
- edit_mode_properties = ED_MODE_PROPERTIES_CONFIG_1;
+ for (i = MV_BIT_UP; i <= MV_BIT_DOWN; i++)
+ {
+ int xx = x + xy[i][0];
+ int yy = y + xy[i][1];
- CopyElementPropertiesToEditor(properties_element);
+ if (last_x == xx && last_y == yy && IN_LEV_FIELD(last_x, last_y) &&
+ IS_EMC_PILLAR(IntelliDrawBuffer[last_x][last_y]))
+ {
+ int dir = MV_DIR_FROM_BIT(i);
+ int dir_opposite = MV_DIR_OPPOSITE(dir);
+ int last_element_old = IntelliDrawBuffer[last_x][last_y];
+ int last_direction_old = getOpenDirectionFromPillar(last_element_old);
+ int last_direction_new = last_direction_old | dir_opposite;
- UnmapLevelEditorWindowGadgets();
- UnmapLevelEditorToolboxDrawingGadgets();
- UnmapLevelEditorToolboxCustomGadgets();
+ last_element_new = getPillarFromOpenDirection(last_direction_new);
- if (IS_CUSTOM_ELEMENT(properties_element) ||
- IS_GROUP_ELEMENT(properties_element))
- MapLevelEditorToolboxCustomGadgets();
+ direction |= dir;
+ }
+ }
- SetMainBackgroundImage(IMG_BACKGROUND_EDITOR);
- ClearWindow();
+ new_element = getPillarFromOpenDirectionNotEmpty(direction, new_element);
- DrawText(SX + ED_SETTINGS2_XPOS, SY + ED_SETTINGS1_YPOS,
- "Element Settings", FONT_TITLE_1);
+ if (last_element_new != EL_UNDEFINED)
+ MergeAndCloseNeighbourElements(x, y, &new_element,
+ last_x, last_y, &last_element_new,
+ getClosedPillar, change_level);
+ }
+ else if (IS_BELT_SWITCH(old_element))
+ {
+ int belt_nr = getBeltNrFromBeltSwitchElement(old_element);
+ int belt_dir = getBeltDirFromBeltSwitchElement(old_element);
- DrawElementBorder(SX + xstart * MINI_TILEX,
- SY + ystart * MINI_TILEY + MINI_TILEY / 2,
- TILEX, TILEY, FALSE);
- DrawGraphicAnimationExt(drawto,
- SX + xstart * MINI_TILEX,
- SY + ystart * MINI_TILEY + MINI_TILEY / 2,
- el2img(properties_element), -1, NO_MASKING);
+ belt_dir = (belt_dir == MV_LEFT ? MV_NONE :
+ belt_dir == MV_NONE ? MV_RIGHT : MV_LEFT);
- FrameCounter = 0; /* restart animation frame counter */
+ new_element = getBeltSwitchElementFromBeltNrAndBeltDir(belt_nr, belt_dir);
+ }
+ else
+ {
+ static int swappable_elements[][2] =
+ {
+ { EL_EXIT_CLOSED, EL_EXIT_OPEN },
+ { EL_DYNAMITE, EL_DYNAMITE_ACTIVE },
+ { EL_EM_DYNAMITE, EL_EM_DYNAMITE_ACTIVE },
+ { EL_QUICKSAND_EMPTY, EL_QUICKSAND_FULL },
+ { EL_EMERALD, EL_WALL_EMERALD },
+ { EL_EMERALD_YELLOW, EL_WALL_EMERALD_YELLOW },
+ { EL_EMERALD_RED, EL_WALL_EMERALD_RED },
+ { EL_EMERALD_PURPLE, EL_WALL_EMERALD_PURPLE },
+ { EL_DIAMOND, EL_WALL_DIAMOND },
+ { EL_BD_DIAMOND, EL_WALL_BD_DIAMOND },
+ { EL_GATE_1, EL_GATE_1_GRAY },
+ { EL_GATE_2, EL_GATE_2_GRAY },
+ { EL_GATE_3, EL_GATE_3_GRAY },
+ { EL_GATE_4, EL_GATE_4_GRAY },
+ { EL_EM_GATE_1, EL_EM_GATE_1_GRAY },
+ { EL_EM_GATE_2, EL_EM_GATE_2_GRAY },
+ { EL_EM_GATE_3, EL_EM_GATE_3_GRAY },
+ { EL_EM_GATE_4, EL_EM_GATE_4_GRAY },
+ { EL_EMC_GATE_5, EL_EMC_GATE_5_GRAY },
+ { EL_EMC_GATE_6, EL_EMC_GATE_6_GRAY },
+ { EL_EMC_GATE_7, EL_EMC_GATE_7_GRAY },
+ { EL_EMC_GATE_8, EL_EMC_GATE_8_GRAY },
+ { EL_DC_GATE_WHITE, EL_DC_GATE_WHITE_GRAY },
+ { EL_TIME_ORB_EMPTY, EL_TIME_ORB_FULL },
+ { EL_LAMP, EL_LAMP_ACTIVE },
+ { EL_SOKOBAN_FIELD_EMPTY, EL_SOKOBAN_FIELD_FULL },
+ { EL_SP_BASE, EL_SP_BUGGY_BASE },
+ { EL_PEARL, EL_WALL_PEARL },
+ { EL_CRYSTAL, EL_WALL_CRYSTAL },
+ { EL_TIMEGATE_CLOSED, EL_TIMEGATE_OPEN },
+ { EL_SWITCHGATE_CLOSED, EL_SWITCHGATE_OPEN },
+ { EL_SWITCHGATE_SWITCH_UP, EL_SWITCHGATE_SWITCH_DOWN },
+ { EL_DC_SWITCHGATE_SWITCH_UP, EL_DC_SWITCHGATE_SWITCH_DOWN },
+ { EL_LIGHT_SWITCH, EL_LIGHT_SWITCH_ACTIVE },
+ { EL_LANDMINE, EL_DC_LANDMINE },
+ { EL_SHIELD_NORMAL, EL_SHIELD_DEADLY },
+ { EL_STEEL_EXIT_CLOSED, EL_STEEL_EXIT_OPEN },
+ { EL_EM_EXIT_CLOSED, EL_EM_EXIT_OPEN },
+ { EL_EM_STEEL_EXIT_CLOSED, EL_EM_STEEL_EXIT_OPEN },
+ { EL_QUICKSAND_FAST_EMPTY, EL_QUICKSAND_FAST_FULL },
+
+ { -1, -1 },
+ };
+ int i;
+
+ for (i = 0; swappable_elements[i][0] != -1; i++)
+ {
+ int element1 = swappable_elements[i][0];
+ int element2 = swappable_elements[i][1];
- DrawElementName((xstart + 3) * MINI_TILEX + 1, (ystart + 1) * MINI_TILEY + 1,
- properties_element);
+ if (old_element == element1 || old_element == element2)
+ new_element = (old_element == element1 ? element2 : element1);
+ }
+ }
- DrawPropertiesTabulatorGadgets();
+ SetElementSimple(x, y, new_element, change_level);
- if (edit_mode_properties == ED_MODE_PROPERTIES_INFO)
- DrawPropertiesInfo();
- else if (edit_mode_properties == ED_MODE_PROPERTIES_CHANGE)
- DrawPropertiesChange();
- else /* (edit_mode_properties == ED_MODE_PROPERTIES_CONFIG[_1|_2]) */
- DrawPropertiesConfig();
+ last_x = x;
+ last_y = y;
}
-static void UpdateCustomElementGraphicGadgets()
+static void ResetIntelliDraw()
{
- int i;
+ int x, y;
- ModifyEditorElementList();
- RedrawDrawingElements();
+ for (x = 0; x < lev_fieldx; x++)
+ for (y = 0; y < lev_fieldy; y++)
+ IntelliDrawBuffer[x][y] = Feld[x][y];
- /* force redraw of all mapped drawing area gadgets */
- for (i = 0; i < ED_NUM_DRAWING_AREAS; i++)
- {
- struct GadgetInfo *gi = level_editor_gadget[drawingarea_info[i].gadget_id];
+ SetElementIntelliDraw(-1, -1, EL_UNDEFINED, FALSE);
+}
- if (gi->mapped)
- MapDrawingArea(i);
- }
+static void SetElementExt(int x, int y, int element, boolean change_level)
+{
+ if (element < 0)
+ SetElementSimple(x, y, Feld[x][y], change_level);
+ else if (GetKeyModState() & KMOD_Shift)
+ SetElementIntelliDraw(x, y, element, change_level);
+ else
+ SetElementSimple(x, y, element, change_level);
+}
+
+static void SetElement(int x, int y, int element)
+{
+ SetElementExt(x, y, element, TRUE);
}
static void DrawLineElement(int sx, int sy, int element, boolean change_level)
int lx = sx + level_xpos;
int ly = sy + level_ypos;
- DrawMiniElement(sx, sy, (element < 0 ? Feld[lx][ly] : element));
-
- if (change_level)
- Feld[lx][ly] = element;
+ SetElementExt(lx, ly, element, change_level);
}
static void DrawLine(int from_x, int from_y, int to_x, int to_y,
int element, boolean change_level)
{
+ int xsize = ABS(to_x - from_x);
+ int ysize = ABS(to_y - from_y);
+ int dx = (to_x < from_x ? -1 : +1);
+ int dy = (to_y < from_y ? -1 : +1);
+ int i;
+
if (from_y == to_y) /* horizontal line */
{
- int x;
- int y = from_y;
-
- if (from_x > to_x)
- swap_numbers(&from_x, &to_x);
-
- for (x = from_x; x <= to_x; x++)
- DrawLineElement(x, y, element, change_level);
+ for (i = 0; i <= xsize; i++)
+ DrawLineElement(from_x + i * dx, from_y, element, change_level);
}
else if (from_x == to_x) /* vertical line */
{
- int x = from_x;
- int y;
-
- if (from_y > to_y)
- swap_numbers(&from_y, &to_y);
-
- for (y = from_y; y <= to_y; y++)
- DrawLineElement(x, y, element, change_level);
+ for (i = 0; i <= ysize; i++)
+ DrawLineElement(from_x, from_y + i * dy, element, change_level);
}
else /* diagonal line */
{
- int len_x = ABS(to_x - from_x);
- int len_y = ABS(to_y - from_y);
- int x, y;
-
- if (len_y < len_x) /* a < 1 */
+ if (ysize < xsize) /* a < 1 */
{
- float a = (float)len_y / (float)len_x;
+ float a = (float)ysize / (float)xsize;
- if (from_x > to_x)
- swap_number_pairs(&from_x, &from_y, &to_x, &to_y);
-
- for (x = 0; x <= len_x; x++)
+ for (i = 0; i <= xsize; i++)
{
- y = (int)(a * x + 0.5) * (to_y < from_y ? -1 : +1);
+ int x = dx * i;
+ int y = dy * (int)(a * i + 0.5);
+
DrawLineElement(from_x + x, from_y + y, element, change_level);
}
}
else /* a >= 1 */
{
- float a = (float)len_x / (float)len_y;
+ float a = (float)xsize / (float)ysize;
- if (from_y > to_y)
- swap_number_pairs(&from_x, &from_y, &to_x, &to_y);
-
- for (y = 0; y <= len_y; y++)
+ for (i = 0; i <= ysize; i++)
{
- x = (int)(a * y + 0.5) * (to_x < from_x ? -1 : +1);
+ int x = dx * (int)(a * i + 0.5);
+ int y = dy * i;
+
DrawLineElement(from_x + x, from_y + y, element, change_level);
}
}
for (y = 0; y < brush_height; y++)
{
- for (x=0; x < brush_width; x++)
+ for (x = 0; x < brush_width; x++)
{
brush_buffer[x][y] = Feld[from_lx + x][from_ly + y];
static void FloodFill(int from_x, int from_y, int fill_element)
{
- int i,x,y;
- int old_element;
- static int check[4][2] = { {-1,0}, {0,-1}, {1,0}, {0,1} };
- static int safety = 0;
-
- /* check if starting field still has the desired content */
- if (Feld[from_x][from_y] == fill_element)
- return;
-
- safety++;
-
- if (safety > lev_fieldx*lev_fieldy)
- Error(ERR_EXIT, "Something went wrong in 'FloodFill()'. Please debug.");
-
- old_element = Feld[from_x][from_y];
- Feld[from_x][from_y] = fill_element;
-
- for (i = 0; i < 4; i++)
- {
- x = from_x + check[i][0];
- y = from_y + check[i][1];
-
- if (IN_LEV_FIELD(x,y) && Feld[x][y] == old_element)
- FloodFill(x, y, fill_element);
- }
-
- safety--;
+ FloodFillLevel(from_x, from_y, fill_element, Feld, lev_fieldx, lev_fieldy);
}
/* values for DrawLevelText() modes */
DrawAreaBorder(sx, sy, sx, sy);
}
+static void CheckLevelBorderElement(boolean redraw_playfield)
+{
+ int last_border_element = BorderElement;
+
+ SetBorderElement();
+
+ if (redraw_playfield && BorderElement != last_border_element)
+ DrawMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos);
+}
+
static void CopyLevelToUndoBuffer(int mode)
{
static boolean accumulated_undo = FALSE;
boolean new_undo_buffer_position = TRUE;
- int last_border_element;
int x, y;
switch (mode)
UndoBuffer[undo_buffer_position][x][y] = Feld[x][y];
/* check if drawing operation forces change of border style */
- last_border_element = BorderElement;
- SetBorderElement();
- if (BorderElement != last_border_element)
- DrawMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos);
+ CheckLevelBorderElement(TRUE);
level.changed = TRUE;
}
if (!started_inside_drawing_area)
return;
-#if 1
if (!IS_VALID_BUTTON(button))
return;
-#endif
if (!button && !button_release_event)
return;
actual_drawing_function = GADGET_ID_PICK_ELEMENT;
}
+ if (GetKeyModState() & KMOD_Shift)
+ {
+ if (button_press_event || button_release_event)
+ ResetIntelliDraw();
+ }
+
switch (actual_drawing_function)
{
case GADGET_ID_SINGLE_ITEMS:
if (edit_mode == ED_MODE_DRAWING && draw_with_brush &&
!inside_drawing_area)
DeleteBrushFromCursor();
+
+#if 0
+ ResetIntelliDraw();
+#endif
}
- if (!button)
+ if (!button || button_release_event)
break;
if (draw_with_brush)
{
+#if 0
if (!button_release_event)
+#endif
CopyBrushToLevel(sx, sy, button);
}
+#if 1
+ else
+#else
else if (new_element != Feld[lx][ly])
+#endif
{
if (new_element == EL_PLAYER_1)
{
{
if (Feld[x][y] == EL_PLAYER_1)
{
+#if 1
+ SetElement(x, y, EL_EMPTY);
+#else
Feld[x][y] = EL_EMPTY;
+#if 1
+ if (IN_ED_FIELD(x - level_xpos, y - level_ypos))
+ DrawMiniElement(x - level_xpos, y - level_ypos, EL_EMPTY);
+#else
if (x - level_xpos >= 0 && x - level_xpos < ed_fieldx &&
y - level_ypos >= 0 && y - level_ypos < ed_fieldy)
- DrawMiniElement(x - level_xpos, y - level_ypos,
- EL_EMPTY);
+ DrawMiniElement(x - level_xpos, y - level_ypos, EL_EMPTY);
+#endif
+#endif
}
}
}
}
+#if 1
+ SetElement(lx, ly, new_element);
+#else
Feld[lx][ly] = new_element;
DrawMiniElement(sx, sy, new_element);
+#endif
}
}
else
{
+ int type_id = gi->custom_type_id;
+ int pos = sx * drawingarea_info[type_id].area_ysize + sy;
+
if (item_xsize == MINI_TILEX && item_ysize == MINI_TILEY)
DrawMiniGraphicExt(drawto,
gi->x + sx * MINI_TILEX,
gi->y + sy * TILEY,
el2img(new_element), 0);
- if (id == GADGET_ID_AMOEBA_CONTENT)
- level.amoeba_content = new_element;
- else if (id == GADGET_ID_CUSTOM_GRAPHIC)
- {
+ if (id == GADGET_ID_CUSTOM_GRAPHIC)
new_element = GFX_ELEMENT(new_element);
- custom_element.gfx_element = new_element;
-
- CopyElementPropertiesToGame(properties_element);
-
- UpdateCustomElementGraphicGadgets();
- FrameCounter = 0; /* restart animation frame counter */
- }
- else if (id == GADGET_ID_CUSTOM_CONTENT)
- {
- custom_element.content[sx][sy] = new_element;
-
- CopyCustomElementPropertiesToGame(properties_element);
- }
- else if (id == GADGET_ID_CUSTOM_MOVE_ENTER)
- {
- custom_element.move_enter_element = new_element;
-
- CopyCustomElementPropertiesToGame(properties_element);
- }
- else if (id == GADGET_ID_CUSTOM_MOVE_LEAVE)
- {
- custom_element.move_leave_element = new_element;
-
- CopyCustomElementPropertiesToGame(properties_element);
- }
- else if (id == GADGET_ID_CUSTOM_CHANGE_TARGET)
- {
- custom_element_change.target_element = new_element;
+ drawingarea_info[type_id].value[pos] = new_element;
- CopyCustomElementPropertiesToGame(properties_element);
- }
- else if (id == GADGET_ID_CUSTOM_CHANGE_CONTENT)
- {
- custom_element_change.target_content[sx][sy] = new_element;
-
- CopyCustomElementPropertiesToGame(properties_element);
- }
- else if (id == GADGET_ID_CUSTOM_CHANGE_TRIGGER)
- {
- custom_element_change.trigger_element = new_element;
+ CopyElementPropertiesToGame(properties_element);
- CopyCustomElementPropertiesToGame(properties_element);
- }
- else if (id == GADGET_ID_GROUP_CONTENT)
+ if (id == GADGET_ID_CUSTOM_GRAPHIC)
{
- group_element_info.element[sx] = new_element;
+ UpdateCustomElementGraphicGadgets();
- CopyGroupElementPropertiesToGame(properties_element);
+ FrameCounter = 0; /* restart animation frame counter */
}
- else if (id == GADGET_ID_RANDOM_BACKGROUND)
- random_placement_background_element = new_element;
- 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;
MB_LEFTBUTTON);
else if (draw_level)
PickDrawingElement(button, Feld[lx][ly]);
- else if (id == GADGET_ID_AMOEBA_CONTENT)
- PickDrawingElement(button, level.amoeba_content);
- else if (id == GADGET_ID_CUSTOM_GRAPHIC)
- PickDrawingElement(button, custom_element.gfx_element);
- else if (id == GADGET_ID_CUSTOM_CONTENT)
- PickDrawingElement(button, custom_element.content[sx][sy]);
- else if (id == GADGET_ID_CUSTOM_MOVE_ENTER)
- PickDrawingElement(button, custom_element.move_enter_element);
- else if (id == GADGET_ID_CUSTOM_MOVE_LEAVE)
- PickDrawingElement(button, custom_element.move_leave_element);
- else if (id == GADGET_ID_CUSTOM_CHANGE_TARGET)
- PickDrawingElement(button, custom_element_change.target_element);
- else if (id == GADGET_ID_CUSTOM_CHANGE_CONTENT)
- PickDrawingElement(button, custom_element_change.target_content[sx][sy]);
- else if (id == GADGET_ID_CUSTOM_CHANGE_TRIGGER)
- PickDrawingElement(button, custom_element_change.trigger_element);
- else if (id == GADGET_ID_GROUP_CONTENT)
- 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_YAMYAM_CONTENT_0 &&
- id <= GADGET_ID_YAMYAM_CONTENT_7)
- {
- 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)
+ else
{
- int i = id - GADGET_ID_MAGIC_BALL_CONTENT_0;
+ int type_id = gi->custom_type_id;
+ int pos = sx * drawingarea_info[type_id].area_ysize + sy;
- PickDrawingElement(button, level.ball_content[i][sx][sy]);
+ PickDrawingElement(button, drawingarea_info[type_id].value[pos]);
}
break;
REQ_ASK))
{
if (gadget_id == counterbutton_info[counter_id].gadget_id_text)
- ModifyEditorCounter(counter_id, *counter_value);
+ ModifyEditorCounterValue(counter_id, *counter_value);
return;
}
if (gadget_id == counterbutton_info[counter_id].gadget_id_text)
*counter_value = gi->textinput.number_value;
else
- ModifyEditorCounter(counter_id, *counter_value + step);
+ ModifyEditorCounterValue(counter_id, *counter_value + step);
if (counter_id == ED_COUNTER_ID_SELECT_LEVEL)
{
DrawYamYamContentAreas();
break;
+ case ED_COUNTER_ID_BALL_CONTENT:
+ DrawMagicBallContentAreas();
+ break;
+
+ case ED_COUNTER_ID_ANDROID_CONTENT:
+ DrawAndroidElementArea(properties_element);
+ break;
+
case ED_COUNTER_ID_GROUP_CONTENT:
DrawGroupElementArea(properties_element);
CopyGroupElementPropertiesToGame(properties_element);
{
int type_id = gi->custom_type_id;
+#if 1
+ strncpy(textarea_info[type_id].value, gi->textarea.value,
+ MAX_ENVELOPE_TEXT_LEN);
+ textarea_info[type_id].value[MAX_ENVELOPE_TEXT_LEN] = '\0';
+#else
+ /* !!! BUGGY !!! MAX_ENVELOPE_TEXT_LEN != MAX_GADGET_TEXTSIZE !!! */
strcpy(textarea_info[type_id].value, gi->textarea.value);
+#endif
level.changed = TRUE;
}
static void HandleSelectboxGadgets(struct GadgetInfo *gi)
{
int type_id = gi->custom_type_id;
+ int value_old = *selectbox_info[type_id].value;
+ int value_new = selectbox_info[type_id].options[gi->selectbox.index].value;
- *selectbox_info[type_id].value =
- selectbox_info[type_id].options[gi->selectbox.index].value;
+ *selectbox_info[type_id].value = value_new;
if (type_id == ED_SELECTBOX_ID_SELECT_CHANGE_PAGE)
{
type_id <= ED_SELECTBOX_ID_CHANGE_LAST) ||
(type_id == ED_SELECTBOX_ID_GROUP_CHOICE_MODE))
{
+ if (type_id == ED_SELECTBOX_ID_ACTION_TYPE)
+ {
+ /* when changing action type, also check action mode and action arg */
+ if (value_old != value_new)
+ setSelectboxSpecialActionVariablesIfNeeded();
+
+ DrawPropertiesChange();
+ }
+
CopyElementPropertiesToGame(properties_element);
level.changed = TRUE;
int new_element = BUTTON_ELEMENT(button);
int x, y;
-#if 0
- /* MAKES PROBLEMS WITH ELEMENT LIST SCROLLBAR AND IS PROBABLY NOT NEEDED */
- /* !!! CHECK WHAT HAPPENS WHEN MOUSE WHEEL IS USED OVER ELEMENT LIST !!! */
-
- if (!IS_VALID_BUTTON(button))
- return;
-#endif
-
if (edit_mode == ED_MODE_DRAWING && drawing_function == GADGET_ID_TEXT)
DrawLevelText(0, 0, 0, TEXT_END);
for (x = 0; x < lev_fieldx; x++)
for (y = 0; y < lev_fieldy; y++)
Feld[x][y] = UndoBuffer[undo_buffer_position][x][y];
- DrawMiniLevel(ed_fieldx, ed_fieldy, level_xpos,level_ypos);
+
+ /* check if undo operation forces change of border style */
+ CheckLevelBorderElement(FALSE);
+
+ DrawMiniLevel(ed_fieldx, ed_fieldy, level_xpos, level_ypos);
+
break;
case GADGET_ID_INFO:
int element_position = id - GADGET_ID_ELEMENTLIST_FIRST;
int new_element = editor_elements[element_position + element_shift];
+ if (IS_EDITOR_CASCADE(new_element))
+ {
+ int i;
+
+ for (i = 0; editor_elements_info[i].setup_value != NULL; i++)
+ {
+ int *cascade_element= &(*editor_elements_info[i].headline_list)[0];
+ boolean *cascade_value=editor_elements_info[i].setup_cascade_value;
+
+ if (*cascade_element == new_element)
+ {
+ *cascade_element = EL_CASCADE_TOGGLE(*cascade_element);
+ *cascade_value = IS_EDITOR_CASCADE_ACTIVE(*cascade_element);
+
+ /* update element selection list */
+ ReinitializeElementList();
+ ModifyEditorElementList();
+
+ /* update cascading gadget info text */
+ PrintEditorGadgetInfoText(level_editor_gadget[id]);
+
+ /* save current editor cascading state */
+ SaveSetup_EditorCascade();
+
+ break;
+ }
+ }
+
+ break;
+ }
+
if (last_custom_copy_mode != -1)
{
if (CopyCustomElement(properties_element, new_element,
}
else if (button_status == MB_RELEASED)
{
- int i, id = GADGET_ID_NONE;
+ int id = GADGET_ID_NONE;
+ int new_element_shift = element_shift;
+ int i;
switch (key)
{
button = MB_RIGHTBUTTON;
break;
+ case KSYM_Home:
+ case KSYM_End:
+ element_shift = (key == KSYM_Home ? 0 :
+ num_editor_elements - ED_NUM_ELEMENTLIST_BUTTONS);
+
+ ModifyGadget(level_editor_gadget[GADGET_ID_SCROLL_LIST_VERTICAL],
+ GDI_SCROLLBAR_ITEM_POSITION,
+ element_shift / ED_ELEMENTLIST_BUTTONS_HORIZ, GDI_END);
+
+ ModifyEditorElementList();
+
+ break;
+
+ case KSYM_Insert:
+ case KSYM_Delete:
+
+ /* this is needed to prevent interference with running "True X-Mouse" */
+ if (GetKeyModStateFromEvents() & KMOD_Control)
+ break;
+
+ /* check for last or next editor cascade block in element list */
+ for (i = 0; i < num_editor_elements; i++)
+ {
+ if ((key == KSYM_Insert && i == element_shift) ||
+ (key == KSYM_Delete && new_element_shift > element_shift))
+ break;
+
+ /* jump to next cascade block (or to start of element list) */
+ if (i == 0 || IS_EDITOR_CASCADE(editor_elements[i]))
+ new_element_shift = i;
+ }
+
+ if (i < num_editor_elements)
+ element_shift = new_element_shift;
+
+ if (element_shift > num_editor_elements - ED_NUM_ELEMENTLIST_BUTTONS)
+ element_shift = num_editor_elements - ED_NUM_ELEMENTLIST_BUTTONS;
+
+ ModifyGadget(level_editor_gadget[GADGET_ID_SCROLL_LIST_VERTICAL],
+ GDI_SCROLLBAR_ITEM_POSITION,
+ element_shift / ED_ELEMENTLIST_BUTTONS_HORIZ, GDI_END);
+
+ ModifyEditorElementList();
+
+ break;
+
case KSYM_Escape:
if (edit_mode == ED_MODE_DRAWING)
{
- RequestExitLevelEditor(setup.ask_on_escape);
+ RequestExitLevelEditor(setup.ask_on_escape_editor);
}
else if (edit_mode == ED_MODE_INFO)
{
DrawDrawingWindow();
edit_mode = ED_MODE_DRAWING;
}
+
break;
default:
if (!DelayReached(&action_delay, action_delay_value))
return;
- DrawGraphicAnimationExt(drawto,
- SX + xpos * TILEX,
- SY + ypos * TILEY + MINI_TILEY / 2,
- el2img(properties_element), -1, NO_MASKING);
+ DrawEditorElementAnimation(SX + xpos * TILEX,
+ SY + ypos * TILEY + MINI_TILEY / 2);
MarkTileDirty(xpos, ypos);
MarkTileDirty(xpos, ypos + 1);
DrawBackground(INFOTEXT_XPOS, INFOTEXT_YPOS, INFOTEXT_XSIZE, INFOTEXT_YSIZE);
}
-void HandleEditorGadgetInfoText(void *ptr)
+void PrintEditorGadgetInfoText(struct GadgetInfo *gi)
{
- struct GadgetInfo *gi = (struct GadgetInfo *)ptr;
char infotext[MAX_OUTPUT_LINESIZE + 1];
char shortcut[MAX_OUTPUT_LINESIZE + 1];
int max_infotext_len = getMaxInfoTextLength();
- if (game_status != GAME_MODE_EDITOR)
- return;
-
- ClearEditorGadgetInfoText();
-
- if (gi->event.type == GD_EVENT_INFO_LEAVING)
- return;
-
- /* misuse this function to delete brush cursor, if needed */
- if (edit_mode == ED_MODE_DRAWING && draw_with_brush)
- DeleteBrushFromCursor();
-
if (gi == NULL || gi->info_text == NULL)
return;
DrawText(INFOTEXT_XPOS, INFOTEXT_YPOS, infotext, FONT_TEXT_2);
}
+void HandleEditorGadgetInfoText(void *ptr)
+{
+ struct GadgetInfo *gi = (struct GadgetInfo *)ptr;
+
+ if (game_status != GAME_MODE_EDITOR)
+ return;
+
+ ClearEditorGadgetInfoText();
+
+ if (gi == NULL || gi->event.type == GD_EVENT_INFO_LEAVING)
+ return;
+
+ /* misuse this function to delete brush cursor, if needed */
+ if (edit_mode == ED_MODE_DRAWING && draw_with_brush)
+ DeleteBrushFromCursor();
+
+ PrintEditorGadgetInfoText(gi);
+}
+
static void HandleDrawingAreaInfo(struct GadgetInfo *gi)
{
static int start_lx, start_ly;
int id = gi->custom_id;
+ int type_id = gi->custom_type_id;
int sx = gi->event.x;
int sy = gi->event.y;
int lx = sx + level_xpos;
}
else if (actual_drawing_function == GADGET_ID_PICK_ELEMENT)
{
- int element = EL_EMPTY;
-
- if (id == GADGET_ID_AMOEBA_CONTENT)
- element = level.amoeba_content;
- else if (id == GADGET_ID_CUSTOM_GRAPHIC)
- element = custom_element.gfx_element;
- else if (id == GADGET_ID_CUSTOM_CONTENT)
- element = custom_element.content[sx][sy];
- else if (id == GADGET_ID_CUSTOM_MOVE_ENTER)
- element = custom_element.move_enter_element;
- else if (id == GADGET_ID_CUSTOM_MOVE_LEAVE)
- element = custom_element.move_leave_element;
- else if (id == GADGET_ID_CUSTOM_CHANGE_TARGET)
- element = custom_element_change.target_element;
- else if (id == GADGET_ID_CUSTOM_CHANGE_CONTENT)
- element = custom_element_change.target_content[sx][sy];
- else if (id == GADGET_ID_CUSTOM_CHANGE_TRIGGER)
- element = custom_element_change.trigger_element;
- else if (id == GADGET_ID_GROUP_CONTENT)
- element = group_element_info.element[sx];
- else if (id == GADGET_ID_RANDOM_BACKGROUND)
- element = random_placement_background_element;
- 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];
+ int pos = sx * drawingarea_info[type_id].area_ysize + sy;
+ int element = drawingarea_info[type_id].value[pos];
strncpy(infotext, getElementInfoText(element), max_infotext_len);
}
else
{
- if (id == GADGET_ID_AMOEBA_CONTENT)
- strcpy(infotext, "Amoeba content");
- else if (id == GADGET_ID_CUSTOM_GRAPHIC)
- strcpy(infotext, "Custom graphic element");
- else if (id == GADGET_ID_CUSTOM_CONTENT)
- sprintf(infotext, "Custom element content position: %d, %d", sx, sy);
- else if (id == GADGET_ID_CUSTOM_MOVE_ENTER)
- strcpy(infotext, "Element that can be digged/collected");
- else if (id == GADGET_ID_CUSTOM_MOVE_LEAVE)
- strcpy(infotext, "Element that will be left behind");
- else if (id == GADGET_ID_CUSTOM_CHANGE_TARGET)
- strcpy(infotext, "New element after change");
- else if (id == GADGET_ID_CUSTOM_CHANGE_CONTENT)
- strcpy(infotext, "New extended elements after change");
- else if (id == GADGET_ID_CUSTOM_CHANGE_TRIGGER)
- strcpy(infotext, "Other element triggering change");
+ if (id == GADGET_ID_CUSTOM_CONTENT)
+ sprintf(infotext, "custom element content position: %d, %d", sx, sy);
else if (id == GADGET_ID_GROUP_CONTENT)
- sprintf(infotext, "Group element position: %d", sx + 1);
- else if (id == GADGET_ID_RANDOM_BACKGROUND)
- strcpy(infotext, "Random placement background");
+ sprintf(infotext, "group element position: %d", sx + 1);
else if (id >= GADGET_ID_YAMYAM_CONTENT_0 &&
id <= GADGET_ID_YAMYAM_CONTENT_7)
- sprintf(infotext, "Content area %d position: %d, %d",
+ 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",
+ sprintf(infotext, "content area %d position: %d, %d",
id - GADGET_ID_MAGIC_BALL_CONTENT_0 + 1, sx, sy);
+ else if (id == GADGET_ID_ANDROID_CONTENT)
+ sprintf(infotext, "android element position: %d", sx + 1);
+ else if (drawingarea_info[type_id].infotext != NULL)
+ strcpy(infotext, drawingarea_info[type_id].infotext);
}
infotext[max_infotext_len] = '\0';
Request("Level has changed ! Exit without saving ?",
REQ_ASK | REQ_STAY_OPEN))
{
-#if 1
CloseDoor(DOOR_CLOSE_1);
SetDoorState(DOOR_CLOSE_2);
-#else
- CloseDoor(DOOR_CLOSE_ALL);
-#endif
game_status = GAME_MODE_MAIN;
DrawMainMenu();
}