| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="EditorInspector" inherits="ScrollContainer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | A control used to edit properties of an object. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | This is the control that implements property editing in the editor's Settings dialogs, the Inspector dock, etc. To get the [EditorInspector] used in the editor's Inspector dock, use [method EditorInterface.get_inspector]. |
| 8 | [EditorInspector] will show properties in the same order as the array returned by [method Object.get_property_list]. |
| 9 | If a property's name is path-like (i.e. if it contains forward slashes), [EditorInspector] will create nested sections for "directories" along the path. For example, if a property is named [code]highlighting/gdscript/node_path_color[/code], it will be shown as "Node Path Color" inside the "GDScript" section nested inside the "Highlighting" section. |
| 10 | If a property has [constant PROPERTY_USAGE_GROUP] usage, it will group subsequent properties whose name starts with the property's hint string. The group ends when a property does not start with that hint string or when a new group starts. An empty group name effectively ends the current group. [EditorInspector] will create a top-level section for each group. For example, if a property with group usage is named [code]Collide With[/code] and its hint string is [code]collide_with_[/code], a subsequent [code]collide_with_area[/code] property will be shown as "Area" inside the "Collide With" section. There is also a special case: when the hint string contains the name of a property, that property is grouped too. This is mainly to help grouping properties like [code]font[/code], [code]font_color[/code] and [code]font_size[/code] (using the hint string [code]font_[/code]). |
| 11 | If a property has [constant PROPERTY_USAGE_SUBGROUP] usage, a subgroup will be created in the same way as a group, and a second-level section will be created for each subgroup. |
| 12 | [b]Note:[/b] Unlike sections created from path-like property names, [EditorInspector] won't capitalize the name for sections created from groups. So properties with group usage usually use capitalized names instead of snake_cased names. |
| 13 | </description> |
| 14 | <tutorials> |
| 15 | </tutorials> |
| 16 | <methods> |
| 17 | <method name="edit"> |
| 18 | <return type="void" /> |
| 19 | <param index="0" name="object" type="Object" /> |
| 20 | <description> |
| 21 | Shows the properties of the given [param object] in this inspector for editing. To clear the inspector, call this method with [code]null[/code]. |
| 22 | [b]Note:[/b] If you want to edit an object in the editor's main inspector, use the [code]edit_*[/code] methods in [EditorInterface] instead. |
| 23 | </description> |
| 24 | </method> |
| 25 | <method name="get_edited_object"> |
| 26 | <return type="Object" /> |
| 27 | <description> |
| 28 | Returns the object currently selected in this inspector. |
| 29 | </description> |
| 30 | </method> |
| 31 | <method name="get_selected_path" qualifiers="const"> |
| 32 | <return type="String" /> |
| 33 | <description> |
| 34 | Gets the path of the currently selected property. |
| 35 | </description> |
| 36 | </method> |
| 37 | <method name="instantiate_property_editor" qualifiers="static"> |
| 38 | <return type="EditorProperty" /> |
| 39 | <param index="0" name="object" type="Object" /> |
| 40 | <param index="1" name="type" type="int" enum="Variant.Type" /> |
| 41 | <param index="2" name="path" type="String" /> |
| 42 | <param index="3" name="hint" type="int" enum="PropertyHint" /> |
| 43 | <param index="4" name="hint_text" type="String" /> |
| 44 | <param index="5" name="usage" type="int" /> |
| 45 | <param index="6" name="wide" type="bool" default="false" /> |
| 46 | <description> |
| 47 | Creates a property editor that can be used by plugin UI to edit the specified property of an [param object]. |
| 48 | </description> |
| 49 | </method> |
| 50 | </methods> |
| 51 | <members> |
| 52 | <member name="draw_focus_border" type="bool" setter="set_draw_focus_border" getter="get_draw_focus_border" overrides="ScrollContainer" default="true" /> |
| 53 | <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" overrides="Control" enum="Control.FocusMode" default="2" /> |
| 54 | <member name="follow_focus" type="bool" setter="set_follow_focus" getter="is_following_focus" overrides="ScrollContainer" default="true" /> |
| 55 | <member name="horizontal_scroll_mode" type="int" setter="set_horizontal_scroll_mode" getter="get_horizontal_scroll_mode" overrides="ScrollContainer" enum="ScrollContainer.ScrollMode" default="0" /> |
| 56 | </members> |
| 57 | <signals> |
| 58 | <signal name="edited_object_changed"> |
| 59 | <description> |
| 60 | Emitted when the object being edited by the inspector has changed. |
| 61 | </description> |
| 62 | </signal> |
| 63 | <signal name="object_id_selected"> |
| 64 | <param index="0" name="id" type="int" /> |
| 65 | <description> |
| 66 | Emitted when the Edit button of an [Object] has been pressed in the inspector. This is mainly used in the remote scene tree Inspector. |
| 67 | </description> |
| 68 | </signal> |
| 69 | <signal name="property_deleted"> |
| 70 | <param index="0" name="property" type="String" /> |
| 71 | <description> |
| 72 | Emitted when a property is removed from the inspector. |
| 73 | </description> |
| 74 | </signal> |
| 75 | <signal name="property_edited"> |
| 76 | <param index="0" name="property" type="String" /> |
| 77 | <description> |
| 78 | Emitted when a property is edited in the inspector. |
| 79 | </description> |
| 80 | </signal> |
| 81 | <signal name="property_keyed"> |
| 82 | <param index="0" name="property" type="String" /> |
| 83 | <param index="1" name="value" type="Variant" /> |
| 84 | <param index="2" name="advance" type="bool" /> |
| 85 | <description> |
| 86 | Emitted when a property is keyed in the inspector. Properties can be keyed by clicking the "key" icon next to a property when the Animation panel is toggled. |
| 87 | </description> |
| 88 | </signal> |
| 89 | <signal name="property_selected"> |
| 90 | <param index="0" name="property" type="String" /> |
| 91 | <description> |
| 92 | Emitted when a property is selected in the inspector. |
| 93 | </description> |
| 94 | </signal> |
| 95 | <signal name="property_toggled"> |
| 96 | <param index="0" name="property" type="String" /> |
| 97 | <param index="1" name="checked" type="bool" /> |
| 98 | <description> |
| 99 | Emitted when a boolean property is toggled in the inspector. |
| 100 | [b]Note:[/b] This signal is never emitted if the internal [code]autoclear[/code] property enabled. Since this property is always enabled in the editor inspector, this signal is never emitted by the editor itself. |
| 101 | </description> |
| 102 | </signal> |
| 103 | <signal name="resource_selected"> |
| 104 | <param index="0" name="resource" type="Resource" /> |
| 105 | <param index="1" name="path" type="String" /> |
| 106 | <description> |
| 107 | Emitted when a resource is selected in the inspector. |
| 108 | </description> |
| 109 | </signal> |
| 110 | <signal name="restart_requested"> |
| 111 | <description> |
| 112 | Emitted when a property that requires a restart to be applied is edited in the inspector. This is only used in the Project Settings and Editor Settings. |
| 113 | </description> |
| 114 | </signal> |
| 115 | </signals> |
| 116 | </class> |