diff options
Diffstat (limited to 'doc/classes/EditorPlugin.xml')
-rw-r--r-- | doc/classes/EditorPlugin.xml | 62 |
1 files changed, 52 insertions, 10 deletions
diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index 563987e2a3..326c4f6456 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -41,6 +41,7 @@ <param index="0" name="object" type="Variant" /> <description> This function is used for plugins that edit specific object types (nodes or resources). It requests the editor to edit the given object. + [param object] can be [code]null[/code] if the plugin was editing an object, but there is no longer any selected object handled by this plugin. It can be used to cleanup editing state. </description> </method> <method name="_enable_plugin" qualifiers="virtual"> @@ -100,7 +101,8 @@ <param index="0" name="viewport_camera" type="Camera3D" /> <param index="1" name="event" type="InputEvent" /> <description> - Called when there is a root node in the current edited scene, [method _handles] is implemented, and an [InputEvent] happens in the 3D viewport. The return value decides whether the [InputEvent] is consumed or forwarded to other [EditorPlugin]s. See [enum AfterGUIInput] for options. Example: + Called when there is a root node in the current edited scene, [method _handles] is implemented, and an [InputEvent] happens in the 3D viewport. The return value decides whether the [InputEvent] is consumed or forwarded to other [EditorPlugin]s. See [enum AfterGUIInput] for options. + [b]Example:[/b] [codeblocks] [gdscript] # Prevents the InputEvent from reaching other Editor classes. @@ -115,7 +117,8 @@ } [/csharp] [/codeblocks] - Must [code]return EditorPlugin.AFTER_GUI_INPUT_PASS[/code] in order to forward the [InputEvent] to other Editor classes. Example: + Must [code]return EditorPlugin.AFTER_GUI_INPUT_PASS[/code] in order to forward the [InputEvent] to other Editor classes. + [b]Example:[/b] [codeblocks] [gdscript] # Consumes InputEventMouseMotion and forwards other InputEvent types. @@ -141,7 +144,7 @@ [gdscript] func _forward_canvas_draw_over_viewport(overlay): # Draw a circle at cursor position. - overlay.draw_circle(overlay.get_local_mouse_position(), 64, Color.white) + overlay.draw_circle(overlay.get_local_mouse_position(), 64, Color.WHITE) func _forward_canvas_gui_input(event): if event is InputEventMouseMotion: @@ -182,7 +185,8 @@ <return type="bool" /> <param index="0" name="event" type="InputEvent" /> <description> - Called when there is a root node in the current edited scene, [method _handles] is implemented and an [InputEvent] happens in the 2D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [param event], otherwise forwards [param event] to other Editor classes. Example: + Called when there is a root node in the current edited scene, [method _handles] is implemented and an [InputEvent] happens in the 2D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [param event], otherwise forwards [param event] to other Editor classes. + [b]Example:[/b] [codeblocks] [gdscript] # Prevents the InputEvent from reaching other Editor classes. @@ -197,7 +201,8 @@ } [/csharp] [/codeblocks] - Must [code]return false[/code] in order to forward the [InputEvent] to other Editor classes. Example: + Must [code]return false[/code] in order to forward the [InputEvent] to other Editor classes. + [b]Example:[/b] [codeblocks] [gdscript] # Consumes InputEventMouseMotion and forwards other InputEvent types. @@ -343,7 +348,7 @@ [codeblock] func _set_state(data): zoom = data.get("zoom", 1.0) - preferred_color = data.get("my_color", Color.white) + preferred_color = data.get("my_color", Color.WHITE) [/codeblock] </description> </method> @@ -355,7 +360,7 @@ [codeblock] func _set_window_layout(configuration): $Window.position = configuration.get_value("MyPlugin", "window_position", Vector2()) - $Icon.modulate = configuration.get_value("MyPlugin", "icon_color", Color.white) + $Icon.modulate = configuration.get_value("MyPlugin", "icon_color", Color.WHITE) [/codeblock] </description> </method> @@ -411,7 +416,7 @@ </method> <method name="add_debugger_plugin"> <return type="void" /> - <param index="0" name="script" type="Script" /> + <param index="0" name="script" type="EditorDebuggerPlugin" /> <description> Adds a [Script] as debugger plugin to the Debugger. The script must extend [EditorDebuggerPlugin]. </description> @@ -463,6 +468,14 @@ See [method add_inspector_plugin] for an example of how to register a plugin. </description> </method> + <method name="add_resource_conversion_plugin"> + <return type="void" /> + <param index="0" name="plugin" type="EditorResourceConversionPlugin" /> + <description> + Registers a new [EditorResourceConversionPlugin]. Resource conversion plugins are used to add custom resource converters to the editor inspector. + See [EditorResourceConversionPlugin] for an example of how to create a resource conversion plugin. + </description> + </method> <method name="add_scene_format_importer_plugin"> <return type="void" /> <param index="0" name="scene_format_importer" type="EditorSceneFormatImporter" /> @@ -595,7 +608,7 @@ </method> <method name="remove_debugger_plugin"> <return type="void" /> - <param index="0" name="script" type="Script" /> + <param index="0" name="script" type="EditorDebuggerPlugin" /> <description> Removes the debugger plugin with given script from the Debugger. </description> @@ -628,6 +641,13 @@ Removes a gizmo plugin registered by [method add_node_3d_gizmo_plugin]. </description> </method> + <method name="remove_resource_conversion_plugin"> + <return type="void" /> + <param index="0" name="plugin" type="EditorResourceConversionPlugin" /> + <description> + Removes a resource conversion plugin registered by [method add_resource_conversion_plugin]. + </description> + </method> <method name="remove_scene_format_importer_plugin"> <return type="void" /> <param index="0" name="scene_format_importer" type="EditorSceneFormatImporter" /> @@ -660,7 +680,7 @@ <return type="void" /> <param index="0" name="callable" type="Callable" /> <description> - Removes a callback previsously added by [method add_undo_redo_inspector_hook_callback]. + Removes a callback previously added by [method add_undo_redo_inspector_hook_callback]. </description> </method> <method name="set_force_draw_over_forwarding_enabled"> @@ -691,11 +711,13 @@ </signal> <signal name="project_settings_changed"> <description> + Emitted when any project setting has changed. </description> </signal> <signal name="resource_saved"> <param index="0" name="resource" type="Resource" /> <description> + Emitted when the given [param resource] was saved on disc. </description> </signal> <signal name="scene_changed"> @@ -713,44 +735,64 @@ </signals> <constants> <constant name="CONTAINER_TOOLBAR" value="0" enum="CustomControlContainer"> + Main editor toolbar, next to play buttons. </constant> <constant name="CONTAINER_SPATIAL_EDITOR_MENU" value="1" enum="CustomControlContainer"> + The toolbar that appears when 3D editor is active. </constant> <constant name="CONTAINER_SPATIAL_EDITOR_SIDE_LEFT" value="2" enum="CustomControlContainer"> + Left sidebar of the 3D editor. </constant> <constant name="CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT" value="3" enum="CustomControlContainer"> + Right sidebar of the 3D editor. </constant> <constant name="CONTAINER_SPATIAL_EDITOR_BOTTOM" value="4" enum="CustomControlContainer"> + Bottom panel of the 3D editor. </constant> <constant name="CONTAINER_CANVAS_EDITOR_MENU" value="5" enum="CustomControlContainer"> + The toolbar that appears when 2D editor is active. </constant> <constant name="CONTAINER_CANVAS_EDITOR_SIDE_LEFT" value="6" enum="CustomControlContainer"> + Left sidebar of the 2D editor. </constant> <constant name="CONTAINER_CANVAS_EDITOR_SIDE_RIGHT" value="7" enum="CustomControlContainer"> + Right sidebar of the 2D editor. </constant> <constant name="CONTAINER_CANVAS_EDITOR_BOTTOM" value="8" enum="CustomControlContainer"> + Bottom panel of the 2D editor. </constant> <constant name="CONTAINER_INSPECTOR_BOTTOM" value="9" enum="CustomControlContainer"> + Bottom section of the inspector. </constant> <constant name="CONTAINER_PROJECT_SETTING_TAB_LEFT" value="10" enum="CustomControlContainer"> + Tab of Project Settings dialog, to the left of other tabs. </constant> <constant name="CONTAINER_PROJECT_SETTING_TAB_RIGHT" value="11" enum="CustomControlContainer"> + Tab of Project Settings dialog, to the right of other tabs. </constant> <constant name="DOCK_SLOT_LEFT_UL" value="0" enum="DockSlot"> + Dock slot, left side, upper-left (empty in default layout). </constant> <constant name="DOCK_SLOT_LEFT_BL" value="1" enum="DockSlot"> + Dock slot, left side, bottom-left (empty in default layout). </constant> <constant name="DOCK_SLOT_LEFT_UR" value="2" enum="DockSlot"> + Dock slot, left side, upper-right (in default layout includes Scene and Import docks). </constant> <constant name="DOCK_SLOT_LEFT_BR" value="3" enum="DockSlot"> + Dock slot, left side, bottom-right (in default layout includes FileSystem dock). </constant> <constant name="DOCK_SLOT_RIGHT_UL" value="4" enum="DockSlot"> + Dock slot, right side, upper-left (empty in default layout). </constant> <constant name="DOCK_SLOT_RIGHT_BL" value="5" enum="DockSlot"> + Dock slot, right side, bottom-left (empty in default layout). </constant> <constant name="DOCK_SLOT_RIGHT_UR" value="6" enum="DockSlot"> + Dock slot, right side, upper-right (in default layout includes Inspector, Node and History docks). </constant> <constant name="DOCK_SLOT_RIGHT_BR" value="7" enum="DockSlot"> + Dock slot, right side, bottom-right (empty in default layout). </constant> <constant name="DOCK_SLOT_MAX" value="8" enum="DockSlot"> Represents the size of the [enum DockSlot] enum. |