diff options
Diffstat (limited to 'doc/classes/EditorPlugin.xml')
-rw-r--r-- | doc/classes/EditorPlugin.xml | 50 |
1 files changed, 35 insertions, 15 deletions
diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index b8436be76a..8df6d721d4 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -7,7 +7,7 @@ Plugins are used by the editor to extend functionality. The most common types of plugins are those which edit a given node or resource type, import plugins and export plugins. See also [EditorScript] to add functions to the editor. </description> <tutorials> - <link title="Editor plugins tutorial index">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/index.html</link> + <link title="Editor plugins documentation index">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/index.html</link> </tutorials> <methods> <method name="_apply_changes" qualifiers="virtual"> @@ -96,7 +96,7 @@ </description> </method> <method name="_forward_3d_gui_input" qualifiers="virtual"> - <return type="bool" /> + <return type="int" /> <argument index="0" name="viewport_camera" type="Camera3D" /> <argument index="1" name="event" type="InputEvent" /> <description> @@ -105,13 +105,13 @@ [gdscript] # Prevents the InputEvent to reach other Editor classes. func _forward_3d_gui_input(camera, event): - return true + return EditorPlugin.AFTER_GUI_INPUT_STOP [/gdscript] [csharp] // Prevents the InputEvent to reach other Editor classes. public override bool _Forward3dGuiInput(Camera3D camera, InputEvent @event) { - return true; + return EditorPlugin.AFTER_GUI_INPUT_STOP; } [/csharp] [/codeblocks] @@ -185,12 +185,12 @@ 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 [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example: [codeblocks] [gdscript] - # Prevents the InputEvent to reach other Editor classes + # Prevents the InputEvent to reach other Editor classes. func _forward_canvas_gui_input(event): return true [/gdscript] [csharp] - // Prevents the InputEvent to reach other Editor classes + // Prevents the InputEvent to reach other Editor classes. public override bool ForwardCanvasGuiInput(InputEvent @event) { return true; @@ -202,13 +202,18 @@ [gdscript] # Consumes InputEventMouseMotion and forwards other InputEvent types. func _forward_canvas_gui_input(event): - return event is InputEventMouseMotion + if (event is InputEventMouseMotion): + return true + return false [/gdscript] [csharp] // Consumes InputEventMouseMotion and forwards other InputEvent types. public override bool ForwardCanvasGuiInput(InputEvent @event) { - return @event is InputEventMouseMotion; + if (@event is InputEventMouseMotion) { + return true; + } + return false } [/csharp] [/codeblocks] @@ -376,7 +381,7 @@ <argument index="0" name="importer" type="EditorImportPlugin" /> <description> Registers a new [EditorImportPlugin]. Import plugins are used to import custom and unsupported assets as a custom [Resource] type. - [b]Note:[/b] If you want to import custom 3D asset formats use [method add_scene_import_plugin] instead. + [b]Note:[/b] If you want to import custom 3D asset formats use [method add_scene_format_importer_plugin] instead. See [method add_inspector_plugin] for an example of how to register a plugin. </description> </method> @@ -400,11 +405,18 @@ [/codeblocks] </description> </method> - <method name="add_scene_import_plugin"> + <method name="add_scene_format_importer_plugin"> + <return type="void" /> + <argument index="0" name="scene_format_importer" type="EditorSceneFormatImporter" /> + <description> + Registers a new [EditorSceneFormatImporter]. Scene importers are used to import custom 3D asset formats as scenes. + </description> + </method> + <method name="add_scene_post_import_plugin"> <return type="void" /> - <argument index="0" name="scene_importer" type="EditorSceneImporter" /> + <argument index="0" name="scene_import_plugin" type="EditorScenePostImportPlugin" /> <description> - Registers a new [EditorSceneImporter]. Scene importers are used to import custom 3D asset formats as scenes. + Add a [EditorScenePostImportPlugin]. These plugins allow customizing the import process of 3D assets by adding new options to the import dialogs. </description> </method> <method name="add_spatial_gizmo_plugin"> @@ -457,6 +469,7 @@ <description> Gets the Editor's dialogue used for making scripts. [b]Note:[/b] Users can configure it before use. + [b]Warning:[/b] Removing and freeing this node will render a part of the editor useless and may cause a crash. </description> </method> <method name="get_undo_redo"> @@ -548,11 +561,18 @@ Removes an inspector plugin registered by [method add_import_plugin] </description> </method> - <method name="remove_scene_import_plugin"> + <method name="remove_scene_format_importer_plugin"> + <return type="void" /> + <argument index="0" name="scene_format_importer" type="EditorSceneFormatImporter" /> + <description> + Removes a scene format importer registered by [method add_scene_format_importer_plugin]. + </description> + </method> + <method name="remove_scene_post_import_plugin"> <return type="void" /> - <argument index="0" name="scene_importer" type="EditorSceneImporter" /> + <argument index="0" name="scene_import_plugin" type="EditorScenePostImportPlugin" /> <description> - Removes a scene importer registered by [method add_scene_import_plugin]. + Remove the [EditorScenePostImportPlugin], added with [method add_scene_post_import_plugin]. </description> </method> <method name="remove_spatial_gizmo_plugin"> |