diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-06 10:09:32 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-06 10:09:32 +0200 |
commit | d06a10c252b5a8440d47e8524fe7dff355591d3e (patch) | |
tree | 271c2cee23121bb2f7187a3a88214ea22c10fdd3 | |
parent | c01667abc07314da4bc291fb94106bf8cfd6b522 (diff) | |
parent | 151645a1b6f6c9851a1449d5eb944712fc0729ee (diff) | |
download | redot-engine-d06a10c252b5a8440d47e8524fe7dff355591d3e.tar.gz |
Merge pull request #96581 from Hilderin/fix-editor-layout-reset-on-startup
Fix editor layout reset on startup
-rw-r--r-- | editor/editor_node.cpp | 28 | ||||
-rw-r--r-- | editor/editor_node.h | 1 |
2 files changed, 15 insertions, 14 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index f154cbd1e2..6de9bfc4aa 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -5240,8 +5240,8 @@ void EditorNode::_copy_warning(const String &p_str) { } void EditorNode::_save_editor_layout() { - if (waiting_for_first_scan) { - return; // Scanning, do not touch docks. + if (!load_editor_layout_done) { + return; } Ref<ConfigFile> config; config.instantiate(); @@ -5297,22 +5297,22 @@ void EditorNode::_load_editor_layout() { if (overridden_default_layout >= 0) { _layout_menu_option(overridden_default_layout); } - return; - } - - ep.step(TTR("Loading docks..."), 1, true); - editor_dock_manager->load_docks_from_config(config, "docks"); + } else { + ep.step(TTR("Loading docks..."), 1, true); + editor_dock_manager->load_docks_from_config(config, "docks"); - ep.step(TTR("Reopening scenes..."), 2, true); - _load_open_scenes_from_config(config); + ep.step(TTR("Reopening scenes..."), 2, true); + _load_open_scenes_from_config(config); - ep.step(TTR("Loading central editor layout..."), 3, true); - _load_central_editor_layout_from_config(config); + ep.step(TTR("Loading central editor layout..."), 3, true); + _load_central_editor_layout_from_config(config); - ep.step(TTR("Loading plugin window layout..."), 4, true); - editor_data.set_plugin_window_layout(config); + ep.step(TTR("Loading plugin window layout..."), 4, true); + editor_data.set_plugin_window_layout(config); - ep.step(TTR("Editor layout ready."), 5, true); + ep.step(TTR("Editor layout ready."), 5, true); + } + load_editor_layout_done = true; } void EditorNode::_save_central_editor_layout_to_config(Ref<ConfigFile> p_config_file) { diff --git a/editor/editor_node.h b/editor/editor_node.h index e24bae73f0..ffffe87d51 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -462,6 +462,7 @@ private: bool requested_first_scan = false; bool waiting_for_first_scan = true; + bool load_editor_layout_done = false; int current_menu_option = 0; |