| 3714 | } |
| 3715 | |
| 3716 | void ScriptEditor::get_window_layout(Ref<ConfigFile> p_layout) { |
| 3717 | Array scripts; |
| 3718 | Array helps; |
| 3719 | String selected_script; |
| 3720 | for (int i = 0; i < tab_container->get_tab_count(); i++) { |
| 3721 | ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(tab_container->get_tab_control(i)); |
| 3722 | if (se) { |
| 3723 | String path = se->get_edited_resource()->get_path(); |
| 3724 | if (!path.is_resource_file()) { |
| 3725 | continue; |
| 3726 | } |
| 3727 | |
| 3728 | if (tab_container->get_current_tab_control() == tab_container->get_tab_control(i)) { |
| 3729 | selected_script = path; |
| 3730 | } |
| 3731 | |
| 3732 | _save_editor_state(se); |
| 3733 | scripts.push_back(path); |
| 3734 | } |
| 3735 | |
| 3736 | EditorHelp *eh = Object::cast_to<EditorHelp>(tab_container->get_tab_control(i)); |
| 3737 | |
| 3738 | if (eh) { |
| 3739 | helps.push_back(eh->get_class()); |
| 3740 | } |
| 3741 | } |
| 3742 | |
| 3743 | p_layout->set_value("ScriptEditor", "open_scripts", scripts); |
| 3744 | p_layout->set_value("ScriptEditor", "selected_script", selected_script); |
| 3745 | p_layout->set_value("ScriptEditor", "open_help", helps); |
| 3746 | p_layout->set_value("ScriptEditor", "script_split_offset", script_split->get_split_offset()); |
| 3747 | p_layout->set_value("ScriptEditor", "list_split_offset", list_split->get_split_offset()); |
| 3748 | p_layout->set_value("ScriptEditor", "zoom_factor", zoom_factor); |
| 3749 | |
| 3750 | // Save the cache. |
| 3751 | script_editor_cache->save(EditorPaths::get_singleton()->get_project_settings_dir().path_join("script_editor_cache.cfg")); |
| 3752 | } |
| 3753 | |
| 3754 | void ScriptEditor::_help_class_open(const String &p_class) { |
| 3755 | if (p_class.is_empty()) { |
nothing calls this directly
no test coverage detected