From: Holger Schemel Date: Fri, 8 Jan 2021 16:08:16 +0000 (+0100) Subject: added option to disable warning about read-only levels when entering editor X-Git-Tag: 4.2.2.1~5 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=bc84d4e4ec1babe815cb9e5b07168afa232bffb5 added option to disable warning about read-only levels when entering editor --- diff --git a/src/files.c b/src/files.c index 49ed450e..e9634c5e 100644 --- a/src/files.c +++ b/src/files.c @@ -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; diff --git a/src/libgame/system.h b/src/libgame/system.h index ce239f1d..0ec8a491 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1284,6 +1284,8 @@ struct SetupEditorInfo boolean show_element_token; + boolean show_read_only_warning; + boolean use_template_for_new_levels; }; diff --git a/src/screens.c b/src/screens.c index 5254a19f..d596e267 100644 --- a/src/screens.c +++ b/src/screens.c @@ -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 }