projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2ad91a1
)
fixed bug with asking to 'discard changes and use level template' if there were no...
author
Holger Schemel
<info@artsoft.org>
Fri, 27 Jan 2017 19:38:51 +0000
(20:38 +0100)
committer
Holger Schemel
<info@artsoft.org>
Fri, 27 Jan 2017 19:39:09 +0000
(20:39 +0100)
src/editor.c
patch
|
blob
|
history
diff --git
a/src/editor.c
b/src/editor.c
index b5aa6fb3c900f905c0a13b9d3c48f88ebcd75e9a..51ac61b211851e76e42e70c09e7c91661510d0b2 100644
(file)
--- a/
src/editor.c
+++ b/
src/editor.c
@@
-11534,6
+11534,15
@@
static void HandleCheckbuttons(struct GadgetInfo *gi)
}
else if (type_id == ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE)
{
}
else if (type_id == ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE)
{
+ boolean template_related_changes_found = FALSE;
+ int i;
+
+ /* check if any custom or group elements have been changed */
+ for (i = 0; i < NUM_FILE_ELEMENTS; i++)
+ if ((IS_CUSTOM_ELEMENT(i) || IS_GROUP_ELEMENT(i)) &&
+ element_info[i].modified_settings)
+ template_related_changes_found = TRUE;
+
if (level.use_custom_template &&
!fileExists(getGlobalLevelTemplateFilename()))
{
if (level.use_custom_template &&
!fileExists(getGlobalLevelTemplateFilename()))
{
@@
-11547,6
+11556,7
@@
static void HandleCheckbuttons(struct GadgetInfo *gi)
}
if (level.use_custom_template &&
}
if (level.use_custom_template &&
+ template_related_changes_found &&
!Request("Discard changes and use level template?", REQ_ASK))
{
level.use_custom_template = FALSE;
!Request("Discard changes and use level template?", REQ_ASK))
{
level.use_custom_template = FALSE;