diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml index fd478216733f..4a9b3b8b510b 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -1134,19 +1134,11 @@ - [b]Auto (based on screen size)[/b] (default) will automatically choose how to launch the Play window based on the device and screen metrics. Defaults to [b]Same as Editor[/b] on phones and [b]Side-by-side with Editor[/b] on tablets. - [b]Same as Editor[/b] will launch the Play window in the same window as the Editor. - [b]Side-by-side with Editor[/b] will launch the Play window side-by-side with the Editor window. - - [b]Launch in PiP mode[/b] will launch the Play window directly in picture-in-picture (PiP) mode if PiP mode is supported and enabled. When maximized, the Play window will occupy the same window as the Editor. [b]Note:[/b] Only available in the Android editor. Overrides game embedding setting for all newly opened projects. If enabled, game embedding settings are not saved. - - Specifies the picture-in-picture (PiP) mode for the Play window. - - [b]Disabled:[/b] PiP is disabled for the Play window. - - [b]Enabled:[/b] If the device supports it, PiP is always enabled for the Play window. The Play window will contain a button to enter PiP mode. - - [b]Enabled when Play window is same as Editor[/b] (default for Android editor): If the device supports it, PiP is enabled when the Play window is the same as the Editor. The Play window will contain a button to enter PiP mode. - [b]Note:[/b] Only available in the Android editor. - The window mode to use to display the project when starting the project from the editor. [b]Note:[/b] Game embedding is not available for "Force Maximized" or "Force Fullscreen." diff --git a/editor/editor_main_screen.cpp b/editor/editor_main_screen.cpp index dfc1152d17ec..fdd4615c33f6 100644 --- a/editor/editor_main_screen.cpp +++ b/editor/editor_main_screen.cpp @@ -228,6 +228,11 @@ EditorPlugin *EditorMainScreen::get_selected_plugin() const { return selected_plugin; } +EditorPlugin *EditorMainScreen::get_plugin_by_name(const String &p_plugin_name) const { + ERR_FAIL_COND_V(!main_editor_plugins.has(p_plugin_name), nullptr); + return main_editor_plugins[p_plugin_name]; +} + VBoxContainer *EditorMainScreen::get_control() const { return main_screen_vbox; } @@ -254,6 +259,7 @@ void EditorMainScreen::add_main_plugin(EditorPlugin *p_editor) { buttons.push_back(tb); button_hb->add_child(tb); editor_table.push_back(p_editor); + main_editor_plugins.insert(p_editor->get_plugin_name(), p_editor); } void EditorMainScreen::remove_main_plugin(EditorPlugin *p_editor) { @@ -280,6 +286,7 @@ void EditorMainScreen::remove_main_plugin(EditorPlugin *p_editor) { } editor_table.erase(p_editor); + main_editor_plugins.erase(p_editor->get_plugin_name()); } EditorMainScreen::EditorMainScreen() { diff --git a/editor/editor_main_screen.h b/editor/editor_main_screen.h index ca78ceaa8850..06bf2f7aaf2e 100644 --- a/editor/editor_main_screen.h +++ b/editor/editor_main_screen.h @@ -58,6 +58,7 @@ class EditorMainScreen : public PanelContainer { HBoxContainer *button_hb = nullptr; Vector