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);
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)
void CopyBrushToClipboard(void);
void CopyBrushToClipboard_Small(void);
+void UndoLevelEditorOperation(void);
+void RedoLevelEditorOperation(void);
+
#endif
{
CopyClipboardToBrush();
}
+ else if (letter == 'z') // undo or redo last operation
+ {
+ if (GetKeyModState() & KMOD_Shift)
+ RedoLevelEditorOperation();
+ else
+ UndoLevelEditorOperation();
+ }
}
}