EditorInspectorPlugin.xml 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="EditorInspectorPlugin" inherits="RefCounted" version="4.0">
  3. <brief_description>
  4. Plugin for adding custom property editors on inspector.
  5. </brief_description>
  6. <description>
  7. [EditorInspectorPlugin] allows adding custom property editors to [EditorInspector].
  8. When an object is edited, the [method _can_handle] function is called and must return [code]true[/code] if the object type is supported.
  9. If supported, the function [method _parse_begin] will be called, allowing to place custom controls at the beginning of the class.
  10. 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.
  11. Finally, [method _parse_end] will be called.
  12. On each of these calls, the "add" functions can be called.
  13. To use [EditorInspectorPlugin], register it using the [method EditorPlugin.add_inspector_plugin] method first.
  14. </description>
  15. <tutorials>
  16. <link title="Inspector plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/inspector_plugins.html</link>
  17. </tutorials>
  18. <methods>
  19. <method name="_can_handle" qualifiers="virtual const">
  20. <return type="bool" />
  21. <argument index="0" name="object" type="Variant" />
  22. <description>
  23. Returns [code]true[/code] if this object can be handled by this plugin.
  24. </description>
  25. </method>
  26. <method name="_parse_begin" qualifiers="virtual">
  27. <return type="void" />
  28. <description>
  29. Called to allow adding controls at the beginning of the list.
  30. </description>
  31. </method>
  32. <method name="_parse_category" qualifiers="virtual">
  33. <return type="void" />
  34. <argument index="0" name="object" type="Object" />
  35. <argument index="1" name="category" type="String" />
  36. <description>
  37. </description>
  38. </method>
  39. <method name="_parse_end" qualifiers="virtual">
  40. <return type="void" />
  41. <description>
  42. Called to allow adding controls at the end of the list.
  43. </description>
  44. </method>
  45. <method name="_parse_property" qualifiers="virtual">
  46. <return type="bool" />
  47. <argument index="0" name="object" type="Object" />
  48. <argument index="1" name="type" type="int" />
  49. <argument index="2" name="name" type="String" />
  50. <argument index="3" name="hint_type" type="int" />
  51. <argument index="4" name="hint_string" type="String" />
  52. <argument index="5" name="usage_flags" type="int" />
  53. <argument index="6" name="wide" type="bool" />
  54. <description>
  55. 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.
  56. </description>
  57. </method>
  58. <method name="add_custom_control">
  59. <return type="void" />
  60. <argument index="0" name="control" type="Control" />
  61. <description>
  62. Adds a custom control, which is not necessarily a property editor.
  63. </description>
  64. </method>
  65. <method name="add_property_editor">
  66. <return type="void" />
  67. <argument index="0" name="property" type="String" />
  68. <argument index="1" name="editor" type="Control" />
  69. <description>
  70. Adds a property editor for an individual property. The [code]editor[/code] control must extend [EditorProperty].
  71. </description>
  72. </method>
  73. <method name="add_property_editor_for_multiple_properties">
  74. <return type="void" />
  75. <argument index="0" name="label" type="String" />
  76. <argument index="1" name="properties" type="PackedStringArray" />
  77. <argument index="2" name="editor" type="Control" />
  78. <description>
  79. Adds an editor that allows modifying multiple properties. The [code]editor[/code] control must extend [EditorProperty].
  80. </description>
  81. </method>
  82. </methods>
  83. </class>