diff options
Diffstat (limited to 'editor/dependency_editor.cpp')
-rw-r--r-- | editor/dependency_editor.cpp | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp index f9f1e455f5..bde73e9268 100644 --- a/editor/dependency_editor.cpp +++ b/editor/dependency_editor.cpp @@ -225,9 +225,9 @@ void DependencyEditor::edit(const String &p_path) { popup_centered_ratio(); if (EditorNode::get_singleton()->is_scene_open(p_path)) { - EditorNode::get_singleton()->show_warning(vformat(TTR("Scene '%s' is currently being edited.\nChanges will not take effect unless reloaded."), p_path.get_file())); + EditorNode::get_singleton()->show_warning(vformat(TTR("Scene '%s' is currently being edited.\nChanges will only take effect when reloaded."), p_path.get_file())); } else if (ResourceCache::has(p_path)) { - EditorNode::get_singleton()->show_warning(vformat(TTR("Resource '%s' is in use.\nChanges will take effect when reloaded."), p_path.get_file())); + EditorNode::get_singleton()->show_warning(vformat(TTR("Resource '%s' is in use.\nChanges will only take effect when reloaded."), p_path.get_file())); } } @@ -475,7 +475,6 @@ void DependencyRemoveDialog::show(const Vector<String> &p_folders, const Vector< Vector<RemovedDependency> removed_deps; _find_all_removed_dependencies(EditorFileSystem::get_singleton()->get_filesystem(), removed_deps); removed_deps.sort(); - if (removed_deps.empty()) { owners->hide(); text->set_text(TTR("Remove selected files from the project? (no undo)")); @@ -486,6 +485,7 @@ void DependencyRemoveDialog::show(const Vector<String> &p_folders, const Vector< text->set_text(TTR("The files being removed are required by other resources in order for them to work.\nRemove them anyway? (no undo)")); popup_centered_minsize(Size2(500, 350)); } + EditorFileSystem::get_singleton()->scan_changes(); } void DependencyRemoveDialog::ok_pressed() { @@ -496,10 +496,32 @@ void DependencyRemoveDialog::ok_pressed() { res->set_path(""); } - // If the file we are deleting is the main scene, clear its definition. + // If the file we are deleting for e.g. the main scene, default environment, + // or audio bus layout, we must clear its definition in Project Settings. + if (files_to_delete[i] == ProjectSettings::get_singleton()->get("application/config/icon")) { + ProjectSettings::get_singleton()->set("application/config/icon", ""); + } if (files_to_delete[i] == ProjectSettings::get_singleton()->get("application/run/main_scene")) { ProjectSettings::get_singleton()->set("application/run/main_scene", ""); } + if (files_to_delete[i] == ProjectSettings::get_singleton()->get("application/boot_splash/image")) { + ProjectSettings::get_singleton()->set("application/boot_splash/image", ""); + } + if (files_to_delete[i] == ProjectSettings::get_singleton()->get("rendering/environment/default_environment")) { + ProjectSettings::get_singleton()->set("rendering/environment/default_environment", ""); + } + if (files_to_delete[i] == ProjectSettings::get_singleton()->get("display/mouse_cursor/custom_image")) { + ProjectSettings::get_singleton()->set("display/mouse_cursor/custom_image", ""); + } + if (files_to_delete[i] == ProjectSettings::get_singleton()->get("gui/theme/custom")) { + ProjectSettings::get_singleton()->set("gui/theme/custom", ""); + } + if (files_to_delete[i] == ProjectSettings::get_singleton()->get("gui/theme/custom_font")) { + ProjectSettings::get_singleton()->set("gui/theme/custom_font", ""); + } + if (files_to_delete[i] == ProjectSettings::get_singleton()->get("audio/default_bus_layout")) { + ProjectSettings::get_singleton()->set("audio/default_bus_layout", ""); + } String path = OS::get_singleton()->get_resource_dir() + files_to_delete[i].replace_first("res://", "/"); print_verbose("Moving to trash: " + path); |