Skip to content

armgit / godot

Public Imported from GitHub
0

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

Fix deprecated build after dock changes

kobewi2e26ab8a3afb
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index c216bbf4950..cac853bd381 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -4442,9 +4442,11 @@ void EditorNode::replace_resources_in_scenes(const Vector<Ref<Resource>> &p_sour
}
void EditorNode::add_editor_plugin(EditorPlugin *p_editor, bool p_config_changed) {
+#ifndef DISABLE_DEPRECATED
if (p_editor->has_main_screen()) {
singleton->editor_main_screen->add_main_plugin(p_editor);
}
+#endif
singleton->editor_data.add_editor_plugin(p_editor);
singleton->add_child(p_editor);
if (p_config_changed) {
@@ -4453,9 +4455,11 @@ void EditorNode::add_editor_plugin(EditorPlugin *p_editor, bool p_config_changed
}
void EditorNode::remove_editor_plugin(EditorPlugin *p_editor, bool p_config_changed) {
+#ifndef DISABLE_DEPRECATED
if (p_editor->has_main_screen()) {
singleton->editor_main_screen->remove_main_plugin(p_editor);
}
+#endif
p_editor->make_visible(false);
p_editor->clear();
if (p_config_changed) {
diff --git a/editor/run/game_view_plugin.cpp b/editor/run/game_view_plugin.cpp
index cee9bcead74..de5dc9289c2 100644
--- a/editor/run/game_view_plugin.cpp
+++ b/editor/run/game_view_plugin.cpp
@@ -1829,7 +1829,10 @@ void GameViewPluginBase::_focus_another_editor() {
if (last_editor.is_empty() || (last_editor == "Script" && ScriptEditor::get_singleton()->get_current_layout() == EditorDock::DOCK_LAYOUT_FLOATING)) {
CanvasItemEditor::get_singleton()->make_visible();
} else {
- EditorInterface::get_singleton()->set_main_screen_editor(last_editor);
+ EditorDock *last_dock = EditorDockManager::get_singleton()->get_dock_by_name(last_editor);
+ if (last_dock && last_dock->get_current_layout() == EditorDock::DOCK_LAYOUT_MAIN_SCREEN) {
+ last_dock->make_visible();
+ }
}
}
}