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

Method _load_editor_layout

editor/editor_node.cpp:5746–5783  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5744}
5745
5746void EditorNode::_load_editor_layout() {
5747 EditorProgress ep("loading_editor_layout", TTR("Loading editor"), 5);
5748 ep.step(TTR("Loading editor layout..."), 0, true);
5749 Ref<ConfigFile> config;
5750 config.instantiate();
5751 Error err = config->load(EditorPaths::get_singleton()->get_project_settings_dir().path_join("editor_layout.cfg"));
5752 if (err != OK) { // No config.
5753 // If config is not found, expand the res:// folder and favorites by default.
5754 TreeItem *root = FileSystemDock::get_singleton()->get_tree_control()->get_item_with_metadata("res://", 0);
5755 if (root) {
5756 root->set_collapsed(false);
5757 }
5758
5759 TreeItem *favorites = FileSystemDock::get_singleton()->get_tree_control()->get_item_with_metadata("Favorites", 0);
5760 if (favorites) {
5761 favorites->set_collapsed(false);
5762 }
5763
5764 if (overridden_default_layout >= 0) {
5765 _layout_menu_option(overridden_default_layout);
5766 }
5767 } else {
5768 ep.step(TTR("Loading docks..."), 1, true);
5769 editor_dock_manager->load_docks_from_config(config, "docks", true);
5770
5771 ep.step(TTR("Reopening scenes..."), 2, true);
5772 _load_open_scenes_from_config(config);
5773
5774 ep.step(TTR("Loading central editor layout..."), 3, true);
5775 _load_central_editor_layout_from_config(config);
5776
5777 ep.step(TTR("Loading plugin window layout..."), 4, true);
5778 editor_data.set_plugin_window_layout(config);
5779
5780 ep.step(TTR("Editor layout ready."), 5, true);
5781 }
5782 load_editor_layout_done = true;
5783}
5784
5785void EditorNode::_save_central_editor_layout_to_config(Ref<ConfigFile> p_config_file) {
5786 // Bottom panel.

Callers

nothing calls this directly

Calls 11

TTRFunction · 0.85
path_joinMethod · 0.80
get_tree_controlMethod · 0.80
stepMethod · 0.45
instantiateMethod · 0.45
loadMethod · 0.45
set_collapsedMethod · 0.45

Tested by

no test coverage detected