EditorProperty.xml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="EditorProperty" inherits="Container" version="3.4">
  3. <brief_description>
  4. Custom control to edit properties for adding into the inspector.
  5. </brief_description>
  6. <description>
  7. This control allows property editing for one or multiple properties into [EditorInspector]. It is added via [EditorInspectorPlugin].
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="add_focusable">
  13. <return type="void">
  14. </return>
  15. <argument index="0" name="control" type="Control">
  16. </argument>
  17. <description>
  18. 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.
  19. </description>
  20. </method>
  21. <method name="emit_changed">
  22. <return type="void">
  23. </return>
  24. <argument index="0" name="property" type="String">
  25. </argument>
  26. <argument index="1" name="value" type="Variant">
  27. </argument>
  28. <argument index="2" name="field" type="String" default="&quot;&quot;">
  29. </argument>
  30. <argument index="3" name="changing" type="bool" default="false">
  31. </argument>
  32. <description>
  33. If one or several properties have changed, this must be called. [code]field[/code] is used in case your editor can modify fields separately (as an example, Vector3.x). The [code]changing[/code] argument avoids the editor requesting this property to be refreshed (leave as [code]false[/code] if unsure).
  34. </description>
  35. </method>
  36. <method name="get_edited_object">
  37. <return type="Object">
  38. </return>
  39. <description>
  40. Gets the edited object.
  41. </description>
  42. </method>
  43. <method name="get_edited_property">
  44. <return type="String">
  45. </return>
  46. <description>
  47. Gets the edited property. If your editor is for a single property (added via [method EditorInspectorPlugin.parse_property]), then this will return the property.
  48. </description>
  49. </method>
  50. <method name="get_tooltip_text" qualifiers="const">
  51. <return type="String">
  52. </return>
  53. <description>
  54. Override if you want to allow a custom tooltip over your property.
  55. </description>
  56. </method>
  57. <method name="set_bottom_editor">
  58. <return type="void">
  59. </return>
  60. <argument index="0" name="editor" type="Control">
  61. </argument>
  62. <description>
  63. Adds controls with this function if you want them on the bottom (below the label).
  64. </description>
  65. </method>
  66. <method name="update_property" qualifiers="virtual">
  67. <return type="void">
  68. </return>
  69. <description>
  70. When this virtual function is called, you must update your editor.
  71. </description>
  72. </method>
  73. </methods>
  74. <members>
  75. <member name="checkable" type="bool" setter="set_checkable" getter="is_checkable" default="false">
  76. Used by the inspector, set to [code]true[/code] when the property is checkable.
  77. </member>
  78. <member name="checked" type="bool" setter="set_checked" getter="is_checked" default="false">
  79. Used by the inspector, set to [code]true[/code] when the property is checked.
  80. </member>
  81. <member name="draw_red" type="bool" setter="set_draw_red" getter="is_draw_red" default="false">
  82. Used by the inspector, set to [code]true[/code] when the property must draw with error color. This is used for editable children's properties.
  83. </member>
  84. <member name="keying" type="bool" setter="set_keying" getter="is_keying" default="false">
  85. Used by the inspector, set to [code]true[/code] when the property can add keys for animation.
  86. </member>
  87. <member name="label" type="String" setter="set_label" getter="get_label" default="&quot;&quot;">
  88. Set this property to change the label (if you want to show one).
  89. </member>
  90. <member name="read_only" type="bool" setter="set_read_only" getter="is_read_only" default="false">
  91. Used by the inspector, set to [code]true[/code] when the property is read-only.
  92. </member>
  93. </members>
  94. <signals>
  95. <signal name="multiple_properties_changed">
  96. <argument index="0" name="properties" type="PoolStringArray">
  97. </argument>
  98. <argument index="1" name="value" type="Array">
  99. </argument>
  100. <description>
  101. Emit it if you want multiple properties modified at the same time. Do not use if added via [method EditorInspectorPlugin.parse_property].
  102. </description>
  103. </signal>
  104. <signal name="object_id_selected">
  105. <argument index="0" name="property" type="String">
  106. </argument>
  107. <argument index="1" name="id" type="int">
  108. </argument>
  109. <description>
  110. Used by sub-inspectors. Emit it if what was selected was an Object ID.
  111. </description>
  112. </signal>
  113. <signal name="property_changed">
  114. <argument index="0" name="property" type="String">
  115. </argument>
  116. <argument index="1" name="value" type="Variant">
  117. </argument>
  118. <description>
  119. Do not emit this manually, use the [method emit_changed] method instead.
  120. </description>
  121. </signal>
  122. <signal name="property_checked">
  123. <argument index="0" name="property" type="String">
  124. </argument>
  125. <argument index="1" name="bool" type="String">
  126. </argument>
  127. <description>
  128. Emitted when a property was checked. Used internally.
  129. </description>
  130. </signal>
  131. <signal name="property_keyed">
  132. <argument index="0" name="property" type="String">
  133. </argument>
  134. <description>
  135. Emit it if you want to add this value as an animation key (check for keying being enabled first).
  136. </description>
  137. </signal>
  138. <signal name="property_keyed_with_value">
  139. <argument index="0" name="property" type="String">
  140. </argument>
  141. <argument index="1" name="value" type="Variant">
  142. </argument>
  143. <description>
  144. Emit it if you want to key a property with a single value.
  145. </description>
  146. </signal>
  147. <signal name="resource_selected">
  148. <argument index="0" name="path" type="String">
  149. </argument>
  150. <argument index="1" name="resource" type="Resource">
  151. </argument>
  152. <description>
  153. If you want a sub-resource to be edited, emit this signal with the resource.
  154. </description>
  155. </signal>
  156. <signal name="selected">
  157. <argument index="0" name="path" type="String">
  158. </argument>
  159. <argument index="1" name="focusable_idx" type="int">
  160. </argument>
  161. <description>
  162. Emitted when selected. Used internally.
  163. </description>
  164. </signal>
  165. </signals>
  166. <constants>
  167. </constants>
  168. </class>