| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="EditorProperty" inherits="Container" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | Custom control for editing properties that can be added to the [EditorInspector]. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | A custom control for editing properties that can be added to the [EditorInspector]. It is added via [EditorInspectorPlugin]. |
| 8 | </description> |
| 9 | <tutorials> |
| 10 | </tutorials> |
| 11 | <methods> |
| 12 | <method name="_set_read_only" qualifiers="virtual"> |
| 13 | <return type="void" /> |
| 14 | <param index="0" name="read_only" type="bool" /> |
| 15 | <description> |
| 16 | Called when the read-only status of the property is changed. It may be used to change custom controls into a read-only or modifiable state. |
| 17 | </description> |
| 18 | </method> |
| 19 | <method name="_update_property" qualifiers="virtual"> |
| 20 | <return type="void" /> |
| 21 | <description> |
| 22 | When this virtual function is called, you must update your editor. |
| 23 | </description> |
| 24 | </method> |
| 25 | <method name="add_focusable"> |
| 26 | <return type="void" /> |
| 27 | <param index="0" name="control" type="Control" /> |
| 28 | <description> |
| 29 | If any of the controls added can gain keyboard focus, add it here. This ensures that focus will be restored if the inspector is refreshed. |
| 30 | </description> |
| 31 | </method> |
| 32 | <method name="deselect"> |
| 33 | <return type="void" /> |
| 34 | <description> |
| 35 | Draw property as not selected. Used by the inspector. |
| 36 | </description> |
| 37 | </method> |
| 38 | <method name="emit_changed"> |
| 39 | <return type="void" /> |
| 40 | <param index="0" name="property" type="StringName" /> |
| 41 | <param index="1" name="value" type="Variant" /> |
| 42 | <param index="2" name="field" type="StringName" default="&""" /> |
| 43 | <param index="3" name="changing" type="bool" default="false" /> |
| 44 | <description> |
| 45 | If one or several properties have changed, this must be called. [param field] is used in case your editor can modify fields separately (as an example, Vector3.x). The [param changing] argument avoids the editor requesting this property to be refreshed (leave as [code]false[/code] if unsure). |
| 46 | </description> |
| 47 | </method> |
| 48 | <method name="get_edited_object"> |
| 49 | <return type="Object" /> |
| 50 | <description> |
| 51 | Returns the edited object. |
| 52 | [b]Note:[/b] This method could return [code]null[/code] if the editor has not yet been associated with a property. However, in [method _update_property] and [method _set_read_only], this value is [i]guaranteed[/i] to be non-[code]null[/code]. |
| 53 | </description> |
| 54 | </method> |
| 55 | <method name="get_edited_property" qualifiers="const"> |
| 56 | <return type="StringName" /> |
| 57 | <description> |
| 58 | Returns the edited property. If your editor is for a single property (added via [method EditorInspectorPlugin._parse_property]), then this will return the property. |
| 59 | [b]Note:[/b] This method could return [code]null[/code] if the editor has not yet been associated with a property. However, in [method _update_property] and [method _set_read_only], this value is [i]guaranteed[/i] to be non-[code]null[/code]. |
| 60 | </description> |
| 61 | </method> |
| 62 | <method name="is_selected" qualifiers="const"> |
| 63 | <return type="bool" /> |
| 64 | <description> |
| 65 | Returns [code]true[/code] if property is drawn as selected. Used by the inspector. |
| 66 | </description> |
| 67 | </method> |
| 68 | <method name="select"> |
| 69 | <return type="void" /> |
| 70 | <param index="0" name="focusable" type="int" default="-1" /> |
| 71 | <description> |
| 72 | Draw property as selected. Used by the inspector. |
| 73 | </description> |
| 74 | </method> |
| 75 | <method name="set_bottom_editor"> |
| 76 | <return type="void" /> |
| 77 | <param index="0" name="editor" type="Control" /> |
| 78 | <description> |
| 79 | Puts the [param editor] control below the property label. The control must be previously added using [method Node.add_child]. |
| 80 | </description> |
| 81 | </method> |
| 82 | <method name="set_label_reference"> |
| 83 | <return type="void" /> |
| 84 | <param index="0" name="control" type="Control" /> |
| 85 | <description> |
| 86 | Used by the inspector, set to a control that will be used as a reference to calculate the size of the label. |
| 87 | </description> |
| 88 | </method> |
| 89 | <method name="set_object_and_property"> |
| 90 | <return type="void" /> |
| 91 | <param index="0" name="object" type="Object" /> |
| 92 | <param index="1" name="property" type="StringName" /> |
| 93 | <description> |
| 94 | Assigns object and property to edit. |
| 95 | </description> |
| 96 | </method> |
| 97 | <method name="update_property"> |
| 98 | <return type="void" /> |
| 99 | <description> |
| 100 | Forces a refresh of the property display. |
| 101 | </description> |
| 102 | </method> |
| 103 | </methods> |
| 104 | <members> |
| 105 | <member name="checkable" type="bool" setter="set_checkable" getter="is_checkable" default="false"> |
| 106 | Used by the inspector, set to [code]true[/code] when the property is checkable. |
| 107 | </member> |
| 108 | <member name="checked" type="bool" setter="set_checked" getter="is_checked" default="false"> |
| 109 | Used by the inspector, set to [code]true[/code] when the property is checked. |
| 110 | </member> |
| 111 | <member name="deletable" type="bool" setter="set_deletable" getter="is_deletable" default="false"> |
| 112 | Used by the inspector, set to [code]true[/code] when the property can be deleted by the user. |
| 113 | </member> |
| 114 | <member name="draw_background" type="bool" setter="set_draw_background" getter="is_draw_background" default="true"> |
| 115 | Used by the inspector, set to [code]true[/code] when the property background is drawn. |
| 116 | </member> |
| 117 | <member name="draw_label" type="bool" setter="set_draw_label" getter="is_draw_label" default="true"> |
| 118 | Used by the inspector, set to [code]true[/code] when the property label is drawn. |
| 119 | </member> |
| 120 | <member name="draw_warning" type="bool" setter="set_draw_warning" getter="is_draw_warning" default="false"> |
| 121 | Used by the inspector, set to [code]true[/code] when the property is drawn with the editor theme's warning color. This is used for editable children's properties. |
| 122 | </member> |
| 123 | <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" overrides="Control" enum="Control.FocusMode" default="3" /> |
| 124 | <member name="keying" type="bool" setter="set_keying" getter="is_keying" default="false"> |
| 125 | Used by the inspector, set to [code]true[/code] when the property can add keys for animation. |
| 126 | </member> |
| 127 | <member name="label" type="String" setter="set_label" getter="get_label" default=""""> |
| 128 | Set this property to change the label (if you want to show one). |
| 129 | </member> |
| 130 | <member name="name_split_ratio" type="float" setter="set_name_split_ratio" getter="get_name_split_ratio" default="0.5"> |
| 131 | Space distribution ratio between the label and the editing field. |
| 132 | </member> |
| 133 | <member name="read_only" type="bool" setter="set_read_only" getter="is_read_only" default="false" keywords="enabled, disabled, editable"> |
| 134 | Used by the inspector, set to [code]true[/code] when the property is read-only. |
| 135 | </member> |
| 136 | <member name="selectable" type="bool" setter="set_selectable" getter="is_selectable" default="true"> |
| 137 | Used by the inspector, set to [code]true[/code] when the property is selectable. |
| 138 | </member> |
| 139 | <member name="use_folding" type="bool" setter="set_use_folding" getter="is_using_folding" default="false"> |
| 140 | Used by the inspector, set to [code]true[/code] when the property is using folding. |
| 141 | </member> |
| 142 | </members> |
| 143 | <signals> |
| 144 | <signal name="multiple_properties_changed"> |
| 145 | <param index="0" name="properties" type="PackedStringArray" /> |
| 146 | <param index="1" name="value" type="Array" /> |
| 147 | <description> |
| 148 | Emit it if you want multiple properties modified at the same time. Do not use if added via [method EditorInspectorPlugin._parse_property]. |
| 149 | </description> |
| 150 | </signal> |
| 151 | <signal name="object_id_selected"> |
| 152 | <param index="0" name="property" type="StringName" /> |
| 153 | <param index="1" name="id" type="int" /> |
| 154 | <description> |
| 155 | Used by sub-inspectors. Emit it if what was selected was an Object ID. |
| 156 | </description> |
| 157 | </signal> |
| 158 | <signal name="property_can_revert_changed"> |
| 159 | <param index="0" name="property" type="StringName" /> |
| 160 | <param index="1" name="can_revert" type="bool" /> |
| 161 | <description> |
| 162 | Emitted when the revertability (i.e., whether it has a non-default value and thus is displayed with a revert icon) of a property has changed. |
| 163 | </description> |
| 164 | </signal> |
| 165 | <signal name="property_changed"> |
| 166 | <param index="0" name="property" type="StringName" /> |
| 167 | <param index="1" name="value" type="Variant" /> |
| 168 | <param index="2" name="field" type="StringName" /> |
| 169 | <param index="3" name="changing" type="bool" /> |
| 170 | <description> |
| 171 | Do not emit this manually, use the [method emit_changed] method instead. |
| 172 | </description> |
| 173 | </signal> |
| 174 | <signal name="property_checked"> |
| 175 | <param index="0" name="property" type="StringName" /> |
| 176 | <param index="1" name="checked" type="bool" /> |
| 177 | <description> |
| 178 | Emitted when a property was checked. Used internally. |
| 179 | </description> |
| 180 | </signal> |
| 181 | <signal name="property_deleted"> |
| 182 | <param index="0" name="property" type="StringName" /> |
| 183 | <description> |
| 184 | Emitted when a property was deleted. Used internally. |
| 185 | </description> |
| 186 | </signal> |
| 187 | <signal name="property_favorited"> |
| 188 | <param index="0" name="property" type="StringName" /> |
| 189 | <param index="1" name="favorited" type="bool" /> |
| 190 | <description> |
| 191 | Emit it if you want to mark a property as favorited, making it appear at the top of the inspector. |
| 192 | </description> |
| 193 | </signal> |
| 194 | <signal name="property_keyed"> |
| 195 | <param index="0" name="property" type="StringName" /> |
| 196 | <description> |
| 197 | Emit it if you want to add this value as an animation key (check for keying being enabled first). |
| 198 | </description> |
| 199 | </signal> |
| 200 | <signal name="property_keyed_with_value"> |
| 201 | <param index="0" name="property" type="StringName" /> |
| 202 | <param index="1" name="value" type="Variant" /> |
| 203 | <description> |
| 204 | Emit it if you want to key a property with a single value. |
| 205 | </description> |
| 206 | </signal> |
| 207 | <signal name="property_overridden"> |
| 208 | <description> |
| 209 | Emitted when a setting override for the current project is requested. |
| 210 | </description> |
| 211 | </signal> |
| 212 | <signal name="property_pinned"> |
| 213 | <param index="0" name="property" type="StringName" /> |
| 214 | <param index="1" name="pinned" type="bool" /> |
| 215 | <description> |
| 216 | Emit it if you want to mark (or unmark) the value of a property for being saved regardless of being equal to the default value. |
| 217 | The default value is the one the property will get when the node is just instantiated and can come from an ancestor scene in the inheritance/instantiation chain, a script or a builtin class. |
| 218 | </description> |
| 219 | </signal> |
| 220 | <signal name="resource_selected"> |
| 221 | <param index="0" name="path" type="String" /> |
| 222 | <param index="1" name="resource" type="Resource" /> |
| 223 | <description> |
| 224 | If you want a sub-resource to be edited, emit this signal with the resource. |
| 225 | </description> |
| 226 | </signal> |
| 227 | <signal name="selected"> |
| 228 | <param index="0" name="path" type="String" /> |
| 229 | <param index="1" name="focusable_idx" type="int" /> |
| 230 | <description> |
| 231 | Emitted when selected. Used internally. |
| 232 | </description> |
| 233 | </signal> |
| 234 | </signals> |
| 235 | </class> |