X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Feditor.c;h=cee0cd43918f6df4893d245f1a354154fcab4acd;hb=8e17da8cdff134bfa0e766a50f408a3c06428f54;hp=e3d3370ec4526fa94f8b48c6ce88548ca4c82ddd;hpb=d7673e6d995a9d6616f7eaefab6209e6eb60a795;p=rocksndiamonds.git diff --git a/src/editor.c b/src/editor.c index e3d3370e..cee0cd43 100644 --- a/src/editor.c +++ b/src/editor.c @@ -1026,7 +1026,7 @@ static struct 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, @@ -1034,7 +1034,7 @@ static struct 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, @@ -1042,7 +1042,7 @@ static struct "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, @@ -2003,7 +2003,7 @@ static struct /* ---------- 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, @@ -2011,7 +2011,7 @@ static struct 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, @@ -2019,7 +2019,7 @@ static struct "game engine:", NULL, "game engine" }, { - ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(12), + ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(10), GADGET_ID_WIND_DIRECTION, GADGET_ID_NONE, -1, options_wind_direction, @@ -2402,6 +2402,8 @@ static struct 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; @@ -2411,6 +2413,8 @@ static struct ED_SCROLLBAR_XPOS, ED_SCROLLBAR_YPOS, SX + ED_SCROLL_HORIZONTAL_XPOS, SY + ED_SCROLL_HORIZONTAL_YPOS, ED_SCROLL_HORIZONTAL_XSIZE, ED_SCROLL_HORIZONTAL_YSIZE, + 0, 0, + SX + SXSIZE + SX, WIN_YSIZE, GD_TYPE_SCROLLBAR_HORIZONTAL, GADGET_ID_SCROLL_HORIZONTAL, "scroll level editing area horizontally" @@ -2419,6 +2423,8 @@ static struct ED_SCROLLBAR_XPOS, ED_SCROLLBAR_YPOS, SX + ED_SCROLL_VERTICAL_XPOS, SY + ED_SCROLL_VERTICAL_YPOS, ED_SCROLL_VERTICAL_XSIZE, ED_SCROLL_VERTICAL_YSIZE, + 0, 0, + SX + SXSIZE + SX, WIN_YSIZE, GD_TYPE_SCROLLBAR_VERTICAL, GADGET_ID_SCROLL_VERTICAL, "scroll level editing area vertically" @@ -2427,6 +2433,8 @@ static struct ED_SCROLLBAR2_XPOS, ED_SCROLLBAR2_YPOS, DX + ED_SCROLL2_VERTICAL_XPOS, DY + ED_SCROLL2_VERTICAL_YPOS, ED_SCROLL2_VERTICAL_XSIZE, ED_SCROLL2_VERTICAL_YSIZE, + SX + SXSIZE + SX, 0, + WIN_XSIZE - (SX + SXSIZE + SX), WIN_YSIZE, GD_TYPE_SCROLLBAR_VERTICAL, GADGET_ID_SCROLL_LIST_VERTICAL, "scroll element list vertically" @@ -3451,16 +3459,6 @@ static int editor_el_emerald_mine_club[] = EL_EMC_WALL_11, EL_EMC_WALL_12, - EL_EMC_ANDROID, - EL_BALLOON, - EL_BALLOON_SWITCH_ANY, - EL_BALLOON_SWITCH_NONE, - - 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, @@ -3476,10 +3474,20 @@ static int editor_el_emerald_mine_club[] = 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_YAMYAM_UP, + EL_BALLOON_SWITCH_RIGHT, + + EL_EMC_ANDROID, EL_YAMYAM_DOWN, + EL_BALLOON_SWITCH_DOWN, + EL_BALLOON_SWITCH_NONE, #else @@ -4618,8 +4626,23 @@ static int editor_el_custom[] = EL_CUSTOM_START + 252, EL_CUSTOM_START + 253, EL_CUSTOM_START + 254, - EL_CUSTOM_START + 255, + EL_CUSTOM_START + 255 +}; +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_reference[] = +{ + EL_INTERNAL_CASCADE_REF_ACTIVE, + EL_CHAR('R'), + EL_CHAR('E'), + EL_CHAR('F') +}; +static int editor_el_reference[] = +{ EL_TRIGGER_PLAYER, EL_TRIGGER_ELEMENT, EL_TRIGGER_CE_VALUE, @@ -4630,10 +4653,10 @@ static int editor_el_custom[] = EL_CURRENT_CE_VALUE, EL_CURRENT_CE_SCORE }; -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_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_group[] = { @@ -4856,6 +4879,12 @@ editor_elements_info[] = &editor_hl_custom_ptr, &num_editor_hl_custom, &editor_el_custom_ptr, &num_editor_el_custom }, + { + &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_custom, &setup.editor_cascade.el_ge, @@ -6119,6 +6148,10 @@ static void CreateScrollbarGadgets() 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, @@ -9261,11 +9294,20 @@ static void SetTextCursor(int unused_sx, int unused_sy, int sx, int sy, 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) @@ -9298,10 +9340,7 @@ static void CopyLevelToUndoBuffer(int 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; } @@ -10187,7 +10226,12 @@ static void HandleControlButtons(struct GadgetInfo *gi) 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: