summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-04-05 16:44:40 +0200
committerGitHub <noreply@github.com>2019-04-05 16:44:40 +0200
commit769b2ba385ac83ce1eeee3df31572635cd539a79 (patch)
tree5343038404905e111324c0e777980e045d6afcd5
parentfc081ebe103f9e68c20f944934c6edb78ea20354 (diff)
parent4cee053f7c562d94cee2ab8e65fc33fb9024b2f7 (diff)
Merge pull request #26930 from qarmin/fix_delete_project_settings_properties
Fix deleting properties after deleting files
-rw-r--r--editor/dependency_editor.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp
index f559eb6cb2..5c35a91fea 100644
--- a/editor/dependency_editor.cpp
+++ b/editor/dependency_editor.cpp
@@ -496,14 +496,28 @@ void DependencyRemoveDialog::ok_pressed() {
res->set_path("");
}
- // If the file we are deleting is the main scene or default environment, clear its definition.
+ // If the file we are deleting for e.g. the main scene or default environment, 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", "");
+ }
String path = OS::get_singleton()->get_resource_dir() + files_to_delete[i].replace_first("res://", "/");
print_verbose("Moving to trash: " + path);