EditorInspectorPlugin
Plugin for adding custom property editors on the inspector.
Plugin for adding custom property editors on the inspector.
EditorInspectorPlugin allows adding custom property editors to EditorInspector.
When an object is edited, the EditorInspectorPlugin._CanHandle function is called and must return true if the object type is supported.
If supported, the function EditorInspectorPlugin._ParseBegin will be called, allowing to place custom controls at the beginning of the class.
Subsequently, the EditorInspectorPlugin._ParseCategory and EditorInspectorPlugin._ParseProperty are called for every category and property. They offer the ability to add custom controls to the inspector too.
Finally, EditorInspectorPlugin._ParseEnd will be called.
On each of these calls, the "add" functions can be called.
To use EditorInspectorPlugin, register it using the EditorPlugin.AddInspectorPlugin method first.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
EditorInspectorPluginConstructor
public EditorInspectorPlugin();Methods11
AddCustomControlvoid
public void AddCustomControl(Control control);Adds a custom control, which is not necessarily a property editor.
| Name | Type | Default |
|---|---|---|
control | Control | — |
AddPropertyEditor2 overloads
public void AddPropertyEditor(string property, Control editor, bool addToEnd);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 Sprite2D.RegionRect 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.
| Name | Type | Default |
|---|---|---|
property | string | — |
editor | Control | — |
addToEnd | bool | — |
public void AddPropertyEditor(string property, Control editor, bool addToEnd = false, string label = "");Adds UI for one property during a parse callback. The Control must be an EditorProperty; a bare SpinBox does not gain property binding and editor data flow.
| Name | Type | Default |
|---|---|---|
property | string | — |
editor | Control | — |
addToEnd | bool | false |
label | string | "" |
propertyExact property name/path received by _ParseProperty.
editorCreated EditorProperty. Inspector manages its UI lifetime after registration.
addToEndtrue places after editors for this property with addToEnd=false. Does not itself suppress the standard field.
labelCustom caption. An empty string derives it from the property name; the example supplies Amount.
AddPropertyEditorForMultipleProperties2 overloads
public void AddPropertyEditorForMultipleProperties(string label, ReadOnlySpan<string> properties, Control editor);Adds an editor that allows modifying multiple properties. The editor control must extend EditorProperty.
| Name | Type | Default |
|---|---|---|
label | string | — |
properties | ReadOnlySpan<string> | — |
editor | Control | — |
public void AddPropertyEditorForMultipleProperties(string label, string[] properties, Control editor);Adds an editor that allows modifying multiple properties. The editor control must extend EditorProperty.
| Name | Type | Default |
|---|---|---|
label | string | — |
properties | string[] | — |
editor | Control | — |
_CanHandlebool
public virtual bool _CanHandle(ReckfellObject @object);Decides whether the plugin participates in parsing this object. Restrict to a specific type/contract rather than every editor object; the example accepts only DocsInspectorSettings.
| Name | Type | Default |
|---|---|---|
object | ReckfellObject | — |
objectObject edited by Inspector; not necessarily an Entity or selected game character.
booltrue allows further parse callbacks for this plugin. Does not itself create a widget or replace every field.
_ParseBeginvoid
public virtual void _ParseBegin(ReckfellObject @object);Called to allow adding controls at the beginning of the property list for object.
| Name | Type | Default |
|---|---|---|
object | ReckfellObject | — |
_ParseCategoryvoid
public virtual void _ParseCategory(ReckfellObject @object, string category);Called to allow adding controls at the beginning of a category in the property list for object.
| Name | Type | Default |
|---|---|---|
object | ReckfellObject | — |
category | string | — |
_ParseEndvoid
public virtual void _ParseEnd(ReckfellObject @object);Called to allow adding controls at the end of the property list for object.
| Name | Type | Default |
|---|---|---|
object | ReckfellObject | — |
_ParseGroupvoid
public virtual void _ParseGroup(ReckfellObject @object, string group);Called to allow adding controls at the beginning of a group or a sub-group in the property list for object.
| Name | Type | Default |
|---|---|---|
object | ReckfellObject | — |
group | string | — |
_ParsePropertybool
public virtual bool _ParseProperty(ReckfellObject @object, Variant.Type type, string name, PropertyHint hintType, string hintString, PropertyUsageFlags usageFlags, bool wide);Chooses an individual property editor after _CanHandle. Add an EditorProperty for the intended name/type without consuming other properties. The example replaces only Amount.
| Name | Type | Default |
|---|---|---|
object | ReckfellObject | — |
type | Variant.Type | — |
name | string | — |
hintType | PropertyHint | — |
hintString | string | — |
usageFlags | PropertyUsageFlags | — |
wide | bool | — |
objectObject being edited by Inspector.
typeProperty Variant type; the example's double is Variant.Type.Float.
nameExact object-property name/path. Pass it to AddPropertyEditor; not a translated caption.
hintTypeProperty hint type, such as Range. Editor metadata, not universal model validation.
hintStringHint parameters, such as range bounds and step.
usageFlagsProperty-usage bit flags, distinct from its value.
wideCurrent Inspector wide-editor mode. Consider for layout; this example has no separate wide variant.
booltrue suppresses the property's standard editor; false preserves standard handling. Add the widget separately.