浏览代码

Fix saving editor folder colors

Also clears setting if none are assigned
A Thousand Ships 2 年之前
父节点
当前提交
1083ce4466
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      editor/filesystem_dock.cpp

+ 6 - 0
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());