From 601a110ec856abbcb698d9f73394f805cd00e2db Mon Sep 17 00:00:00 2001 From: Dan Boorstein Date: Fri, 8 Apr 2022 08:39:04 -0800 Subject: [PATCH] Update main screen plugin tutorial for 4.0 changes (#5749) --- tutorials/plugins/editor/making_main_screen_plugins.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tutorials/plugins/editor/making_main_screen_plugins.rst b/tutorials/plugins/editor/making_main_screen_plugins.rst index 655d88b71..e0362fb66 100644 --- a/tutorials/plugins/editor/making_main_screen_plugins.rst +++ b/tutorials/plugins/editor/making_main_screen_plugins.rst @@ -53,7 +53,7 @@ Add five extra methods such that the script looks like this: func _get_plugin_icon(): - return get_editor_interface().get_base_control().get_icon("Node", "EditorIcons") + return get_editor_interface().get_base_control().get_theme_icon("Node", "EditorIcons") The important part in this script is the ``_has_main_screen()`` function, which is overloaded so it returns ``true``. This function is automatically @@ -108,7 +108,7 @@ Here is the full plugin script: func _enter_tree(): - main_panel_instance = MainPanel.instance() + main_panel_instance = MainPanel.instantiate() # Add the main panel to the editor's main viewport. get_editor_interface().get_editor_main_control().add_child(main_panel_instance) # Hide the main panel. Very much required. @@ -135,7 +135,7 @@ Here is the full plugin script: func _get_plugin_icon(): # Must return some kind of Texture for the icon. - return get_editor_interface().get_base_control().get_icon("Node", "EditorIcons") + return get_editor_interface().get_base_control().get_theme_icon("Node", "EditorIcons") A couple of specific lines were added. ``MainPanel`` is a constant that holds a reference to the scene, and we instance it into `main_panel_instance`.