summaryrefslogtreecommitdiff
path: root/doc/classes/EditorInspectorPlugin.xml
blob: 62fd7a1d6e969c997a3340f9a0548e0d09809392 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?xml version="1.0" encoding="UTF-8" ?>
<class name="EditorInspectorPlugin" inherits="RefCounted" version="4.0">
	<brief_description>
		Plugin for adding custom property editors on inspector.
	</brief_description>
	<description>
		These plugins allow adding custom property editors to [EditorInspector].
		Plugins are registered via [method EditorPlugin.add_inspector_plugin].
		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.
	</description>
	<tutorials>
		<link title="Inspector plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/inspector_plugins.html</link>
	</tutorials>
	<methods>
		<method name="_can_handle" qualifiers="virtual">
			<return type="bool" />
			<argument 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" />
			<description>
				Called to allow adding controls at the beginning of the list.
			</description>
		</method>
		<method name="_parse_category" qualifiers="virtual">
			<return type="void" />
			<argument index="0" name="category" type="String" />
			<description>
				Called to allow adding controls at the beginning of the category.
			</description>
		</method>
		<method name="_parse_end" qualifiers="virtual">
			<return type="void" />
			<description>
				Called to allow adding controls at the end of the list.
			</description>
		</method>
		<method name="_parse_property" qualifiers="virtual">
			<return type="bool" />
			<argument index="0" name="type" type="int" />
			<argument index="1" name="path" type="String" />
			<argument index="2" name="hint" type="int" />
			<argument index="3" name="hint_text" type="String" />
			<argument index="4" name="usage" type="int" />
			<description>
				Called to allow adding property specific editors to the inspector. Usually these inherit [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" />
			<argument 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" />
			<argument index="0" name="property" type="String" />
			<argument index="1" name="editor" type="Control" />
			<description>
				Adds a property editor for an individual property. The [code]editor[/code] control must extend [EditorProperty].
			</description>
		</method>
		<method name="add_property_editor_for_multiple_properties">
			<return type="void" />
			<argument index="0" name="label" type="String" />
			<argument index="1" name="properties" type="PackedStringArray" />
			<argument index="2" name="editor" type="Control" />
			<description>
				Adds an editor that allows modifying multiple properties. The [code]editor[/code] control must extend [EditorProperty].
			</description>
		</method>
	</methods>
	<constants>
	</constants>
</class>