added request dialog before using level template (currently always asking)
authorHolger Schemel <info@artsoft.org>
Wed, 25 Jan 2017 23:26:50 +0000 (00:26 +0100)
committerHolger Schemel <info@artsoft.org>
Wed, 25 Jan 2017 23:26:50 +0000 (00:26 +0100)
src/editor.c

index 507f9c3b71cfc71ed8a446898a57c26e3a42cfc7..48e6feb0b41bed5abdcba92af917cd2d3e2173b1 100644 (file)
@@ -11513,6 +11513,16 @@ static void HandleCheckbuttons(struct GadgetInfo *gi)
       return;
     }
 
+    if (level.use_custom_template &&
+       !Request("Discard changes and use level template?", REQ_ASK))
+    {
+      level.use_custom_template = FALSE;
+
+      ModifyGadget(gi, GDI_CHECKED, FALSE, GDI_END);
+
+      return;
+    }
+
     LoadLevelTemplate(level.use_custom_template ? -1 : level_nr);
 
     DrawEditModeWindow();