#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_ENVELOPE_XSIZE_DOWN (GADGET_ID_COUNTER_FIRST + 39)
-#define GADGET_ID_ENVELOPE_XSIZE_TEXT (GADGET_ID_COUNTER_FIRST + 40)
-#define GADGET_ID_ENVELOPE_XSIZE_UP (GADGET_ID_COUNTER_FIRST + 41)
-#define GADGET_ID_ENVELOPE_YSIZE_DOWN (GADGET_ID_COUNTER_FIRST + 42)
-#define GADGET_ID_ENVELOPE_YSIZE_TEXT (GADGET_ID_COUNTER_FIRST + 43)
-#define GADGET_ID_ENVELOPE_YSIZE_UP (GADGET_ID_COUNTER_FIRST + 44)
-#define GADGET_ID_CUSTOM_SCORE_DOWN (GADGET_ID_COUNTER_FIRST + 45)
-#define GADGET_ID_CUSTOM_SCORE_TEXT (GADGET_ID_COUNTER_FIRST + 46)
-#define GADGET_ID_CUSTOM_SCORE_UP (GADGET_ID_COUNTER_FIRST + 47)
-#define GADGET_ID_CUSTOM_GEMCOUNT_DOWN (GADGET_ID_COUNTER_FIRST + 48)
-#define GADGET_ID_CUSTOM_GEMCOUNT_TEXT (GADGET_ID_COUNTER_FIRST + 49)
-#define GADGET_ID_CUSTOM_GEMCOUNT_UP (GADGET_ID_COUNTER_FIRST + 50)
-#define GADGET_ID_CUSTOM_VALUE_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 51)
-#define GADGET_ID_CUSTOM_VALUE_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 52)
-#define GADGET_ID_CUSTOM_VALUE_FIX_UP (GADGET_ID_COUNTER_FIRST + 53)
-#define GADGET_ID_CUSTOM_VALUE_RND_DOWN (GADGET_ID_COUNTER_FIRST + 54)
-#define GADGET_ID_CUSTOM_VALUE_RND_TEXT (GADGET_ID_COUNTER_FIRST + 55)
-#define GADGET_ID_CUSTOM_VALUE_RND_UP (GADGET_ID_COUNTER_FIRST + 56)
-#define GADGET_ID_PUSH_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 57)
-#define GADGET_ID_PUSH_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 58)
-#define GADGET_ID_PUSH_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 59)
-#define GADGET_ID_PUSH_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 60)
-#define GADGET_ID_PUSH_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 61)
-#define GADGET_ID_PUSH_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 62)
-#define GADGET_ID_DROP_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 63)
-#define GADGET_ID_DROP_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 64)
-#define GADGET_ID_DROP_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 65)
-#define GADGET_ID_DROP_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 66)
-#define GADGET_ID_DROP_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 67)
-#define GADGET_ID_DROP_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 68)
-#define GADGET_ID_MOVE_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 69)
-#define GADGET_ID_MOVE_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 70)
-#define GADGET_ID_MOVE_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 71)
-#define GADGET_ID_MOVE_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 72)
-#define GADGET_ID_MOVE_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 73)
-#define GADGET_ID_MOVE_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 74)
-#define GADGET_ID_EXPLOSION_DELAY_DOWN (GADGET_ID_COUNTER_FIRST + 75)
-#define GADGET_ID_EXPLOSION_DELAY_TEXT (GADGET_ID_COUNTER_FIRST + 76)
-#define GADGET_ID_EXPLOSION_DELAY_UP (GADGET_ID_COUNTER_FIRST + 77)
-#define GADGET_ID_IGNITION_DELAY_DOWN (GADGET_ID_COUNTER_FIRST + 78)
-#define GADGET_ID_IGNITION_DELAY_TEXT (GADGET_ID_COUNTER_FIRST + 79)
-#define GADGET_ID_IGNITION_DELAY_UP (GADGET_ID_COUNTER_FIRST + 80)
-#define GADGET_ID_CHANGE_DELAY_FIX_DOWN (GADGET_ID_COUNTER_FIRST + 81)
-#define GADGET_ID_CHANGE_DELAY_FIX_TEXT (GADGET_ID_COUNTER_FIRST + 82)
-#define GADGET_ID_CHANGE_DELAY_FIX_UP (GADGET_ID_COUNTER_FIRST + 83)
-#define GADGET_ID_CHANGE_DELAY_RND_DOWN (GADGET_ID_COUNTER_FIRST + 84)
-#define GADGET_ID_CHANGE_DELAY_RND_TEXT (GADGET_ID_COUNTER_FIRST + 85)
-#define GADGET_ID_CHANGE_DELAY_RND_UP (GADGET_ID_COUNTER_FIRST + 86)
-#define GADGET_ID_CHANGE_CONT_RND_DOWN (GADGET_ID_COUNTER_FIRST + 87)
-#define GADGET_ID_CHANGE_CONT_RND_TEXT (GADGET_ID_COUNTER_FIRST + 88)
-#define GADGET_ID_CHANGE_CONT_RND_UP (GADGET_ID_COUNTER_FIRST + 89)
-#define GADGET_ID_GROUP_CONTENT_DOWN (GADGET_ID_COUNTER_FIRST + 90)
-#define GADGET_ID_GROUP_CONTENT_TEXT (GADGET_ID_COUNTER_FIRST + 91)
-#define GADGET_ID_GROUP_CONTENT_UP (GADGET_ID_COUNTER_FIRST + 92)
+#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 + 93)
+#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_START_ELEMENT (GADGET_ID_DRAWING_AREA_FIRST + 18)
-#define GADGET_ID_ARTWORK_ELEMENT (GADGET_ID_DRAWING_AREA_FIRST + 19)
-#define GADGET_ID_EXPLOSION_ELEMENT (GADGET_ID_DRAWING_AREA_FIRST + 20)
-#define GADGET_ID_CUSTOM_GRAPHIC (GADGET_ID_DRAWING_AREA_FIRST + 21)
-#define GADGET_ID_CUSTOM_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 22)
-#define GADGET_ID_CUSTOM_MOVE_ENTER (GADGET_ID_DRAWING_AREA_FIRST + 23)
-#define GADGET_ID_CUSTOM_MOVE_LEAVE (GADGET_ID_DRAWING_AREA_FIRST + 24)
-#define GADGET_ID_CUSTOM_CHANGE_TARGET (GADGET_ID_DRAWING_AREA_FIRST + 25)
-#define GADGET_ID_CUSTOM_CHANGE_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 26)
-#define GADGET_ID_CUSTOM_CHANGE_TRIGGER (GADGET_ID_DRAWING_AREA_FIRST + 27)
-#define GADGET_ID_GROUP_CONTENT (GADGET_ID_DRAWING_AREA_FIRST + 28)
-#define GADGET_ID_RANDOM_BACKGROUND (GADGET_ID_DRAWING_AREA_FIRST + 29)
+#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 + 30)
+#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 ED_COUNTER_ID_ELEMENT_VALUE4 10
#define ED_COUNTER_ID_YAMYAM_CONTENT 11
#define ED_COUNTER_ID_BALL_CONTENT 12
-#define ED_COUNTER_ID_ENVELOPE_XSIZE 13
-#define ED_COUNTER_ID_ENVELOPE_YSIZE 14
-#define ED_COUNTER_ID_CUSTOM_SCORE 15
-#define ED_COUNTER_ID_CUSTOM_GEMCOUNT 16
-#define ED_COUNTER_ID_CUSTOM_VALUE_FIX 17
-#define ED_COUNTER_ID_CUSTOM_VALUE_RND 18
-#define ED_COUNTER_ID_PUSH_DELAY_FIX 19
-#define ED_COUNTER_ID_PUSH_DELAY_RND 20
-#define ED_COUNTER_ID_DROP_DELAY_FIX 21
-#define ED_COUNTER_ID_DROP_DELAY_RND 22
-#define ED_COUNTER_ID_MOVE_DELAY_FIX 23
-#define ED_COUNTER_ID_MOVE_DELAY_RND 24
-#define ED_COUNTER_ID_EXPLOSION_DELAY 25
-#define ED_COUNTER_ID_IGNITION_DELAY 26
-#define ED_COUNTER_ID_GROUP_CONTENT 27
-#define ED_COUNTER_ID_CHANGE_DELAY_FIX 28
-#define ED_COUNTER_ID_CHANGE_DELAY_RND 29
-#define ED_COUNTER_ID_CHANGE_CONT_RND 30
-
-#define ED_NUM_COUNTERBUTTONS 31
+#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
#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_START_ELEMENT 18
-#define ED_DRAWING_ID_ARTWORK_ELEMENT 19
-#define ED_DRAWING_ID_EXPLOSION_ELEMENT 20
-#define ED_DRAWING_ID_CUSTOM_GRAPHIC 21
-#define ED_DRAWING_ID_CUSTOM_CONTENT 22
-#define ED_DRAWING_ID_CUSTOM_MOVE_ENTER 23
-#define ED_DRAWING_ID_CUSTOM_MOVE_LEAVE 24
-#define ED_DRAWING_ID_CUSTOM_CHANGE_TARGET 25
-#define ED_DRAWING_ID_CUSTOM_CHANGE_CONTENT 26
-#define ED_DRAWING_ID_CUSTOM_CHANGE_TRIGGER 27
-#define ED_DRAWING_ID_GROUP_CONTENT 28
-#define ED_DRAWING_ID_RANDOM_BACKGROUND 29
-
-#define ED_NUM_DRAWING_AREAS 30
+#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
/*
&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,
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 --------------------------------------------- */
{
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;
/* pre-defined properties */
{ EP_CAN_PASS_MAGIC_WALL, "- can pass magic walls" },
{ 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 }
};
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))
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)+
- (properties_element == EL_EMC_MAGIC_BALL ? 2 : 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;
}
}
- if (HAS_CONTENT(properties_element))
+ if (HAS_EDITOR_CONTENT(properties_element))
{
/* draw stickybutton gadget */
MapCheckbuttonGadget(ED_CHECKBUTTON_ID_STICK_ELEMENT);
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))
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 (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);
}
DrawMagicBallContentAreas();
break;
+ case ED_COUNTER_ID_ANDROID_CONTENT:
+ DrawAndroidElementArea(properties_element);
+ break;
+
case ED_COUNTER_ID_GROUP_CONTENT:
DrawGroupElementArea(properties_element);
CopyGroupElementPropertiesToGame(properties_element);
id <= GADGET_ID_MAGIC_BALL_CONTENT_7)
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);
}
#define CONF_VALUE_ELEMENT_7 (CONF_MASK_2_BYTE | 7)
#define CONF_VALUE_ELEMENT_8 (CONF_MASK_2_BYTE | 8)
-#define CONF_VALUE_CONTENT_1 (CONF_MASK_MULTI_BYTES | 1)
-#define CONF_VALUE_CONTENT_8 (CONF_MASK_MULTI_BYTES | 2)
+#define CONF_VALUE_ELEMENTS (CONF_MASK_MULTI_BYTES | 1)
+#define CONF_VALUE_CONTENTS (CONF_MASK_MULTI_BYTES | 2)
#define CONF_VALUE_INTEGER(x) ((x) >= CONF_VALUE_INTEGER_1 && \
(x) <= CONF_VALUE_INTEGER_8)
#define CONF_CONTENT_NUM_ELEMENTS (3 * 3)
#define CONF_CONTENT_NUM_BYTES (CONF_CONTENT_NUM_ELEMENTS * 2)
+#define CONF_ELEMENT_NUM_BYTES (2)
+
+#define CONF_ENTITY_NUM_BYTES(t) ((t) == CONF_VALUE_ELEMENTS ? \
+ CONF_ELEMENT_NUM_BYTES : \
+ (t) == CONF_VALUE_CONTENTS ? \
+ CONF_CONTENT_NUM_BYTES : 1)
+
+#define CONF_ELEMENT_BYTE_POS(i) ((i) * CONF_ELEMENT_NUM_BYTES)
+#define CONF_ELEMENTS_ELEMENT(b,i) ((b[CONF_ELEMENT_BYTE_POS(i)] << 8) | \
+ (b[CONF_ELEMENT_BYTE_POS(i) + 1]))
#define CONF_CONTENT_ELEMENT_POS(c,x,y) ((c) * CONF_CONTENT_NUM_ELEMENTS + \
(y) * 3 + (x))
-#define CONF_CONTENT_BYTE_POS(c,x,y) (CONF_CONTENT_ELEMENT_POS(c,x,y) * 2)
-#define CONF_CONTENT_ELEMENT(b,c,x,y) ((b[CONF_CONTENT_BYTE_POS(c,x,y)] << 8)|\
- (b[CONF_CONTENT_BYTE_POS(c,x,y) + 1]))
+#define CONF_CONTENT_BYTE_POS(c,x,y) (CONF_CONTENT_ELEMENT_POS(c,x,y) * \
+ CONF_ELEMENT_NUM_BYTES)
+#define CONF_CONTENTS_ELEMENT(b,c,x,y) ((b[CONF_CONTENT_BYTE_POS(c,x,y)]<< 8)|\
+ (b[CONF_CONTENT_BYTE_POS(c,x,y) + 1]))
static struct LevelInfo li;
static struct
{
- int element;
- int type;
- void *value;
- int default_value;
+ int element; /* element for which data is to be stored */
+ int type; /* type of data to be stored */
+
+ /* (mandatory) */
+ void *value; /* variable that holds the data to be stored */
+ int default_value; /* initial default value for this variable */
+
+ /* (optional) */
+ void *num_entities; /* number of entities for multi-byte data */
+ int default_num_entities; /* default number of entities for this data */
+ int max_num_entities; /* maximal number of entities for this data */
} element_conf[] =
{
/* ---------- 1-byte values ---------------------------------------------- */
+
{
EL_EMC_ANDROID, CONF_VALUE_INTEGER_1,
&li.android_move_time, 10
EL_EMC_MAGIC_BALL, CONF_VALUE_INTEGER_1,
&li.ball_time, 10
},
- {
- EL_EMC_MAGIC_BALL, CONF_VALUE_INTEGER_2,
- &li.num_ball_contents, 8
- },
{
EL_EMC_MAGIC_BALL, CONF_VALUE_BOOLEAN_1,
&li.ball_random, FALSE
},
/* ---------- 2-byte values ---------------------------------------------- */
+
{
EL_PLAYER_1, CONF_VALUE_ELEMENT_1,
&li.start_element[0], EL_PLAYER_1
},
/* ---------- multi-byte values ------------------------------------------ */
+
+ {
+ EL_EMC_MAGIC_BALL, CONF_VALUE_CONTENTS,
+ &li.ball_content, EL_EMPTY,
+ &li.num_ball_contents, 4, MAX_ELEMENT_CONTENTS
+ },
{
- EL_EMC_MAGIC_BALL, CONF_VALUE_CONTENT_8,
- &li.ball_content, EL_EMPTY
+ EL_EMC_ANDROID, CONF_VALUE_ELEMENTS,
+ &li.android_clone_element[0], EL_EMPTY,
+ &li.num_android_clone_elements, 1, MAX_ANDROID_ELEMENTS
},
{
-1, -1,
- NULL, -1
+ NULL, -1,
},
};
int type = element_conf[i].type;
int bytes = type & CONF_MASK_BYTES;
- if (bytes != CONF_MASK_MULTI_BYTES)
+ if (bytes == CONF_MASK_MULTI_BYTES)
+ {
+ int default_num_entities = element_conf[i].default_num_entities;
+ int max_num_entities = element_conf[i].max_num_entities;
+
+ *(int *)(element_conf[i].num_entities) = default_num_entities;
+
+ if (type == CONF_VALUE_ELEMENTS)
+ {
+ int *element_array = (int *)(element_conf[i].value);
+ int j;
+
+ for (j = 0; j < max_num_entities; j++)
+ element_array[j] = default_value;
+ }
+ else if (type == CONF_VALUE_CONTENTS)
+ {
+ struct Content *content = (struct Content *)(element_conf[i].value);
+ int c, x, y;
+
+ for (c = 0; c < max_num_entities; c++)
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 3; x++)
+ content[c].e[x][y] = default_value;
+ }
+ }
+ else /* constant size configuration data (1, 2 or 4 bytes) */
{
if (CONF_VALUE_BOOLEAN(type))
*(boolean *)(element_conf[i].value) = default_value;
else
*(int *) (element_conf[i].value) = default_value;
}
- else if (type == CONF_VALUE_CONTENT_8)
- {
- struct Content *content = (struct Content *)(element_conf[i].value);
- int c, x, y;
-
- for (c = 0; c < MAX_ELEMENT_CONTENTS; c++)
- for (y = 0; y < 3; y++)
- for (x = 0; x < 3; x++)
- content[c].e[x][y] = default_value;
- }
}
*level = li; /* copy temporary buffer back to level information */
for (y = 0; y < 3; y++)
level->ball_content[i].e[x][y] = EL_EMPTY;
#endif
+#if 0
for (i = 0; i < 16; i++)
level->android_array[i] = FALSE;
+#endif
level->use_custom_template = FALSE;
if (element_conf[i].element == element &&
element_conf[i].type == type)
{
+ int num_entities = num_bytes / CONF_ENTITY_NUM_BYTES(type);
+ int max_num_entities = element_conf[i].max_num_entities;
+
+ if (num_entities > max_num_entities)
+ {
+ Error(ERR_WARN,
+ "truncating number of entities for element %d from %d to %d",
+ element, num_entities, max_num_entities);
+
+ num_entities = max_num_entities;
+ }
+
+ *(int *)(element_conf[i].num_entities) = num_entities;
+
element_found = TRUE;
- if (type == CONF_VALUE_CONTENT_8)
+ if (type == CONF_VALUE_ELEMENTS)
+ {
+ int *element_array = (int *)(element_conf[i].value);
+ int j;
+
+ for (j = 0; j < num_entities; j++)
+ element_array[j] =
+ getMappedElement(CONF_ELEMENTS_ELEMENT(buffer, j));
+ }
+ else if (type == CONF_VALUE_CONTENTS)
{
struct Content *content= (struct Content *)(element_conf[i].value);
- int num_contents = num_bytes / CONF_CONTENT_NUM_BYTES;
int c, x, y;
- for (c = 0; c < num_contents; c++)
+ for (c = 0; c < num_entities; c++)
for (y = 0; y < 3; y++)
for (x = 0; x < 3; x++)
content[c].e[x][y] =
- getMappedElement(CONF_CONTENT_ELEMENT(buffer, c, x, y));
+ getMappedElement(CONF_CONTENTS_ELEMENT(buffer, c, x, y));
}
else
element_found = FALSE;
real_chunk_size += 2 + num_bytes;
}
- else
+ else /* constant size configuration data (1, 2 or 4 bytes) */
{
int value = (bytes == CONF_MASK_1_BYTE ? getFile8Bit (file) :
bytes == CONF_MASK_2_BYTE ? getFile16BitBE(file) :
map_element_RND_to_EM(level->
ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]]);
+ map_android_clone_elements_RND_to_EM(level);
+
+#if 0
for (i = 0; i < 16; i++)
lev->android_array[i] = FALSE; /* !!! YET TO COME !!! */
+#endif
/* first fill the complete playfield with the default border element */
for (y = 0; y < EM_MAX_CAVE_HEIGHT; y++)
level->ball_content[i].e[ball_xy[j][0]][ball_xy[j][1]] =
map_element_EM_to_RND(lev->ball_array[i][j]);
+ map_android_clone_elements_EM_to_RND(level);
+
+#if 0
for (i = 0; i < 16; i++)
level->android_array[i] = FALSE; /* !!! YET TO COME !!! */
+#endif
/* convert the playfield (some elements need special treatment) */
for (y = 0; y < level->fieldy; y++) for (x = 0; x < level->fieldx; x++)
return num_bytes;
}
-static int SaveLevel_CONF_Content(FILE *file, int pos, int num_contents)
+static int SaveLevel_CONF_Elements(FILE *file, int pos)
+{
+ int *element_array = (int *)(element_conf[pos].value);
+ int num_elements = *(int *)element_conf[pos].num_entities;
+ int default_value = element_conf[pos].default_value;
+ int element = element_conf[pos].element;
+ int type = element_conf[pos].type;
+ int num_bytes = 0;
+ boolean modified = FALSE;
+ int i;
+
+ /* check if any settings have been modified before saving them */
+ for (i = 0; i < num_elements; i++)
+ if (element_array[i] != default_value)
+ modified = TRUE;
+
+ if (!modified) /* do not save unmodified default settings */
+ return 0;
+
+ num_bytes += putFile16BitBE(file, element);
+ num_bytes += putFile8Bit(file, type);
+ num_bytes += putFile16BitBE(file, num_elements * CONF_ELEMENT_NUM_BYTES);
+
+ for (i = 0; i < num_elements; i++)
+ num_bytes += putFile16BitBE(file, element_array[i]);
+
+ return num_bytes;
+}
+
+static int SaveLevel_CONF_Contents(FILE *file, int pos)
{
struct Content *content = (struct Content *)(element_conf[pos].value);
+ int num_contents = *(int *)element_conf[pos].num_entities;
int default_value = element_conf[pos].default_value;
int element = element_conf[pos].element;
int type = element_conf[pos].type;
if (bytes != CONF_MASK_MULTI_BYTES)
chunk_size += SaveLevel_CONF_Value(file, i);
- else if (type == CONF_VALUE_CONTENT_8)
- chunk_size += SaveLevel_CONF_Content(file, i, MAX_ELEMENT_CONTENTS);
+ else if (type == CONF_VALUE_ELEMENTS)
+ chunk_size += SaveLevel_CONF_Elements(file, i);
+ else if (type == CONF_VALUE_CONTENTS)
+ chunk_size += SaveLevel_CONF_Contents(file, i);
}
return chunk_size;