X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Feditor.c;h=7bc6dcd7bcaaa71674b799b08fc1fb64c0fb76ee;hb=cc87512c58b885ea16697b0017201c900fce8428;hp=8d8d9c629d2e3aaeb72d231f45ed0ca00c02d171;hpb=41e90530481fced8d11cd1f55c78bc07d66e5120;p=rocksndiamonds.git diff --git a/src/editor.c b/src/editor.c index 8d8d9c62..7bc6dcd7 100644 --- a/src/editor.c +++ b/src/editor.c @@ -688,6 +688,7 @@ enum GADGET_ID_DF_LASER_GREEN, GADGET_ID_DF_LASER_BLUE, GADGET_ID_ROTATE_MM_BALL_CONTENT, + GADGET_ID_EXPLODE_MM_BALL, GADGET_ID_CUSTOM_INDESTRUCTIBLE, GADGET_ID_CUSTOM_CAN_EXPLODE, GADGET_ID_CUSTOM_EXPLODE_FIRE, @@ -1002,6 +1003,7 @@ enum ED_CHECKBUTTON_ID_DF_LASER_GREEN, ED_CHECKBUTTON_ID_DF_LASER_BLUE, ED_CHECKBUTTON_ID_ROTATE_MM_BALL_CONTENT, + ED_CHECKBUTTON_ID_EXPLODE_MM_BALL, ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC, ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE_1, ED_CHECKBUTTON_ID_CUSTOM_ACCESSIBLE, @@ -3387,6 +3389,13 @@ static struct NULL, NULL, "randomly rotate created content", "randomly rotate newly created content" }, + { + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(6), + GADGET_ID_EXPLODE_MM_BALL, GADGET_ID_NONE, + &level.explode_mm_ball, + NULL, NULL, + "explode ball instead of melting", "use explosion to release ball content" + }, // ---------- element settings: configure 1 (custom elements) --------------- @@ -10148,6 +10157,7 @@ static void DrawPropertiesConfig(void) MapCounterButtons(ED_COUNTER_ID_MM_BALL_CONTENT); MapSelectboxGadget(ED_SELECTBOX_ID_MM_BALL_CHOICE_MODE); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_ROTATE_MM_BALL_CONTENT); + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_EXPLODE_MM_BALL); DrawMMBallContentArea(); } @@ -11126,7 +11136,7 @@ static void MergeAndCloseNeighbourElements(int x1, int y1, int *element1, SetElementSimple(x2, y2, *element2, change_level); } -static void SetElementIntelliDraw(int x, int y, int new_element, +static void SetElementIntelliDraw(int x, int y, int dx, int dy, int new_element, boolean change_level, int button) { struct XY *xy = xy_directions; @@ -11898,7 +11908,10 @@ static void SetElementIntelliDraw(int x, int y, int new_element, } } - SetElementSimple(x, y, new_element, change_level); + if (IS_MM_WALL_EDITOR(new_element)) + SetElementSimpleExt(x, y, dx, dy, new_element, change_level); + else + SetElementSimple(x, y, new_element, change_level); last_x = x; last_y = y; @@ -11912,7 +11925,7 @@ static void ResetIntelliDraw(void) for (y = 0; y < lev_fieldy; y++) IntelliDrawBuffer[x][y] = Tile[x][y]; - SetElementIntelliDraw(-1, -1, EL_UNDEFINED, FALSE, -1); + SetElementIntelliDraw(-1, -1, -1, -1, EL_UNDEFINED, FALSE, -1); } static boolean draw_mode_hires = FALSE; @@ -11954,8 +11967,8 @@ static void SetElementExt(int x, int y, int dx, int dy, int element, { if (element < 0) SetElementSimple(x, y, Tile[x][y], change_level); - else if (GetKeyModState() & KMOD_Shift && !IS_MM_WALL_EDITOR(element)) - SetElementIntelliDraw(x, y, element, change_level, button); + else if (GetKeyModState() & KMOD_Shift) + SetElementIntelliDraw(x, y, dx, dy, element, change_level, button); else SetElementSimpleExt(x, y, dx, dy, element, change_level); } @@ -12996,6 +13009,10 @@ static void CopyLevelTemplateToUserLevelSet(char *levelset_subdir) static void HandleDrawingAreas(struct GadgetInfo *gi) { static boolean started_inside_drawing_area = FALSE; + static int last_sx = -1; + static int last_sy = -1; + static int last_sx2 = -1; + static int last_sy2 = -1; int id = gi->custom_id; int type_id = gi->custom_type_id; boolean button_press_event; @@ -13059,10 +13076,6 @@ static void HandleDrawingAreas(struct GadgetInfo *gi) if (!button_press_event && !button_release_event) { - static int last_sx = -1; - static int last_sy = -1; - static int last_sx2 = -1; - static int last_sy2 = -1; int old_element = (IN_LEV_FIELD(lx, ly) ? Tile[lx][ly] : EL_UNDEFINED); boolean hires_drawing = (level.game_engine_type == GAME_ENGINE_TYPE_MM && isHiresTileElement(old_element) && @@ -13072,13 +13085,13 @@ static void HandleDrawingAreas(struct GadgetInfo *gi) if ((sx == last_sx && sy == last_sy && !hires_drawing) || (sx2 == last_sx2 && sy2 == last_sy2)) return; - - last_sx = sx; - last_sy = sy; - last_sx2 = sx2; - last_sy2 = sy2; } + last_sx = sx; + last_sy = sy; + last_sx2 = sx2; + last_sy2 = sy2; + if (button_press_event) started_inside_drawing_area = inside_drawing_area;