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

Method get_window_layout

editor/script/script_editor_plugin.cpp:3716–3752  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3714}
3715
3716void 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
3754void ScriptEditor::_help_class_open(const String &p_class) {
3755 if (p_class.is_empty()) {

Callers

nothing calls this directly

Calls 15

get_tab_controlMethod · 0.80
is_resource_fileMethod · 0.80
get_split_offsetMethod · 0.80
path_joinMethod · 0.80
get_window_enabledMethod · 0.80
get_window_rectMethod · 0.80
get_window_screenMethod · 0.80
has_section_keyMethod · 0.80
erase_section_keyMethod · 0.80
get_tab_countMethod · 0.45

Tested by

no test coverage detected