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 49ed450ee1a8da045e2ba4be474aaa7c9f5da455..e9634c5e03b3c833818ac8eaf60929852c5ca843 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 ce239f1d3a5c2ead14c370d2c3edd8546ed3b462..0ec8a491bb113cb185891f8caf038d49e9d548ea 100644 (file)
@@ -1284,6 +1284,8 @@ struct SetupEditorInfo
 
   boolean show_element_token;
 
+  boolean show_read_only_warning;
+
   boolean use_template_for_new_levels;
 };
 
index 5254a19fca9b2be1394bce4afd64e0984f18ffcb..d596e2674eaa13c9ce9265d0b6562b4b04cc9b51 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                    }