Jelajahi Sumber

Color error and warning lines in the editor debugger's Errors panel

This improves readability when some errors/warnings are unfolded,
as their stack traces will keep their original colors.
Hugo Locurcio 4 tahun lalu
induk
melakukan
1e4967968f
1 mengubah file dengan 4 tambahan dan 0 penghapusan
  1. 4 0
      editor/script_editor_debugger.cpp

+ 4 - 0
editor/script_editor_debugger.cpp

@@ -916,6 +916,10 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
 		error->set_text(0, time);
 		error->set_text(0, time);
 		error->set_text_align(0, TreeItem::ALIGN_LEFT);
 		error->set_text_align(0, TreeItem::ALIGN_LEFT);
 
 
+		const Color color = get_color(is_warning ? "warning_color" : "error_color", "Editor");
+		error->set_custom_color(0, color);
+		error->set_custom_color(1, color);
+
 		String error_title;
 		String error_title;
 		// Include method name, when given, in error title.
 		// Include method name, when given, in error title.
 		if (has_method) {
 		if (has_method) {