diff options
| author | William Tumeo <tumeowilliam@gmail.com> | 2018-09-21 00:14:04 -0300 |
|---|---|---|
| committer | William Tumeo <tumeowilliam@gmail.com> | 2018-10-02 15:41:16 -0300 |
| commit | 62218ea41b785378176334bb9a6eef79d7286441 (patch) | |
| tree | a4a45f38fdb387fdf2e666952af1c2fe3930308f /editor/editor_node.cpp | |
| parent | d9e88bccbea11189b9ea1437d4a48266b69aaf27 (diff) | |
| download | redot-engine-62218ea41b785378176334bb9a6eef79d7286441.tar.gz | |
Editor: Skip loading main scene if restore_scenes_on_load is used
Diffstat (limited to 'editor/editor_node.cpp')
| -rw-r--r-- | editor/editor_node.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 03746fb8b7..a4c1964515 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -3592,6 +3592,7 @@ void EditorNode::_load_docks() { _load_docks_from_config(config, "docks"); _load_open_scenes_from_config(config, "EditorNode"); + editor_data.set_plugin_window_layout(config); } @@ -3786,6 +3787,23 @@ void EditorNode::_load_open_scenes_from_config(Ref<ConfigFile> p_layout, const S restoring_scenes = false; } +bool EditorNode::has_scenes_in_session() { + if (!bool(EDITOR_GET("interface/scene_tabs/restore_scenes_on_load"))) { + return false; + } + Ref<ConfigFile> config; + config.instance(); + Error err = config->load(EditorSettings::get_singleton()->get_project_settings_dir().plus_file("editor_layout.cfg")); + if (err != OK) { + return false; + } + if (!config->has_section("EditorNode") || !config->has_section_key("EditorNode", "open_scenes")) { + return false; + } + Array scenes = config->get_value("EditorNode", "open_scenes"); + return !scenes.empty(); +} + void EditorNode::_update_layouts_menu() { editor_layouts->clear(); |
