Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Store `show_files_panel` per `ScriptEditor`

Simon Döhle6a36c17e3b6
diff --git a/editor/script/script_editor_plugin.cpp b/editor/script/script_editor_plugin.cpp
index da5b695e3d3..4f5e4143373 100644
--- a/editor/script/script_editor_plugin.cpp
+++ b/editor/script/script_editor_plugin.cpp
@@ -2261,7 +2261,7 @@ void DocumentEditorContainer::_close_builtin_scripts_from_scene(const String &p_
void DocumentEditorContainer::_toggle_files_pressed(bool p_pressed) {
ERR_FAIL_NULL(list_split);
list_split->set_visible(p_pressed);
- EditorSettings::get_singleton()->set_project_metadata("files_panel", "show_files_panel", list_split->is_visible());
+ EditorSettings::get_singleton()->set_project_metadata("show_files_panel", config_section, list_split->is_visible());
}
void DocumentEditorContainer::edited_scene_changed() {
@@ -4073,7 +4073,17 @@ DocumentEditorContainer::DocumentEditorContainer(bool p_is_main_editor, const St
toggle_files_button->set_shortcut_context(this);
toggle_files_button->set_shortcut(ED_GET_SHORTCUT("script_editor/toggle_files_panel"));
menu_hb->add_child(toggle_files_button);
- bool initial_state = EditorSettings::get_singleton()->get_project_metadata("files_panel", "show_files_panel", true);
+#ifndef DISABLE_DEPRECATED
+ EditorSettings *es = EditorSettings::get_singleton();
+ if (es && es->get_project_metadata("files_panel", "show_files_panel", "") != "") {
+ bool show_files_panel = es->get_project_metadata("files_panel", "show_files_panel", true);
+ es->set_project_metadata("show_files_panel", "ScriptEditor", show_files_panel);
+ es->set_project_metadata("show_files_panel", "ShaderEditor", show_files_panel);
+ es->set_project_metadata("files_panel", "show_files_panel", Variant());
+ es->save_project_metadata();
+ }
+#endif
+ bool initial_state = EditorSettings::get_singleton()->get_project_metadata("show_files_panel", config_section, true);
toggle_files_button->set_pressed_no_signal(initial_state);
_toggle_files_pressed(initial_state);