diff options
Diffstat (limited to 'doc/classes/EditorPlugin.xml')
-rw-r--r-- | doc/classes/EditorPlugin.xml | 51 |
1 files changed, 48 insertions, 3 deletions
diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index 8dcffb0b74..6c40b7aa9d 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -91,7 +91,8 @@ <argument index="0" name="plugin" type="EditorExportPlugin"> </argument> <description> - Registers a new export plugin. Export plugins are used when the project is being exported. See [EditorExportPlugin] for more information. + Registers a new [EditorExportPlugin]. Export plugins are used to perform tasks when the project is being exported. + See [method add_inspector_plugin] for an example of how to register a plugin. </description> </method> <method name="add_import_plugin"> @@ -100,6 +101,9 @@ <argument index="0" name="importer" type="EditorImportPlugin"> </argument> <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. + See [method add_inspector_plugin] for an example of how to register a plugin. </description> </method> <method name="add_inspector_plugin"> @@ -108,6 +112,20 @@ <argument index="0" name="plugin" type="EditorInspectorPlugin"> </argument> <description> + Registers a new [EditorInspectorPlugin]. Inspector plugins are used to extend [EditorInspector] and provide custom configuration tools for your object's properties. + [b]Note:[/b] Always use [method remove_inspector_plugin] to remove the registered [EditorInspectorPlugin] when your [EditorPlugin] is disabled to prevent leaks and an unexpected behavior. + [codeblocks] + [gdscript] + const MyInspectorPlugin = preload("res://addons/your_addon/path/to/your/script.gd") + var inspector_plugin = MyInspectorPlugin.new() + + func _enter_tree(): + add_inspector_plugin(inspector_plugin) + + func _exit_tree(): + remove_inspector_plugin(inspector_plugin) + [/gdscript] + [/codeblocks] </description> </method> <method name="add_scene_import_plugin"> @@ -116,6 +134,7 @@ <argument index="0" name="scene_importer" type="EditorSceneImporter"> </argument> <description> + Registers a new [EditorSceneImporter]. Scene importers are used to import custom 3D asset formats as scenes. </description> </method> <method name="add_spatial_gizmo_plugin"> @@ -124,6 +143,8 @@ <argument index="0" name="plugin" type="EditorNode3DGizmoPlugin"> </argument> <description> + Registers a new [EditorNode3DGizmoPlugin]. Gizmo plugins are used to add custom gizmos to the 3D preview viewport for a [Node3D]. + See [method add_inspector_plugin] for an example of how to register a plugin. </description> </method> <method name="add_tool_menu_item"> @@ -157,6 +178,16 @@ Registers a custom translation parser plugin for extracting translatable strings from custom files. </description> </method> + <method name="add_undo_redo_inspector_hook_callback"> + <return type="void"> + </return> + <argument index="0" name="callable" type="Callable"> + </argument> + <description> + Hooks a callback into the undo/redo action creation when a property is modified in the inspector. This allows, for example, to save other properties that may be lost when a given property is modified. + The callback should have 4 arguments: [Object] [code]undo_redo[/code], [Object] [code]modified_object[/code], [String] [code]property[/code] and [Variant] [code]new_value[/code]. They are, respectively, the [UndoRedo] object used by the inspector, the currently modified object, the name of the modified property and the new value the property is about to take. + </description> + </method> <method name="apply_changes" qualifiers="virtual"> <return type="void"> </return> @@ -214,7 +245,7 @@ [gdscript] func forward_canvas_draw_over_viewport(overlay): # Draw a circle at cursor position. - overlay.draw_circle(overlay.get_local_mouse_position(), 64) + overlay.draw_circle(overlay.get_local_mouse_position(), 64, Color.white) func forward_canvas_gui_input(event): if event is InputEventMouseMotion: @@ -570,6 +601,7 @@ <argument index="0" name="plugin" type="EditorExportPlugin"> </argument> <description> + Removes an export plugin registered by [method add_export_plugin]. </description> </method> <method name="remove_import_plugin"> @@ -578,6 +610,7 @@ <argument index="0" name="importer" type="EditorImportPlugin"> </argument> <description> + Removes an import plugin registered by [method add_import_plugin]. </description> </method> <method name="remove_inspector_plugin"> @@ -586,6 +619,7 @@ <argument index="0" name="plugin" type="EditorInspectorPlugin"> </argument> <description> + Removes an inspector plugin registered by [method add_import_plugin] </description> </method> <method name="remove_scene_import_plugin"> @@ -594,6 +628,7 @@ <argument index="0" name="scene_importer" type="EditorSceneImporter"> </argument> <description> + Removes a scene importer registered by [method add_scene_import_plugin]. </description> </method> <method name="remove_spatial_gizmo_plugin"> @@ -602,6 +637,7 @@ <argument index="0" name="plugin" type="EditorNode3DGizmoPlugin"> </argument> <description> + Removes a gizmo plugin registered by [method add_spatial_gizmo_plugin]. </description> </method> <method name="remove_tool_menu_item"> @@ -619,7 +655,16 @@ <argument index="0" name="parser" type="EditorTranslationParserPlugin"> </argument> <description> - Removes a registered custom translation parser plugin. + Removes a custom translation parser plugin registered by [method add_translation_parser_plugin]. + </description> + </method> + <method name="remove_undo_redo_inspector_hook_callback"> + <return type="void"> + </return> + <argument index="0" name="callable" type="Callable"> + </argument> + <description> + Removes a callback previsously added by [method add_undo_redo_inspector_hook_callback]. </description> </method> <method name="save_external_data" qualifiers="virtual"> |