static void HandleControlButtons(struct GadgetInfo *);
static void HandleDrawingAreaInfo(struct GadgetInfo *);
static void PrintEditorGadgetInfoText(struct GadgetInfo *);
+static boolean AskToCopyAndModifyLevelTemplate();
static int num_editor_gadgets = 0; /* dynamically determined */
static boolean CopyCustomElement(int element_old, int element_new,
int copy_mode)
{
+ int copy_mode_orig = copy_mode;
+
if (copy_mode == GADGET_ID_CUSTOM_COPY)
{
element_new = (IS_CUSTOM_ELEMENT(element_old) ?
level.changed = TRUE;
}
+ /* when modifying custom/group element, ask for copying level template */
+ if (copy_mode_orig != GADGET_ID_CUSTOM_COPY && level.use_custom_template)
+ {
+ if (!AskToCopyAndModifyLevelTemplate())
+ return FALSE;
+ }
+
if (copy_mode == GADGET_ID_CUSTOM_COPY_FROM)
{
copy_custom_element_settings(element_new, element_old);
CopyClassicElementPropertiesToEditor(element);
}
-static void AskToCopyAndModifyLevelTemplate()
+static boolean AskToCopyAndModifyLevelTemplate()
{
if (Request("Copy and modify level template?", REQ_ASK))
{
ModifyGadget(level_editor_gadget[GADGET_ID_CUSTOM_USE_TEMPLATE],
GDI_CHECKED, FALSE, GDI_END);
+
+ return TRUE;
}
else
{
LoadLevelTemplate(-1); /* this resets all element modifications ... */
DrawEditModeWindow(); /* ... and copies them to 'custom_element' */
+
+ return FALSE;
}
}