added option to disable warning about read-only levels when entering editor
authorHolger Schemel <info@artsoft.org>
Fri, 8 Jan 2021 16:08:16 +0000 (17:08 +0100)
committerHolger Schemel <info@artsoft.org>
Fri, 8 Jan 2021 16:08:16 +0000 (17:08 +0100)
src/files.c
src/libgame/system.h
src/screens.c

index 49ed450..e9634c5 100644 (file)
@@ -8747,6 +8747,10 @@ static struct TokenInfo editor_setup_tokens[] =
     TYPE_SWITCH,
     &setup.editor.show_element_token,          "editor.show_element_token"
   },
+  {
+    TYPE_SWITCH,
+    &setup.editor.show_read_only_warning,      "editor.show_read_only_warning"
+  },
 };
 
 static struct TokenInfo editor_cascade_setup_tokens[] =
@@ -9378,6 +9382,8 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
 
   si->editor.show_element_token                = FALSE;
 
+  si->editor.show_read_only_warning    = TRUE;
+
   si->editor.use_template_for_new_levels = TRUE;
 
   si->shortcut.save_game       = DEFAULT_KEY_SAVE_GAME;
index ce239f1..0ec8a49 100644 (file)
@@ -1284,6 +1284,8 @@ struct SetupEditorInfo
 
   boolean show_element_token;
 
+  boolean show_read_only_warning;
+
   boolean use_template_for_new_levels;
 };
 
index 5254a19..d596e26 100644 (file)
@@ -2168,7 +2168,7 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button)
       else if (pos == MAIN_CONTROL_EDITOR)
       {
        if (leveldir_current->readonly &&
-           !strEqual(setup.player_name, "Artsoft"))
+           setup.editor.show_read_only_warning)
          Request("This level is read-only!", REQ_CONFIRM);
 
        CloseDoor(DOOR_CLOSE_2);
@@ -6729,6 +6729,8 @@ static struct TokenInfo setup_info_editor[] =
 #endif
   { TYPE_SWITCH, &setup.editor.show_element_token,     "Show element token:" },
   { TYPE_EMPTY,                NULL,                   ""                      },
+  { TYPE_SWITCH, &setup.editor.show_read_only_warning, "Show read-only warning:" },
+  { TYPE_EMPTY,                NULL,                   ""                      },
   { TYPE_LEAVE_MENU,   execSetupMain,          "Back"                  },
 
   { 0,                 NULL,                   NULL                    }