Class EditorInspectorPlugin
Plugin for adding custom property editors on the inspector.
- Inheritance
-
EditorInspectorPlugin
Remarks
EditorInspectorPlugin allows adding custom property editors to EditorInspector.
When an object is edited, the EditorInspectorPlugin._can_handle function is called and must return true
if the object type is supported.
If supported, the function EditorInspectorPlugin._parse_begin will be called, allowing to place custom controls at the beginning of the class.
Subsequently, the EditorInspectorPlugin._parse_category and EditorInspectorPlugin._parse_property are called for every category and property. They offer the ability to add custom controls to the inspector too.
Finally, EditorInspectorPlugin._parse_end will be called.
On each of these calls, the "add" functions can be called.
To use EditorInspectorPlugin, register it using the EditorPlugin.add_inspector_plugin method first.
See Also
Methods
_can_handle(Object)
Qualifiers: virtualconst
Returns true
if this object can be handled by this plugin.
bool _can_handle(Object object)
Parameters
object
Object
_parse_begin(Object)
Qualifiers: virtual
Called to allow adding controls at the beginning of the property list for object
.
void _parse_begin(Object object)
Parameters
object
Object
_parse_category(Object, String)
Qualifiers: virtual
Called to allow adding controls at the beginning of a category in the property list for object
.
void _parse_category(Object object, String category)
Parameters
_parse_end(Object)
Qualifiers: virtual
Called to allow adding controls at the end of the property list for object
.
void _parse_end(Object object)
Parameters
object
Object
_parse_group(Object, String)
Qualifiers: virtual
Called to allow adding controls at the beginning of a group or a sub-group in the property list for object
.
void _parse_group(Object object, String group)
Parameters
_parse_property(Object, int, String, int, String, int, bool)
Qualifiers: virtual
Called to allow adding property-specific editors to the property list for object
. The added editor control must extend EditorProperty. Returning true
removes the built-in editor for this property, otherwise allows to insert a custom editor before the built-in one.
bool _parse_property(Object object, int type, String name, int hint_type, String hint_string, int usage_flags, bool wide)
Parameters
add_custom_control(Control)
Adds a custom control, which is not necessarily a property editor.
void add_custom_control(Control control)
Parameters
control
Control
add_property_editor(String, Control, bool, String)
Adds a property editor for an individual property. The editor
control must extend EditorProperty.
There can be multiple property editors for a property. If add_to_end
is true
, this newly added editor will be displayed after all the other editors of the property whose add_to_end
is false
. For example, the editor uses this parameter to add an "Edit Region" button for region_rect below the regular Rect2 editor.
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.
void add_property_editor(String property, Control editor, bool add_to_end, String label)
Parameters
add_property_editor_for_multiple_properties(String, PackedStringArray, Control)
Adds an editor that allows modifying multiple properties. The editor
control must extend EditorProperty.
void add_property_editor_for_multiple_properties(String label, PackedStringArray properties, Control editor)
Parameters
label
Stringproperties
PackedStringArrayeditor
Control