summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-07-18 11:21:13 +0200
committerGitHub <noreply@github.com>2022-07-18 11:21:13 +0200
commit2c6707cb02750e8e9991a9a5192d85a126edfad3 (patch)
treef4c3c89a2aeaf259b8277e58dcc8000e6fbed456 /doc/classes
parentdfc76dc26dc9412b0467131997e6b8ffdbe4ff02 (diff)
parent058c1eac25eeef98e77bc938acfd9dda6ff05de5 (diff)
Merge pull request #63134 from KoBeWi/plugin4screen
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/EditorPlugin.xml22
1 files changed, 22 insertions, 0 deletions
diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml
index 1514b82ff8..2930c2ec22 100644
--- a/doc/classes/EditorPlugin.xml
+++ b/doc/classes/EditorPlugin.xml
@@ -296,6 +296,28 @@
<return type="bool" />
<description>
Returns [code]true[/code] if this is a main screen editor plugin (it goes in the workspace selector together with [b]2D[/b], [b]3D[/b], [b]Script[/b] and [b]AssetLib[/b]).
+ When the plugin's workspace is selected, other main screen plugins will be hidden, but your plugin will not appear automatically. It needs to be added as a child of [method EditorInterface.get_base_control] and made visible inside [method _make_visible].
+ Use [method _get_plugin_name] and [method _get_plugin_icon] to customize the plugin button's appearance.
+ [codeblock]
+ var plugin_control
+
+ func _enter_tree():
+ plugin_control = preload("my_plugin_control.tscn").instantiate()
+ get_editor_interface().get_editor_main_control().add_child(plugin_control)
+ plugin_control.hide()
+
+ func _has_main_screen():
+ return true
+
+ func _make_visible(visible):
+ plugin_control.visible = visible
+
+ func _get_plugin_name():
+ return "My Super Cool Plugin 3000"
+
+ func _get_plugin_icon():
+ return get_editor_interface().get_base_control().get_theme_icon("Node", "EditorIcons")
+ [/codeblock]
</description>
</method>
<method name="_make_visible" qualifiers="virtual">