Merge pull request #52916 from aaronfranke/no-default-env

Remove `default_env.tres` from generating in new projects
This commit is contained in:
Rémi Verschelde 2021-12-02 21:12:12 +01:00 committed by GitHub
commit 8bb0f2aff1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 27 deletions

View file

@ -1576,7 +1576,7 @@
Default background clear color. Overridable per [Viewport] using its [Environment]. See [member Environment.background_mode] and [member Environment.background_color] in particular. To change this default color programmatically, use [method RenderingServer.set_default_clear_color].
</member>
<member name="rendering/environment/defaults/default_environment" type="String" setter="" getter="" default="&quot;&quot;">
[Environment] that will be used as a fallback environment in case a scene does not specify its own environment. The default environment is loaded in at scene load time regardless of whether you have set an environment or not. If you do not rely on the fallback environment, it is best to delete [code]default_env.tres[/code], or to specify a different default environment here.
[Environment] that will be used as a fallback environment in case a scene does not specify its own environment. The default environment is loaded in at scene load time regardless of whether you have set an environment or not. If you do not rely on the fallback environment, you do not need to set this property.
</member>
<member name="rendering/environment/glow/upscale_mode" type="int" setter="" getter="" default="1">
Sets how the glow effect is upscaled before being copied onto the screen. Linear is faster, but looks blocky. Bicubic is slower but looks smooth.

View file

@ -102,7 +102,6 @@ private:
FileDialog *fdialog;
FileDialog *fdialog_install;
OptionButton *vcs_metadata_selection;
CheckBox *create_default_environment;
String zip_path;
String zip_title;
AcceptDialog *dialog_error;
@ -495,31 +494,10 @@ private:
initial_settings["application/config/name"] = project_name->get_text().strip_edges();
initial_settings["application/config/icon"] = "res://icon.png";
if (create_default_environment->is_pressed()) {
initial_settings["rendering/environment/defaults/default_environment"] = "res://default_env.tres";
}
if (ProjectSettings::get_singleton()->save_custom(dir.plus_file("project.godot"), initial_settings, Vector<String>(), false) != OK) {
set_message(TTR("Couldn't create project.godot in project path."), MESSAGE_ERROR);
} else {
ResourceSaver::save(dir.plus_file("icon.png"), create_unscaled_default_project_icon());
FileAccess *f;
if (create_default_environment->is_pressed()) {
f = FileAccess::open(dir.plus_file("default_env.tres"), FileAccess::WRITE);
if (!f) {
set_message(TTR("Couldn't create default_env.tres in project path."), MESSAGE_ERROR);
} else {
f->store_line("[gd_resource type=\"Environment\" load_steps=2 format=2]");
f->store_line("");
f->store_line("[sub_resource type=\"Sky\" id=\"1\"]");
f->store_line("");
f->store_line("[resource]");
f->store_line("background_mode = 2");
f->store_line("sky = SubResource( \"1\" )");
memdelete(f);
}
}
EditorVCSInterface::create_vcs_metadata_files(EditorVCSInterface::VCSMetadata(vcs_metadata_selection->get_selected()), dir);
}
} else if (mode == MODE_INSTALL) {
@ -945,10 +923,6 @@ public:
Control *spacer = memnew(Control);
spacer->set_h_size_flags(Control::SIZE_EXPAND_FILL);
default_files_container->add_child(spacer);
create_default_environment = memnew(CheckBox);
create_default_environment->set_text("Create Default Environment");
create_default_environment->set_pressed(true);
default_files_container->add_child(create_default_environment);
fdialog = memnew(FileDialog);
fdialog->set_access(FileDialog::ACCESS_FILESYSTEM);