Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
68d73ecf
Unverified
Commit
68d73ecf
authored
Mar 02, 2020
by
Aaron Franke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document EditorPlugin get_plugin_icon and get_plugin_name
The return value's type hint is now accurate.
parent
e89754fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
EditorPlugin.xml
doc/classes/EditorPlugin.xml
+13
-1
editor_plugin.cpp
editor/editor_plugin.cpp
+1
-1
No files found.
doc/classes/EditorPlugin.xml
View file @
68d73ecf
...
...
@@ -267,15 +267,27 @@
</description>
</method>
<method
name=
"get_plugin_icon"
qualifiers=
"virtual"
>
<return
type=
"
Object
"
>
<return
type=
"
Texture2D
"
>
</return>
<description>
Override this method in your plugin to return a [Texture2D] in order to give it an icon.
For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", and "AssetLib" buttons.
Ideally, the plugin icon should be white with a transparent background and 16x16 pixels in size.
[codeblock]
func get_plugin_icon():
# You can use a custom icon:
return preload("res://addons/my_plugin/my_plugin_icon.svg")
# Or use a built-in icon:
return get_editor_interface().get_base_control().get_icon("Node", "EditorIcons")
[/codeblock]
</description>
</method>
<method
name=
"get_plugin_name"
qualifiers=
"virtual"
>
<return
type=
"String"
>
</return>
<description>
Override this method in your plugin to provide the name of the plugin when displayed in the Godot editor.
For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", and "AssetLib" buttons.
</description>
</method>
<method
name=
"get_script_create_dialog"
>
...
...
editor/editor_plugin.cpp
View file @
68d73ecf
...
...
@@ -862,7 +862,7 @@ void EditorPlugin::_bind_methods() {
ClassDB
::
add_virtual_method
(
get_class_static
(),
MethodInfo
(
"forward_canvas_force_draw_over_viewport"
,
PropertyInfo
(
Variant
::
OBJECT
,
"overlay"
,
PROPERTY_HINT_RESOURCE_TYPE
,
"Control"
)));
ClassDB
::
add_virtual_method
(
get_class_static
(),
MethodInfo
(
Variant
::
BOOL
,
"forward_spatial_gui_input"
,
PropertyInfo
(
Variant
::
OBJECT
,
"camera"
,
PROPERTY_HINT_RESOURCE_TYPE
,
"Camera"
),
PropertyInfo
(
Variant
::
OBJECT
,
"event"
,
PROPERTY_HINT_RESOURCE_TYPE
,
"InputEvent"
)));
ClassDB
::
add_virtual_method
(
get_class_static
(),
MethodInfo
(
Variant
::
STRING
,
"get_plugin_name"
));
ClassDB
::
add_virtual_method
(
get_class_static
(),
MethodInfo
(
Variant
::
OBJECT
,
"get_plugin_icon"
));
ClassDB
::
add_virtual_method
(
get_class_static
(),
MethodInfo
(
PropertyInfo
(
Variant
::
OBJECT
,
"icon"
,
PROPERTY_HINT_RESOURCE_TYPE
,
"Texture2D"
)
,
"get_plugin_icon"
));
ClassDB
::
add_virtual_method
(
get_class_static
(),
MethodInfo
(
Variant
::
BOOL
,
"has_main_screen"
));
ClassDB
::
add_virtual_method
(
get_class_static
(),
MethodInfo
(
"make_visible"
,
PropertyInfo
(
Variant
::
BOOL
,
"visible"
)));
ClassDB
::
add_virtual_method
(
get_class_static
(),
MethodInfo
(
"edit"
,
PropertyInfo
(
Variant
::
OBJECT
,
"object"
)));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment