| 608 | } |
| 609 | |
| 610 | void ScriptEditor::_clear_breakpoints() { |
| 611 | for (int i = 0; i < tab_container->get_tab_count(); i++) { |
| 612 | ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(tab_container->get_tab_control(i)); |
| 613 | if (se) { |
| 614 | se->clear_breakpoints(); |
| 615 | } |
| 616 | } |
| 617 | |
| 618 | // Clear from closed scripts. |
| 619 | Vector<String> cached_editors = script_editor_cache->get_sections(); |
| 620 | for (const String &E : cached_editors) { |
| 621 | Array breakpoints = _get_cached_breakpoints_for_script(E); |
| 622 | for (int breakpoint : breakpoints) { |
| 623 | EditorDebuggerNode::get_singleton()->set_breakpoint(E, (int)breakpoint + 1, false); |
| 624 | } |
| 625 | |
| 626 | if (breakpoints.size() > 0) { |
| 627 | Dictionary state = script_editor_cache->get_value(E, "state"); |
| 628 | state["breakpoints"] = Array(); |
| 629 | script_editor_cache->set_value(E, "state", state); |
| 630 | } |
| 631 | } |
| 632 | } |
| 633 | |
| 634 | Array ScriptEditor::_get_cached_breakpoints_for_script(const String &p_path) const { |
| 635 | if (!ResourceLoader::exists(p_path, "Script") || p_path.begins_with("local://") || !script_editor_cache->has_section_key(p_path, "state")) { |
nothing calls this directly
no test coverage detected