EditorInspectorPlugin.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="EditorInspectorPlugin" inherits="Reference" version="3.4">
  3. <brief_description>
  4. Plugin for adding custom property editors on inspector.
  5. </brief_description>
  6. <description>
  7. These plugins allow adding custom property editors to [EditorInspector].
  8. Plugins are registered via [method EditorPlugin.add_inspector_plugin].
  9. When an object is edited, the [method can_handle] function is called and must return [code]true[/code] if the object type is supported.
  10. If supported, the function [method parse_begin] will be called, allowing to place custom controls at the beginning of the class.
  11. 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.
  12. Finally, [method parse_end] will be called.
  13. On each of these calls, the "add" functions can be called.
  14. </description>
  15. <tutorials>
  16. </tutorials>
  17. <methods>
  18. <method name="add_custom_control">
  19. <return type="void">
  20. </return>
  21. <argument index="0" name="control" type="Control">
  22. </argument>
  23. <description>
  24. Adds a custom control, not necessarily a property editor.
  25. </description>
  26. </method>
  27. <method name="add_property_editor">
  28. <return type="void">
  29. </return>
  30. <argument index="0" name="property" type="String">
  31. </argument>
  32. <argument index="1" name="editor" type="Control">
  33. </argument>
  34. <description>
  35. Adds a property editor, this must inherit [EditorProperty].
  36. </description>
  37. </method>
  38. <method name="add_property_editor_for_multiple_properties">
  39. <return type="void">
  40. </return>
  41. <argument index="0" name="label" type="String">
  42. </argument>
  43. <argument index="1" name="properties" type="PoolStringArray">
  44. </argument>
  45. <argument index="2" name="editor" type="Control">
  46. </argument>
  47. <description>
  48. Adds an editor that allows modifying multiple properties, this must inherit [EditorProperty].
  49. </description>
  50. </method>
  51. <method name="can_handle" qualifiers="virtual">
  52. <return type="bool">
  53. </return>
  54. <argument index="0" name="object" type="Object">
  55. </argument>
  56. <description>
  57. Returns [code]true[/code] if this object can be handled by this plugin.
  58. </description>
  59. </method>
  60. <method name="parse_begin" qualifiers="virtual">
  61. <return type="void">
  62. </return>
  63. <argument index="0" name="object" type="Object">
  64. </argument>
  65. <description>
  66. Called to allow adding controls at the beginning of the list.
  67. </description>
  68. </method>
  69. <method name="parse_category" qualifiers="virtual">
  70. <return type="void">
  71. </return>
  72. <argument index="0" name="object" type="Object">
  73. </argument>
  74. <argument index="1" name="category" type="String">
  75. </argument>
  76. <description>
  77. Called to allow adding controls at the beginning of the category.
  78. </description>
  79. </method>
  80. <method name="parse_end" qualifiers="virtual">
  81. <return type="void">
  82. </return>
  83. <description>
  84. Called to allow adding controls at the end of the list.
  85. </description>
  86. </method>
  87. <method name="parse_property" qualifiers="virtual">
  88. <return type="bool">
  89. </return>
  90. <argument index="0" name="object" type="Object">
  91. </argument>
  92. <argument index="1" name="type" type="int">
  93. </argument>
  94. <argument index="2" name="path" type="String">
  95. </argument>
  96. <argument index="3" name="hint" type="int">
  97. </argument>
  98. <argument index="4" name="hint_text" type="String">
  99. </argument>
  100. <argument index="5" name="usage" type="int">
  101. </argument>
  102. <description>
  103. 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.
  104. </description>
  105. </method>
  106. </methods>
  107. <constants>
  108. </constants>
  109. </class>