2018-05-28 14:53:15 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-07-06 10:08:05 +02:00
<class name= "EditorInspectorPlugin" inherits= "RefCounted" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2018-05-28 14:53:15 +02:00
<brief_description >
2022-10-27 16:24:10 +02:00
Plugin for adding custom property editors on the inspector.
2018-05-28 14:53:15 +02:00
</brief_description>
<description >
2021-10-15 14:30:58 +02:00
[EditorInspectorPlugin] allows adding custom property editors to [EditorInspector].
2021-05-15 23:48:59 +02:00
When an object is edited, the [method _can_handle] function is called and must return [code]true[/code] if the object type is supported.
If supported, the function [method _parse_begin] will be called, allowing to place custom controls at the beginning of the class.
Subsequently, the [method _parse_category] and [method _parse_property] are called for every category and property. They offer the ability to add custom controls to the inspector too.
Finally, [method _parse_end] will be called.
2019-04-24 07:49:38 +02:00
On each of these calls, the "add" functions can be called.
2021-10-15 14:30:58 +02:00
To use [EditorInspectorPlugin], register it using the [method EditorPlugin.add_inspector_plugin] method first.
2018-05-28 14:53:15 +02:00
</description>
<tutorials >
2021-11-15 10:43:07 +01:00
<link title= "Inspector plugins" > $DOCS_URL/tutorials/plugins/editor/inspector_plugins.html</link>
2018-05-28 14:53:15 +02:00
</tutorials>
<methods >
2021-08-22 03:52:44 +02:00
<method name= "_can_handle" qualifiers= "virtual const" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2022-09-19 18:39:35 +02:00
<param index= "0" name= "object" type= "Object" />
2018-05-28 14:53:15 +02:00
<description >
2021-05-15 23:48:59 +02:00
Returns [code]true[/code] if this object can be handled by this plugin.
2018-05-28 14:53:15 +02:00
</description>
</method>
2021-05-15 23:48:59 +02:00
<method name= "_parse_begin" qualifiers= "virtual" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "object" type= "Object" />
2018-05-28 14:53:15 +02:00
<description >
2022-08-12 18:07:53 +02:00
Called to allow adding controls at the beginning of the property list for [param object].
2018-05-28 14:53:15 +02:00
</description>
</method>
2021-05-15 23:48:59 +02:00
<method name= "_parse_category" qualifiers= "virtual" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "object" type= "Object" />
<param index= "1" name= "category" type= "String" />
2018-05-28 14:53:15 +02:00
<description >
2022-08-12 18:07:53 +02:00
Called to allow adding controls at the beginning of a category in the property list for [param object].
2018-05-28 14:53:15 +02:00
</description>
</method>
2021-05-15 23:48:59 +02:00
<method name= "_parse_end" qualifiers= "virtual" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "object" type= "Object" />
2021-11-10 15:49:19 +01:00
<description >
2022-08-12 18:07:53 +02:00
Called to allow adding controls at the end of the property list for [param object].
2021-11-10 15:49:19 +01:00
</description>
</method>
<method name= "_parse_group" qualifiers= "virtual" >
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "object" type= "Object" />
<param index= "1" name= "group" type= "String" />
2018-05-28 14:53:15 +02:00
<description >
2022-08-12 18:07:53 +02:00
Called to allow adding controls at the beginning of a group or a sub-group in the property list for [param object].
2018-05-28 14:53:15 +02:00
</description>
</method>
2021-05-15 23:48:59 +02:00
<method name= "_parse_property" qualifiers= "virtual" >
2021-07-30 15:28:05 +02:00
<return type= "bool" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "object" type= "Object" />
2023-01-31 19:08:46 +01:00
<param index= "1" name= "type" type= "int" enum= "Variant.Type" />
2022-08-06 20:11:48 +02:00
<param index= "2" name= "name" type= "String" />
2023-01-31 19:08:46 +01:00
<param index= "3" name= "hint_type" type= "int" enum= "PropertyHint" />
2022-08-06 20:11:48 +02:00
<param index= "4" name= "hint_string" type= "String" />
2023-06-15 16:06:22 +02:00
<param index= "5" name= "usage_flags" type= "int" enum= "PropertyUsageFlags" is_bitfield= "true" />
2022-08-06 20:11:48 +02:00
<param index= "6" name= "wide" type= "bool" />
2018-05-28 14:53:15 +02:00
<description >
2022-08-12 18:07:53 +02:00
Called to allow adding property-specific editors to the property list for [param object]. The added editor control must extend [EditorProperty]. Returning [code]true[/code] removes the built-in editor for this property, otherwise allows to insert a custom editor before the built-in one.
2018-05-28 14:53:15 +02:00
</description>
</method>
2021-05-15 23:48:59 +02:00
<method name= "add_custom_control" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "control" type= "Control" />
2018-05-28 14:53:15 +02:00
<description >
2021-08-06 20:01:00 +02:00
Adds a custom control, which is not necessarily a property editor.
2018-05-28 14:53:15 +02:00
</description>
</method>
2021-05-15 23:48:59 +02:00
<method name= "add_property_editor" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "property" type= "String" />
<param index= "1" name= "editor" type= "Control" />
<param index= "2" name= "add_to_end" type= "bool" default= "false" />
2018-05-28 14:53:15 +02:00
<description >
2022-08-12 18:07:53 +02:00
Adds a property editor for an individual property. The [param editor] control must extend [EditorProperty].
2024-05-23 03:08:12 +02:00
There can be multiple property editors for a property. If [param add_to_end] is [code]true[/code], this newly added editor will be displayed after all the other editors of the property whose [param add_to_end] is [code]false[/code]. For example, the editor uses this parameter to add an "Edit Region" button for [member Sprite2D.region_rect] below the regular [Rect2] editor.
2018-05-28 14:53:15 +02:00
</description>
</method>
2021-05-15 23:48:59 +02:00
<method name= "add_property_editor_for_multiple_properties" >
2021-07-30 15:28:05 +02:00
<return type= "void" />
2022-08-06 20:11:48 +02:00
<param index= "0" name= "label" type= "String" />
<param index= "1" name= "properties" type= "PackedStringArray" />
<param index= "2" name= "editor" type= "Control" />
2018-05-28 14:53:15 +02:00
<description >
2022-08-12 18:07:53 +02:00
Adds an editor that allows modifying multiple properties. The [param editor] control must extend [EditorProperty].
2018-05-28 14:53:15 +02:00
</description>
</method>
</methods>
</class>