MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _update_errors

Method _update_errors

editor/debugger/editor_debugger_node.cpp:435–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

433}
434
435void 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
471void EditorDebuggerNode::_debugger_stopped(int p_id) {
472 ScriptEditorDebugger *dbg = get_debugger(p_id);

Callers

nothing calls this directly

Calls 10

_for_allFunction · 0.85
TTRFunction · 0.85
itosFunction · 0.85
get_error_countMethod · 0.80
get_warning_countMethod · 0.80
update_tabsMethod · 0.80
set_button_iconMethod · 0.80
set_textMethod · 0.45

Tested by

no test coverage detected