GADGET_ID_INVENTORY_SIZE_DOWN,
GADGET_ID_INVENTORY_SIZE_TEXT,
GADGET_ID_INVENTORY_SIZE_UP,
+ GADGET_ID_MM_BALL_CONTENT_DOWN,
+ GADGET_ID_MM_BALL_CONTENT_TEXT,
+ GADGET_ID_MM_BALL_CONTENT_UP,
GADGET_ID_CUSTOM_SCORE_DOWN,
GADGET_ID_CUSTOM_SCORE_TEXT,
GADGET_ID_CUSTOM_SCORE_UP,
GADGET_ID_ARTWORK_ELEMENT,
GADGET_ID_EXPLOSION_ELEMENT,
GADGET_ID_INVENTORY_CONTENT,
+ GADGET_ID_MM_BALL_CONTENT,
GADGET_ID_CUSTOM_GRAPHIC,
GADGET_ID_CUSTOM_CONTENT,
GADGET_ID_CUSTOM_MOVE_ENTER,
GADGET_ID_LEVELSET_SAVE_MODE,
GADGET_ID_WIND_DIRECTION,
GADGET_ID_PLAYER_SPEED,
+ GADGET_ID_MM_BALL_CHOICE_MODE,
GADGET_ID_CUSTOM_WALK_TO_ACTION,
GADGET_ID_CUSTOM_EXPLOSION_TYPE,
GADGET_ID_CUSTOM_DEADLINESS,
ED_COUNTER_ID_ENVELOPE_XSIZE,
ED_COUNTER_ID_ENVELOPE_YSIZE,
ED_COUNTER_ID_INVENTORY_SIZE,
+ ED_COUNTER_ID_MM_BALL_CONTENT,
ED_COUNTER_ID_CUSTOM_SCORE,
ED_COUNTER_ID_CUSTOM_GEMCOUNT,
ED_COUNTER_ID_CUSTOM_VALUE_FIX,
ED_SELECTBOX_ID_LEVELSET_SAVE_MODE,
ED_SELECTBOX_ID_WIND_DIRECTION,
ED_SELECTBOX_ID_PLAYER_SPEED,
+ ED_SELECTBOX_ID_MM_BALL_CHOICE_MODE,
ED_SELECTBOX_ID_CUSTOM_ACCESS_TYPE,
ED_SELECTBOX_ID_CUSTOM_ACCESS_LAYER,
ED_SELECTBOX_ID_CUSTOM_ACCESS_PROTECTED,
ED_DRAWING_ID_ARTWORK_ELEMENT,
ED_DRAWING_ID_EXPLOSION_ELEMENT,
ED_DRAWING_ID_INVENTORY_CONTENT,
+ ED_DRAWING_ID_MM_BALL_CONTENT,
ED_DRAWING_ID_CUSTOM_GRAPHIC,
ED_DRAWING_ID_CUSTOM_CONTENT,
ED_DRAWING_ID_CUSTOM_MOVE_ENTER,
&level.initial_inventory_size[0],
NULL, NULL, "number of inventory elements"
},
+ {
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(3),
+ MIN_ELEMENTS_IN_GROUP, MAX_MM_BALL_CONTENTS,
+ GADGET_ID_MM_BALL_CONTENT_DOWN, GADGET_ID_MM_BALL_CONTENT_UP,
+ GADGET_ID_MM_BALL_CONTENT_TEXT, GADGET_ID_NONE,
+ &level.num_mm_ball_contents,
+ NULL, NULL, "number of content elements"
+ },
// ---------- element settings: configure 1 (custom elements) ---------------
&level.initial_player_stepsize[0],
NULL, "initial player speed:", NULL, "initial player speed"
},
+ {
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(4),
+ GADGET_ID_MM_BALL_CHOICE_MODE, GADGET_ID_NONE,
+ -1,
+ options_group_choice_mode,
+ &level.mm_ball_choice_mode,
+ NULL, "choice type:", NULL, "type of content choice"
+ },
// ---------- element settings: configure 1 (custom elements) ---------------
NULL, NULL, NULL, NULL, "content for initial inventory"
},
+ // ---------- gray ball content -----------------------------------------
+
+ {
+ ED_AREA_1X1_SETTINGS_XPOS(0), ED_AREA_1X1_SETTINGS_YPOS(2),
+ ED_AREA_1X1_SETTINGS_XOFF, ED_AREA_1X1_SETTINGS_YOFF,
+ GADGET_ID_MM_BALL_CONTENT, GADGET_ID_NONE,
+ &level.mm_ball_content[0], MAX_MM_BALL_CONTENTS, 1,
+ "content:", NULL, NULL, NULL, "content for gray ball"
+ },
+
// ---------- element settings: configure 1 (custom elements) ---------------
// ---------- custom graphic ------------------------------------------------
MapDrawingArea(id);
}
+static void DrawMMBallContentArea(void)
+{
+ int id = ED_DRAWING_ID_MM_BALL_CONTENT;
+ int num_elements = level.num_mm_ball_contents;
+ int border_size = ED_DRAWINGAREA_BORDER_SIZE;
+ int sx = SX + ED_AREA_SETTINGS_X(drawingarea_info[id]) - border_size;
+ int sy = SY + ED_AREA_SETTINGS_Y(drawingarea_info[id]) - border_size;
+ int xsize = MAX_MM_BALL_CONTENTS;
+ int ysize = 1;
+
+ 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 * ED_DRAWINGAREA_TILE_SIZE + 2 * border_size,
+ ysize * ED_DRAWINGAREA_TILE_SIZE + 2 * border_size);
+
+ MapDrawingArea(id);
+}
+
static void DrawEnvelopeTextArea(int envelope_nr)
{
int id = ED_TEXTAREA_ID_ENVELOPE_INFO;
}
else if (properties_element == EL_EMC_ANDROID)
DrawAndroidElementArea();
+ else if (properties_element == EL_MM_GRAY_BALL)
+ {
+ MapCounterButtons(ED_COUNTER_ID_MM_BALL_CONTENT);
+ MapSelectboxGadget(ED_SELECTBOX_ID_MM_BALL_CHOICE_MODE);
+
+ DrawMMBallContentArea();
+ }
}
if (IS_PLAYER_ELEMENT(properties_element))
DrawPlayerInitialInventoryArea(properties_element);
break;
+ case ED_COUNTER_ID_MM_BALL_CONTENT:
+ DrawMMBallContentArea();
+ break;
+
case ED_COUNTER_ID_ENVELOPE_XSIZE:
case ED_COUNTER_ID_ENVELOPE_YSIZE:
DrawEnvelopeTextArea(-1);
TYPE_INTEGER, CONF_VALUE_16_BIT(1),
&li.mm_time_bomb, 75
},
+
{
EL_MM_GRAY_BALL, -1,
TYPE_INTEGER, CONF_VALUE_16_BIT(1),
&li.mm_time_ball, 75
},
+ {
+ EL_MM_GRAY_BALL, -1,
+ TYPE_INTEGER, CONF_VALUE_8_BIT(1),
+ &li.mm_ball_choice_mode, ANIM_RANDOM
+ },
+ {
+ EL_MM_GRAY_BALL, -1,
+ TYPE_ELEMENT_LIST, CONF_VALUE_BYTES(1),
+ &li.mm_ball_content, EL_EMPTY, NULL,
+ &li.num_mm_ball_contents, 8, MAX_MM_BALL_CONTENTS
+ },
+
{
EL_MM_STEEL_BLOCK, -1,
TYPE_INTEGER, CONF_VALUE_16_BIT(1),
int element = i;
struct ElementInfo *ei = &element_info[element];
+ if (element == EL_MM_GRAY_BALL)
+ {
+ struct LevelInfo_MM *level_mm = level->native_mm_level;
+ int j;
+
+ for (j = 0; j < level->num_mm_ball_contents; j++)
+ level->mm_ball_content[j] =
+ map_element_MM_to_RND(level_mm->ball_content[j]);
+ }
+
// never initialize clipboard elements after the very first time
// (to be able to use clipboard elements between several levels)
if (IS_CLIPBOARD_ELEMENT(element) && clipboard_elements_initialized)
static void CopyNativeLevel_RND_to_MM(struct LevelInfo *level)
{
struct LevelInfo_MM *level_mm = level->native_mm_level;
- int x, y;
+ int i, x, y;
level_mm->fieldx = MIN(level->fieldx, MM_MAX_PLAYFIELD_WIDTH);
level_mm->fieldy = MIN(level->fieldy, MM_MAX_PLAYFIELD_HEIGHT);
level_mm->time_ball = level->mm_time_ball;
level_mm->time_block = level->mm_time_block;
+ level_mm->num_ball_contents = level->num_mm_ball_contents;
+ level_mm->ball_choice_mode = level->mm_ball_choice_mode;
+
+ for (i = 0; i < level->num_mm_ball_contents; i++)
+ level_mm->ball_content[i] =
+ map_element_RND_to_MM(level->mm_ball_content[i]);
+
for (x = 0; x < level->fieldx; x++)
for (y = 0; y < level->fieldy; y++)
Ur[x][y] =
static void CopyNativeLevel_MM_to_RND(struct LevelInfo *level)
{
struct LevelInfo_MM *level_mm = level->native_mm_level;
- int x, y;
+ int i, x, y;
level->fieldx = MIN(level_mm->fieldx, MAX_LEV_FIELDX);
level->fieldy = MIN(level_mm->fieldy, MAX_LEV_FIELDY);
level->mm_time_ball = level_mm->time_ball;
level->mm_time_block = level_mm->time_block;
+ level->num_mm_ball_contents = level_mm->num_ball_contents;
+ level->mm_ball_choice_mode = level_mm->ball_choice_mode;
+
+ for (i = 0; i < level->num_mm_ball_contents; i++)
+ level->mm_ball_content[i] =
+ map_element_MM_to_RND(level_mm->ball_content[i]);
+
for (x = 0; x < level->fieldx; x++)
for (y = 0; y < level->fieldy; y++)
level->field[x][y] = map_element_MM_to_RND(level_mm->field[x][y]);