#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_WIND_DIRECTION
+#define ED_SELECTBOX_ID_LEVEL_LAST ED_SELECTBOX_ID_GAME_ENGINE_TYPE
#define ED_SELECTBOX_ID_CUSTOM1_FIRST ED_SELECTBOX_ID_CUSTOM_ACCESS_TYPE
#define ED_SELECTBOX_ID_CUSTOM1_LAST ED_SELECTBOX_ID_CUSTOM_WALK_TO_ACTION
"score for each second/step left:", NULL, NULL
},
{
- ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(13),
+ ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(12),
0, 9999,
GADGET_ID_LEVEL_RANDOM_SEED_DOWN, GADGET_ID_LEVEL_RANDOM_SEED_UP,
GADGET_ID_LEVEL_RANDOM_SEED_TEXT, GADGET_ID_NONE,
int size; /* char size of selectbox or '-1' (dynamically determined) */
struct ValueTextInfo *options;
int *value;
- char *text_left, *text_right, *infotext;
+ char *text_above, *text_left, *text_right, *infotext;
} selectbox_info[ED_NUM_SELECTBOX] =
{
/* ---------- level and editor settings ---------------------------------- */
-1,
options_time_or_steps,
&level.use_step_counter,
- NULL, "(0 => no limit)", "time or step limit"
+ NULL, NULL, "(0 => no limit)", "time or step limit"
},
{
- ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(12),
+ 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"
+ NULL, "game engine:", NULL, "game engine"
},
+
+ /* ---------- element settings: configure (several elements) ------------- */
+
{
- ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(11),
+ ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(0),
GADGET_ID_WIND_DIRECTION, GADGET_ID_NONE,
-1,
options_wind_direction,
&level.wind_direction_initial,
- "initial wind direction:", NULL, "initial wind direction"
+ NULL, "initial wind direction:", NULL, "initial wind direction"
},
-
- /* ---------- element settings: configure (several elements) ------------- */
-
{
ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(7),
GADGET_ID_PLAYER_SPEED, GADGET_ID_NONE,
-1,
options_player_speed,
&level.initial_player_stepsize[0],
- "initial player speed:", NULL, "initial player speed"
+ NULL, "initial player speed:", NULL, "initial player speed"
},
/* ---------- element settings: configure 1 (custom elements) ------------ */
-1,
options_access_type,
&custom_element.access_type,
- NULL, NULL, "type of access to this field"
+ NULL, NULL, NULL, "type of access to this field"
},
{
-1, ED_ELEMENT_SETTINGS_YPOS(2),
-1,
options_access_layer,
&custom_element.access_layer,
- NULL, NULL, "layer of access for this field"
+ NULL, NULL, NULL, "layer of access for this field"
},
{
-1, ED_ELEMENT_SETTINGS_YPOS(2),
-1,
options_access_protected,
&custom_element.access_protected,
- NULL, NULL, "protected access for this field"
+ NULL, NULL, NULL, "protected access for this field"
},
{
ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(3),
-1,
options_access_direction,
&custom_element.access_direction,
- "from", NULL, "access direction for this field"
+ NULL, "from", NULL, "access direction for this field"
},
{
ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(4),
-1,
options_walk_to_action,
&custom_element.walk_to_action,
- NULL, NULL, "diggable/collectible/pushable"
+ NULL, NULL, NULL, "diggable/collectible/pushable"
},
/* ---------- element settings: configure 2 (custom elements) ------------ */
-1,
options_move_pattern,
&custom_element.move_pattern,
- "can move", NULL, "element move pattern"
+ NULL, "can move", NULL, "element move pattern"
},
{
ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(2),
-1,
options_move_direction,
&custom_element.move_direction_initial,
- "starts moving", NULL, "initial element move direction"
+ NULL, "starts moving", NULL, "initial element move direction"
},
{
ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(4),
-1,
options_move_stepsize,
&custom_element.move_stepsize,
- "move/fall speed", NULL, "speed of element movement"
+ NULL, "move/fall speed", NULL, "speed of element movement"
},
{
ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(3),
&custom_element.move_leave_type,
// left text with leading spaces to place gadget next to "can dig" gadget
// (needed because drawing area gadgets created after selectbox gadgets)
- // "can dig: can", ":", "leave behind or change element"
- " can", ":", "leave behind or change element"
+ // NULL, "can dig: can", ":", "leave behind or change element"
+ NULL, " can", ":", "leave behind or change element"
},
{
-1, ED_ELEMENT_SETTINGS_YPOS(7),
-1,
options_smash_targets,
&custom_element.smash_targets,
- "can smash", NULL, "elements that can be smashed"
+ NULL, "can smash", NULL, "elements that can be smashed"
},
{
ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(8),
-1,
options_slippery_type,
&custom_element.slippery_type,
- "slippery", NULL, "where other elements fall down"
+ NULL, "slippery", NULL, "where other elements fall down"
},
{
ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(9),
-1,
options_deadliness,
&custom_element.deadliness,
- "deadly when", NULL, "deadliness of element"
+ NULL, "deadly when", NULL, "deadliness of element"
},
{
ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(10),
-1,
options_explosion_type,
&custom_element.explosion_type,
- "can explode", NULL, "explosion type"
+ NULL, "can explode", NULL, "explosion type"
},
/* ---------- element settings: advanced (custom elements) --------------- */
-1,
options_time_units,
&custom_element_change.delay_frames,
- "delay time given in", NULL, "delay time units for change"
+ NULL, "delay time given in", NULL, "delay time units for change"
},
{
ED_ELEMENT_SETTINGS_XPOS(2), ED_ELEMENT_SETTINGS_YPOS(4),
-1,
options_change_direct_action,
&custom_element_change.direct_action,
- NULL, NULL, "type of direct action"
+ NULL, NULL, NULL, "type of direct action"
},
{
ED_ELEMENT_SETTINGS_XPOS(2), ED_ELEMENT_SETTINGS_YPOS(5),
-1,
options_change_other_action,
&custom_element_change.other_action,
- NULL, "element:", "type of other element action"
+ NULL, NULL, "element:", "type of other element action"
},
{
ED_ELEMENT_SETTINGS_XPOS(2), ED_ELEMENT_SETTINGS_YPOS(6),
-1,
options_change_trigger_side,
&custom_element_change.trigger_side,
- "at", "side", "element side triggering change"
+ NULL, "at", "side", "element side triggering change"
},
{
ED_ELEMENT_SETTINGS_XPOS(2), ED_ELEMENT_SETTINGS_YPOS(7),
-1,
options_change_trigger_player,
&custom_element_change.trigger_player,
- "player:", " ", "player that causes change"
+ NULL, "player:", " ", "player that causes change"
},
{
ED_ELEMENT_SETTINGS_XPOS(2), ED_ELEMENT_SETTINGS_YPOS(7),
-1,
options_change_trigger_page,
&custom_element_change.trigger_page,
- "page:", NULL, "change page that causes change"
+ NULL, "page:", NULL, "change page that causes change"
},
{
ED_ELEMENT_SETTINGS_XPOS(2), ED_ELEMENT_SETTINGS_YPOS(10),
-1,
options_change_replace_when,
&custom_element_change.replace_when,
- "replace when", NULL, "which elements can be replaced"
+ NULL, "replace when", NULL, "which elements can be replaced"
},
{
ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(13),
-1,
options_action_type,
&custom_element_change.action_type,
- NULL, NULL, "action on specified condition"
+ NULL, NULL, NULL, "action on specified condition"
},
{
-1, ED_ELEMENT_SETTINGS_YPOS(13),
-1,
options_action_mode_none,
&custom_element_change.action_mode,
- NULL, NULL, "action operator"
+ NULL, NULL, NULL, "action operator"
},
{
-1, ED_ELEMENT_SETTINGS_YPOS(13),
-1,
options_action_arg_none,
&custom_element_change.action_arg,
- NULL, NULL, "action parameter"
+ NULL, NULL, NULL, "action parameter"
},
{
ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(14),
3,
options_change_page,
&custom_element.current_change_page,
- NULL, NULL, "element change page"
+ NULL, NULL, NULL, "element change page"
},
/* ---------- element settings: configure (group elements) --------------- */
-1,
options_group_choice_mode,
&group_element_info.choice_mode,
- "choice type:", NULL, "type of group element choice"
+ NULL, "choice type:", NULL, "type of group element choice"
},
};
{
ED_LEVEL_TABS_XPOS(0), ED_LEVEL_TABS_YPOS(0),
GADGET_ID_LEVELINFO_LEVEL, GADGET_ID_NONE,
- 8, "Level",
+ 8, "Level",
NULL, NULL, NULL, "Configure level properties"
},
{
-1, -1,
GADGET_ID_LEVELINFO_EDITOR, GADGET_ID_LEVELINFO_LEVEL,
- 8, "Editor",
+ 8, "Editor",
NULL, NULL, NULL, "Configure editor properties"
},
{
ED_ELEMENT_TABS_XPOS(0), ED_ELEMENT_TABS_YPOS(0),
GADGET_ID_PROPERTIES_INFO, GADGET_ID_NONE,
- 8, "Info",
+ 8, "Info",
NULL, NULL, NULL, "Show information about element"
},
{
static void HandleDrawingAreaInfo(struct GadgetInfo *);
static void PrintEditorGadgetInfoText(struct GadgetInfo *);
static boolean AskToCopyAndModifyLevelTemplate();
+static boolean getDrawModeHiRes();
static int num_editor_gadgets = 0; /* dynamically determined */
setup_editor_el_more = FALSE;
setup_editor_el_sokoban = FALSE;
setup_editor_el_supaplex = FALSE;
+ setup_editor_el_diamond_caves = FALSE;
setup_editor_el_dx_boulderdash = FALSE;
setup_editor_el_mirror_magic = FALSE;
setup_editor_el_deflektor = FALSE;
void PrintEditorElementList()
{
- boolean *stop = &setup.editor.el_user_defined;
+ boolean *stop = &setup_editor_el_user_defined;
int i, j;
for (i = 0; editor_elements_info[i].setup_value != stop; i++)
struct GadgetInfo *gi = level_editor_gadget[selectbox_info[id].gadget_id];
int xoffset_left = getTextWidthForGadget(selectbox_info[id].text_left);
int xoffset_right = ED_GADGET_TEXT_DISTANCE;
+ int yoffset_above = font_height + ED_GADGET_LINE_DISTANCE;
int yoffset = (gi->height - font_height) / 2;
int x_left = gi->x - xoffset_left;
int x_right = gi->x + gi->width + xoffset_right;
+ int y_above = gi->y - yoffset_above;
+ int x = gi->x;
int y = gi->y + yoffset;
+ if (selectbox_info[id].text_above)
+ DrawText(x, y_above, selectbox_info[id].text_above, font_nr);
+
if (selectbox_info[id].text_left)
DrawText(x_left, y, selectbox_info[id].text_left, font_nr);
}
if (level_nr > leveldir_current->last_level)
- {
- static char *temp_levelinfo = NULL;
- FILE *temp_file = NULL;
- char line[MAX_LINE_LEN];
-
- setString(&temp_levelinfo,
- getPath2(getCurrentLevelDir(),
- getStringCat2(LEVELINFO_FILENAME, ".new")));
-
- if ((file = fopen(filename_levelinfo, MODE_READ)) &&
- (temp_file = fopen(temp_levelinfo, MODE_WRITE)))
- {
- while (fgets(line, MAX_LINE_LEN, file))
- {
- if (!strPrefix(line, "levels:"))
- fputs(line, temp_file);
- else
- fprintf(temp_file, "%-32s%d\n", "levels:", level_nr + 9);
- }
- }
-
- if (temp_file)
- fclose(temp_file);
-
- if (file)
- fclose(file);
-
- // needs error handling; also, ok on dos/win?
- unlink(filename_levelinfo);
- rename(temp_levelinfo, filename_levelinfo);
- }
+ UpdateUserLevelSet(getLoginName(), NULL, NULL, level_nr + 9, -1);
// else: allow the save even if annotation failed
return max_ed_fieldy;
}
-void InitZoomLevelSettings()
+void InitZoomLevelSettings(int zoom_tilesize)
{
+ if (zoom_tilesize == -1)
+ zoom_tilesize = setup.auto_setup.editor_zoom_tilesize;
+
+ // limit zoom tilesize by upper and lower bound
+ zoom_tilesize = MIN(MAX(MICRO_TILESIZE, zoom_tilesize), TILESIZE);
+
+ ed_tilesize = setup.auto_setup.editor_zoom_tilesize = zoom_tilesize;
+
MAX_ED_FIELDX = getMaxEdFieldX(FALSE);
MAX_ED_FIELDY = getMaxEdFieldY(FALSE);
}
ClearField();
- InitZoomLevelSettings();
+ InitZoomLevelSettings(-1);
OpenDoor(DOOR_OPEN_1 | DOOR_OPEN_2 | DOOR_NO_DELAY);
getTabulatorBarWidth(), getTabulatorBarHeight(), tab_color);
}
+static void PrintInfoText(char *text, int font_nr, int xpos, int ypos)
+{
+ DrawText(SX + xpos, SY + ypos, text, font_nr);
+}
+
+static int PrintElementDescriptionFromFile(char *filename, int font_nr,
+ int xpos, int ypos)
+{
+ int font_width = getFontWidth(font_nr);
+ int font_height = getFontHeight(font_nr);
+ int max_chars_per_line = (SXSIZE - 2 * xpos) / font_width;
+ int max_lines_drawable = (SYSIZE - ypos) / font_height - 1;
+
+ return DrawTextFile(SX + xpos, SY + ypos, filename, font_nr,
+ max_chars_per_line, -1, max_lines_drawable, 0, -1,
+ TRUE, FALSE, FALSE);
+}
+
static void DrawLevelInfoLevel()
{
int i;
MapTextAreaGadget(ED_TEXTAREA_ID_ENVELOPE_INFO);
}
-static void PrintInfoText(char *text, int font_nr, int xpos, int ypos)
-{
- DrawText(SX + xpos, SY + ypos, text, font_nr);
-}
-
-static int PrintElementDescriptionFromFile(char *filename, int font_nr,
- int xpos, int ypos)
-{
- int font_width = getFontWidth(font_nr);
- int font_height = getFontHeight(font_nr);
- int max_chars_per_line = (SXSIZE - 2 * xpos) / font_width;
- int max_lines_drawable = (SYSIZE - ypos) / font_height - 1;
-
- return DrawTextFile(SX + xpos, SY + ypos, filename, font_nr,
- max_chars_per_line, -1, max_lines_drawable, 0, -1,
- TRUE, FALSE, FALSE);
-}
-
static void DrawPropertiesInfo()
{
static struct
#define TEXT_CRACKING "Score for cracking"
#define TEXT_AMOEBA_SPEED "Speed of amoeba growth"
#define TEXT_DURATION "Duration when activated"
+#define TEXT_DELAY_ON "Delay before activating"
+#define TEXT_DELAY_OFF "Delay before deactivating"
+#define TEXT_DELAY_EXPLODING "Delay before exploding"
+#define TEXT_DELAY_MOVING "Delay before moving"
#define TEXT_BALL_DELAY "Element generation delay"
#define TEXT_MOVE_SPEED "Speed of android moving"
#define TEXT_CLONE_SPEED "Speed of android cloning"
{ EL_EMC_KEY_7, &level.score[SC_KEY], TEXT_COLLECTING },
{ EL_EMC_KEY_8, &level.score[SC_KEY], TEXT_COLLECTING },
{ EL_DC_KEY_WHITE, &level.score[SC_KEY], TEXT_COLLECTING },
+ { EL_MM_KETTLE, &level.score[SC_EMERALD], TEXT_COLLECTING },
+ { EL_DF_CELL, &level.score[SC_EMERALD], TEXT_COLLECTING },
+ { EL_MM_KEY, &level.score[SC_KEY], TEXT_COLLECTING },
+ { EL_MM_LIGHTBALL, &level.score[SC_ELEM_BONUS], TEXT_COLLECTING },
+ { EL_MM_PACMAN, &level.score[SC_PACMAN], TEXT_SMASHING },
+ { EL_MM_PACMAN_RIGHT, &level.score[SC_PACMAN], TEXT_SMASHING },
+ { EL_MM_PACMAN_UP, &level.score[SC_PACMAN], TEXT_SMASHING },
+ { EL_MM_PACMAN_LEFT, &level.score[SC_PACMAN], TEXT_SMASHING },
+ { EL_MM_PACMAN_DOWN, &level.score[SC_PACMAN], TEXT_SMASHING },
{ EL_AMOEBA_WET, &level.amoeba_speed, TEXT_AMOEBA_SPEED },
{ EL_AMOEBA_DRY, &level.amoeba_speed, TEXT_AMOEBA_SPEED },
{ EL_AMOEBA_FULL, &level.amoeba_speed, TEXT_AMOEBA_SPEED },
{ EL_SPRING, &level.slurp_score, TEXT_SLURPING },
{ EL_EMC_LENSES, &level.lenses_time, TEXT_DURATION },
{ EL_EMC_MAGNIFIER, &level.magnify_time, TEXT_DURATION },
-#if 0
- /* defined, but currently not used in MM engine */
- { EL_MM_FUSE_ACTIVE, &level.mm_time_fuse, TEXT_DURATION },
-#endif
+ { EL_MM_FUSE_ACTIVE, &level.mm_time_fuse, TEXT_DELAY_OFF },
+ { EL_MM_BOMB, &level.mm_time_bomb, TEXT_DELAY_EXPLODING },
+ { EL_MM_GRAY_BALL, &level.mm_time_ball, TEXT_DELAY_ON },
+ { EL_MM_STEEL_BLOCK, &level.mm_time_block, TEXT_DELAY_MOVING },
+ { EL_MM_WOODEN_BLOCK, &level.mm_time_block, TEXT_DELAY_MOVING },
{ -1, NULL, NULL }
};
if (IS_GEM(element) ||
IS_CUSTOM_ELEMENT(element) ||
IS_GROUP_ELEMENT(element) ||
+ IS_BALLOON_ELEMENT(element) ||
IS_ENVELOPE(element) ||
IS_MM_MCDUFFIN(element) ||
IS_DF_LASER(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_EDITOR_CONTENT(properties_element) ? 1 : 0);
+ IS_BALLOON_ELEMENT(properties_element) ||
+ HAS_EDITOR_CONTENT(properties_element) ? 1 : 0);
MapCheckbuttonGadget(ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID);
}
properties_element == EL_SOKOBAN_FIELD_FULL)
MapCheckbuttonGadget(ED_CHECKBUTTON_ID_AUTO_EXIT_SOKOBAN);
+ if (IS_BALLOON_ELEMENT(properties_element))
+ MapSelectboxGadget(ED_SELECTBOX_ID_WIND_DIRECTION);
+
if (IS_ENVELOPE(properties_element))
{
int counter1_id = ED_COUNTER_ID_ENVELOPE_XSIZE;
int sx = x - level_xpos;
int sy = y - level_ypos;
int old_element = Feld[x][y];
- unsigned int new_bitmask = (dx + 1) << (dy * 2);
+ int new_element = element;
+ unsigned int new_bitmask = (getDrawModeHiRes() ? (dx + 1) << (dy * 2) : 0x0f);
boolean draw_masked = FALSE;
if (IS_MM_WALL_EDITOR(element))
if (IN_ED_FIELD(sx, sy))
{
- if (draw_masked)
+ if (IS_MM_WALL(old_element) && new_element == EL_EMPTY)
+ DrawSizedWallParts_MM(sx, sy, EL_EMPTY, ed_tilesize, FALSE, new_bitmask);
+ else if (draw_masked)
DrawEditorElementThruMask(sx, sy, element);
else
DrawEditorElement(sx, sy, element);
/* also correct MM wall-sized (double) drawing area positions accordingly */
if (sx2 / 2 < sx || sx2 / 2 > sx)
{
- sx2 = sx * 2;
dx = (sx2 / 2 < sx ? 0 : 1);
+ sx2 = sx * 2 + dx;
}
if (sy2 / 2 < sy || sy2 / 2 > sy)
{
- sy2 = sy * 2;
dy = (sy2 / 2 < sy ? 0 : 1);
+ sy2 = sy * 2 + dy;
}
if (button_release_event)
}
else
{
+ SetDrawModeHiRes(new_element);
+
if (new_element == EL_PLAYER_1)
{
/* remove player at old position */
/* do not mark level as modified for certain non-level-changing gadgets */
if ((type_id >= ED_DRAWING_ID_EDITOR_FIRST &&
type_id <= ED_DRAWING_ID_EDITOR_LAST) ||
+ actual_drawing_function == GADGET_ID_GRAB_BRUSH ||
actual_drawing_function == GADGET_ID_PICK_ELEMENT)
return;
}
CopyElementPropertiesToGame(properties_element);
-
- level.changed = TRUE;
}
else if (type_id == ED_SELECTBOX_ID_GAME_ENGINE_TYPE)
{
ReinitializeElementList();
ModifyEditorElementList();
}
+
+ /* do not mark level as modified for certain non-level-changing gadgets */
+ if (type_id == ED_SELECTBOX_ID_SELECT_CHANGE_PAGE)
+ return;
+
+ level.changed = TRUE;
}
static void HandleTextbuttonGadgets(struct GadgetInfo *gi)
// limit zoom level by upper and lower bound
ed_tilesize = MIN(MAX(MICRO_TILESIZE, ed_tilesize), TILESIZE);
- InitZoomLevelSettings();
+ InitZoomLevelSettings(ed_tilesize);
if (edit_mode == ED_MODE_DRAWING)
{
PrintEditorGadgetInfoText(level_editor_gadget[id]);
}
+ /* save current editor zoom tilesize */
+ SaveSetup_AutoSetup();
+
break;
case GADGET_ID_CUSTOM_COPY_FROM: