Ported: Improves EditorInspector documentation - timothyqiu

6598eb9547
This commit is contained in:
Relintai 2022-07-26 12:40:35 +02:00
parent 55ed3e573e
commit a25fb35179
2 changed files with 7 additions and 4 deletions

View File

@ -1508,7 +1508,7 @@
The property is a translatable string. The property is a translatable string.
</constant> </constant>
<constant name="PROPERTY_USAGE_GROUP" value="128" enum="PropertyUsageFlags"> <constant name="PROPERTY_USAGE_GROUP" value="128" enum="PropertyUsageFlags">
Used to group properties together in the editor. Used to group properties together in the editor. See [EditorInspector].
</constant> </constant>
<constant name="PROPERTY_USAGE_CATEGORY" value="256" enum="PropertyUsageFlags"> <constant name="PROPERTY_USAGE_CATEGORY" value="256" enum="PropertyUsageFlags">
Used to categorize properties together in the editor. Used to categorize properties together in the editor.

View File

@ -1,11 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<class name="EditorInspector" inherits="ScrollContainer" version="3.5"> <class name="EditorInspector" inherits="ScrollContainer" version="3.5">
<brief_description> <brief_description>
A tab used to edit properties of the selected node. A control used to edit properties of an object.
</brief_description> </brief_description>
<description> <description>
The editor inspector is by default located on the right-hand side of the editor. It's used to edit the properties of the selected node. For example, you can select a node such as [Sprite] then edit its transform through the inspector tool. The editor inspector is an essential tool in the game development workflow. 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].
[b]Note:[/b] This class shouldn't be instantiated directly. Instead, access the singleton using [method EditorInterface.get_inspector]. [EditorInspector] will show properties in the same order as the array returned by [method Object.get_property_list].
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.
If a property has [constant @GlobalScope.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.
[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.
</description> </description>
<tutorials> <tutorials>
</tutorials> </tutorials>