From 1083ce4466a99e8bdf8f3dca8bda055c66f539a6 Mon Sep 17 00:00:00 2001 From: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Tue, 5 Sep 2023 16:42:31 +0200 Subject: [PATCH] Fix saving editor folder colors Also clears setting if none are assigned --- editor/filesystem_dock.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 3c010112ad..deebf5e368 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -2794,6 +2794,12 @@ void FileSystemDock::_folder_color_index_pressed(int p_index, PopupMenu *p_menu) } } + if (!ProjectSettings::get_singleton()->has_setting("file_customization/folder_colors")) { + ProjectSettings::get_singleton()->set_setting("file_customization/folder_colors", assigned_folder_colors); + } else if (assigned_folder_colors.is_empty()) { + ProjectSettings::get_singleton()->set_setting("file_customization/folder_colors", Variant()); + } + ProjectSettings::get_singleton()->save(); _update_tree(get_uncollapsed_paths());