| 433 | } |
| 434 | |
| 435 | void EditorDebuggerNode::_update_errors() { |
| 436 | int error_count = 0; |
| 437 | int warning_count = 0; |
| 438 | _for_all(tabs, [&](ScriptEditorDebugger *dbg) { |
| 439 | error_count += dbg->get_error_count(); |
| 440 | warning_count += dbg->get_warning_count(); |
| 441 | }); |
| 442 | |
| 443 | if (error_count != last_error_count || warning_count != last_warning_count) { |
| 444 | _for_all(tabs, [&](ScriptEditorDebugger *dbg) { |
| 445 | dbg->update_tabs(); |
| 446 | }); |
| 447 | |
| 448 | if (error_count == 0 && warning_count == 0) { |
| 449 | debugger_button->set_text(TTR("Debugger")); |
| 450 | debugger_button->remove_theme_color_override(SceneStringName(font_color)); |
| 451 | debugger_button->set_button_icon(Ref<Texture2D>()); |
| 452 | } else { |
| 453 | debugger_button->set_text(TTR("Debugger") + " (" + itos(error_count + warning_count) + ")"); |
| 454 | if (error_count >= 1 && warning_count >= 1) { |
| 455 | debugger_button->set_button_icon(get_editor_theme_icon(SNAME("ErrorWarning"))); |
| 456 | // Use error color to represent the highest level of severity reported. |
| 457 | debugger_button->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("error_color"), EditorStringName(Editor))); |
| 458 | } else if (error_count >= 1) { |
| 459 | debugger_button->set_button_icon(get_editor_theme_icon(SNAME("Error"))); |
| 460 | debugger_button->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("error_color"), EditorStringName(Editor))); |
| 461 | } else { |
| 462 | debugger_button->set_button_icon(get_editor_theme_icon(SNAME("Warning"))); |
| 463 | debugger_button->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("warning_color"), EditorStringName(Editor))); |
| 464 | } |
| 465 | } |
| 466 | last_error_count = error_count; |
| 467 | last_warning_count = warning_count; |
| 468 | } |
| 469 | } |
| 470 | |
| 471 | void EditorDebuggerNode::_debugger_stopped(int p_id) { |
| 472 | ScriptEditorDebugger *dbg = get_debugger(p_id); |
nothing calls this directly
no test coverage detected