From: Holger Schemel Date: Thu, 26 Jan 2017 21:07:44 +0000 (+0100) Subject: fixed bug with not warning on add/delete/paste of CE change pages when using level... X-Git-Tag: 4.0.0.2~21 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=bd43ed6d58b80faf3c927dc6f3a41284676d25d7;p=rocksndiamonds.git fixed bug with not warning on add/delete/paste of CE change pages when using level template --- diff --git a/src/editor.c b/src/editor.c index 49073d30..25b7af27 100644 --- a/src/editor.c +++ b/src/editor.c @@ -11418,6 +11418,10 @@ static void HandleTextbuttonGadgets(struct GadgetInfo *gi) { struct ElementInfo *ei = &element_info[properties_element]; + /* when modifying custom element, ask for copying level template */ + if (level.use_custom_template && !AskToCopyAndModifyLevelTemplate()) + return; + setElementChangePages(ei, ei->num_change_pages + 1); /* set new change page to be new current change page */ @@ -11435,6 +11439,10 @@ static void HandleTextbuttonGadgets(struct GadgetInfo *gi) { struct ElementInfo *ei = &element_info[properties_element]; + /* when modifying custom element, ask for copying level template */ + if (level.use_custom_template && !AskToCopyAndModifyLevelTemplate()) + return; + /* copy all change pages after change page to be deleted */ for (i = ei->current_change_page; i < ei->num_change_pages - 1; i++) ei->change_page[i] = ei->change_page[i + 1]; @@ -11474,10 +11482,16 @@ static void HandleGraphicbuttonGadgets(struct GadgetInfo *gi) int current_change_page = ei->current_change_page; if (type_id == ED_GRAPHICBUTTON_ID_COPY_CHANGE_PAGE) + { element_info[EL_INTERNAL_CLIPBOARD_CHANGE].change_page[0] = ei->change_page[current_change_page]; + } else if (type_id == ED_GRAPHICBUTTON_ID_PASTE_CHANGE_PAGE) { + /* when modifying custom element, ask for copying level template */ + if (level.use_custom_template && !AskToCopyAndModifyLevelTemplate()) + return; + ei->change_page[current_change_page] = element_info[EL_INTERNAL_CLIPBOARD_CHANGE].change_page[0];