mirror of
https://github.com/godotengine/godot.git
synced 2024-11-25 05:33:11 +00:00
99 lines
5.1 KiB
XML
99 lines
5.1 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<class name="EditorInspectorPlugin" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
|
|
<brief_description>
|
|
Plugin for adding custom property editors on the inspector.
|
|
</brief_description>
|
|
<description>
|
|
[EditorInspectorPlugin] allows adding custom property editors to [EditorInspector].
|
|
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.
|
|
On each of these calls, the "add" functions can be called.
|
|
To use [EditorInspectorPlugin], register it using the [method EditorPlugin.add_inspector_plugin] method first.
|
|
</description>
|
|
<tutorials>
|
|
<link title="Inspector plugins">$DOCS_URL/tutorials/plugins/editor/inspector_plugins.html</link>
|
|
</tutorials>
|
|
<methods>
|
|
<method name="_can_handle" qualifiers="virtual const">
|
|
<return type="bool" />
|
|
<param index="0" name="object" type="Object" />
|
|
<description>
|
|
Returns [code]true[/code] if this object can be handled by this plugin.
|
|
</description>
|
|
</method>
|
|
<method name="_parse_begin" qualifiers="virtual">
|
|
<return type="void" />
|
|
<param index="0" name="object" type="Object" />
|
|
<description>
|
|
Called to allow adding controls at the beginning of the property list for [param object].
|
|
</description>
|
|
</method>
|
|
<method name="_parse_category" qualifiers="virtual">
|
|
<return type="void" />
|
|
<param index="0" name="object" type="Object" />
|
|
<param index="1" name="category" type="String" />
|
|
<description>
|
|
Called to allow adding controls at the beginning of a category in the property list for [param object].
|
|
</description>
|
|
</method>
|
|
<method name="_parse_end" qualifiers="virtual">
|
|
<return type="void" />
|
|
<param index="0" name="object" type="Object" />
|
|
<description>
|
|
Called to allow adding controls at the end of the property list for [param object].
|
|
</description>
|
|
</method>
|
|
<method name="_parse_group" qualifiers="virtual">
|
|
<return type="void" />
|
|
<param index="0" name="object" type="Object" />
|
|
<param index="1" name="group" type="String" />
|
|
<description>
|
|
Called to allow adding controls at the beginning of a group or a sub-group in the property list for [param object].
|
|
</description>
|
|
</method>
|
|
<method name="_parse_property" qualifiers="virtual">
|
|
<return type="bool" />
|
|
<param index="0" name="object" type="Object" />
|
|
<param index="1" name="type" type="int" enum="Variant.Type" />
|
|
<param index="2" name="name" type="String" />
|
|
<param index="3" name="hint_type" type="int" enum="PropertyHint" />
|
|
<param index="4" name="hint_string" type="String" />
|
|
<param index="5" name="usage_flags" type="int" enum="PropertyUsageFlags" is_bitfield="true" />
|
|
<param index="6" name="wide" type="bool" />
|
|
<description>
|
|
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.
|
|
</description>
|
|
</method>
|
|
<method name="add_custom_control">
|
|
<return type="void" />
|
|
<param index="0" name="control" type="Control" />
|
|
<description>
|
|
Adds a custom control, which is not necessarily a property editor.
|
|
</description>
|
|
</method>
|
|
<method name="add_property_editor">
|
|
<return type="void" />
|
|
<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" />
|
|
<param index="3" name="label" type="String" default="""" />
|
|
<description>
|
|
Adds a property editor for an individual property. The [param editor] control must extend [EditorProperty].
|
|
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.
|
|
[param label] can be used to choose a custom label for the property editor in the inspector. If left empty, the label is computed from the name of the property instead.
|
|
</description>
|
|
</method>
|
|
<method name="add_property_editor_for_multiple_properties">
|
|
<return type="void" />
|
|
<param index="0" name="label" type="String" />
|
|
<param index="1" name="properties" type="PackedStringArray" />
|
|
<param index="2" name="editor" type="Control" />
|
|
<description>
|
|
Adds an editor that allows modifying multiple properties. The [param editor] control must extend [EditorProperty].
|
|
</description>
|
|
</method>
|
|
</methods>
|
|
</class>
|