X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Feditor.c;h=b99d33b774407537563726f03fe56b876f2d2247;hp=8175781421f3343dedb2b4023e599eb7ef5f943f;hb=77c74cbf7569a65f71e004fab915a8b6ee73cbed;hpb=b8c8e7bc29ef6a79d7c71d8a785bf1b77e44fc0a diff --git a/src/editor.c b/src/editor.c index 81757814..b99d33b7 100644 --- a/src/editor.c +++ b/src/editor.c @@ -8325,6 +8325,9 @@ static void CopyCustomElementPropertiesToGame(int element) // copy change events also to special level editor variable custom_element = element_info[element]; custom_element_change = *element_info[element].change; + + // needed here to restore runtime value "element_info[element].gfx_element" + InitElementPropertiesGfxElement(); } static void CopyGroupElementPropertiesToGame(int element) @@ -12355,6 +12358,16 @@ void CopyBrushToClipboard_Small(void) CopyBrushExt(0, 0, 0, 0, 0, CB_BRUSH_TO_CLIPBOARD_SMALL); } +void UndoLevelEditorOperation(void) +{ + ClickOnGadget(level_editor_gadget[GADGET_ID_UNDO], -1); +} + +void RedoLevelEditorOperation(void) +{ + ClickOnGadget(level_editor_gadget[GADGET_ID_UNDO], 3); +} + static void FloodFill(int from_x, int from_y, int fill_element) { FloodFillLevel(from_x, from_y, fill_element, Feld, lev_fieldx, lev_fieldy); @@ -13820,7 +13833,9 @@ static void HandleControlButtons(struct GadgetInfo *gi) break; case GADGET_ID_UNDO: - if (button == 1 && GetKeyModState() & (KMOD_Shift|KMOD_Control)) + if (button < 0) // keep button value (even if modifier keys are pressed) + button = -button; + else if (button == 1 && GetKeyModState() & (KMOD_Shift | KMOD_Control)) button = 3; if (button == 1 && undo_buffer_steps == 0)