Document several editor-related classes to 100% completion

(cherry picked from commit fb2e4d77eb)
This commit is contained in:
Hugo Locurcio 2020-07-18 17:17:00 +02:00 committed by Rémi Verschelde
parent 0e44834cd3
commit 606d4270c6
8 changed files with 59 additions and 19 deletions

View File

@ -97,6 +97,7 @@
<argument index="0" name="resources" type="PoolStringArray"> <argument index="0" name="resources" type="PoolStringArray">
</argument> </argument>
<description> <description>
Emitted if at least one resource is reloaded when the filesystem is scanned.
</description> </description>
</signal> </signal>
<signal name="sources_changed"> <signal name="sources_changed">

View File

@ -67,6 +67,7 @@
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
Returns the base class of the script class defined in the file at index [code]idx[/code]. If the file doesn't define a script class using the [code]class_name[/code] syntax, this will return an empty string.
</description> </description>
</method> </method>
<method name="get_file_script_class_name" qualifiers="const"> <method name="get_file_script_class_name" qualifiers="const">
@ -75,6 +76,7 @@
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
Returns the name of the script class defined in the file at index [code]idx[/code]. If the file doesn't define a script class using the [code]class_name[/code] syntax, this will return an empty string.
</description> </description>
</method> </method>
<method name="get_file_type" qualifiers="const"> <method name="get_file_type" qualifiers="const">

View File

@ -83,6 +83,16 @@
<argument index="1" name="options" type="Dictionary"> <argument index="1" name="options" type="Dictionary">
</argument> </argument>
<description> <description>
This method can be overridden to hide specific import options if conditions are met. This is mainly useful for hiding options that depend on others if one of them is disabled. For example:
[codeblock]
func get_option_visibility(option, options):
# Only show the lossy quality setting if the compression mode is set to "Lossy".
if option == "compress/lossy_quality" and options.has("compress/mode"):
return int(options["compress/mode"]) == COMPRESS_LOSSY
return true
[/codeblock]
Return [code]true[/code] to make all options always visible.
</description> </description>
</method> </method>
<method name="get_preset_count" qualifiers="virtual"> <method name="get_preset_count" qualifiers="virtual">
@ -150,6 +160,8 @@
<argument index="4" name="gen_files" type="Array"> <argument index="4" name="gen_files" type="Array">
</argument> </argument>
<description> <description>
Imports [code]source_file[/code] into [code]save_path[/code] with the import [code]options[/code] specified. The [code]platform_variants[/code] and [code]gen_files[/code] arrays will be modified by this function.
This method must be overridden to do the actual importing work. See this class' description for an example of overriding this method.
</description> </description>
</method> </method>
</methods> </methods>

View File

@ -14,35 +14,43 @@
<return type="void"> <return type="void">
</return> </return>
<description> <description>
Refreshes the inspector.
[b]Note:[/b] To save on CPU resources, calling this method will do nothing if the time specified in [code]docks/property_editor/auto_refresh_interval[/code] editor setting hasn't passed yet since this method was last called. (By default, this interval is set to 0.3 seconds.)
</description> </description>
</method> </method>
</methods> </methods>
<members> <members>
<member name="scroll_horizontal_enabled" type="bool" setter="set_enable_h_scroll" getter="is_h_scroll_enabled" override="true" default="false" /> <member name="scroll_horizontal_enabled" type="bool" setter="set_enable_h_scroll" getter="is_h_scroll_enabled" override="true" default="false">
If [code]true[/code], horizontal scrolling is enabled. An horizontal scroll bar will display at the bottom of the inspector.
</member>
</members> </members>
<signals> <signals>
<signal name="object_id_selected"> <signal name="object_id_selected">
<argument index="0" name="id" type="int"> <argument index="0" name="id" type="int">
</argument> </argument>
<description> <description>
Emitted when the Edit button of an [Object] has been pressed in the inspector. This is mainly used in the remote scene tree inspector.
</description> </description>
</signal> </signal>
<signal name="property_edited"> <signal name="property_edited">
<argument index="0" name="property" type="String"> <argument index="0" name="property" type="String">
</argument> </argument>
<description> <description>
Emitted when a property is edited in the inspector.
</description> </description>
</signal> </signal>
<signal name="property_keyed"> <signal name="property_keyed">
<argument index="0" name="property" type="String"> <argument index="0" name="property" type="String">
</argument> </argument>
<description> <description>
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.
</description> </description>
</signal> </signal>
<signal name="property_selected"> <signal name="property_selected">
<argument index="0" name="property" type="String"> <argument index="0" name="property" type="String">
</argument> </argument>
<description> <description>
Emitted when a property is selected in the inspector.
</description> </description>
</signal> </signal>
<signal name="property_toggled"> <signal name="property_toggled">
@ -51,6 +59,8 @@
<argument index="1" name="checked" type="bool"> <argument index="1" name="checked" type="bool">
</argument> </argument>
<description> <description>
Emitted when a boolean property is toggled in the inspector.
[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.
</description> </description>
</signal> </signal>
<signal name="resource_selected"> <signal name="resource_selected">
@ -59,10 +69,12 @@
<argument index="1" name="prop" type="String"> <argument index="1" name="prop" type="String">
</argument> </argument>
<description> <description>
Emitted when a resource is selected in the inspector.
</description> </description>
</signal> </signal>
<signal name="restart_requested"> <signal name="restart_requested">
<description> <description>
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.
</description> </description>
</signal> </signal>
</signals> </signals>

View File

@ -23,13 +23,14 @@
<return type="Control"> <return type="Control">
</return> </return>
<description> <description>
Returns the main container of Godot editor's window. You can use it, for example, to retrieve the size of the container and place your controls accordingly. Returns the main container of Godot editor's window. For example, you can use it to retrieve the size of the container and place your controls accordingly.
</description> </description>
</method> </method>
<method name="get_current_path" qualifiers="const"> <method name="get_current_path" qualifiers="const">
<return type="String"> <return type="String">
</return> </return>
<description> <description>
Returns the current path being viewed in the [FileSystemDock].
</description> </description>
</method> </method>
<method name="get_edited_scene_root"> <method name="get_edited_scene_root">
@ -43,26 +44,29 @@
<return type="EditorSettings"> <return type="EditorSettings">
</return> </return>
<description> <description>
Returns the [EditorSettings]. Returns the editor's [EditorSettings] instance.
</description> </description>
</method> </method>
<method name="get_editor_viewport"> <method name="get_editor_viewport">
<return type="Control"> <return type="Control">
</return> </return>
<description> <description>
Returns the editor [Viewport]. Returns the editor's [Viewport] instance.
[b]Note:[/b] This returns the main editor viewport containing the whole editor, not the 2D or 3D viewports specifically.
</description> </description>
</method> </method>
<method name="get_file_system_dock"> <method name="get_file_system_dock">
<return type="FileSystemDock"> <return type="FileSystemDock">
</return> </return>
<description> <description>
Returns the editor's [FileSystemDock] instance.
</description> </description>
</method> </method>
<method name="get_inspector" qualifiers="const"> <method name="get_inspector" qualifiers="const">
<return type="EditorInspector"> <return type="EditorInspector">
</return> </return>
<description> <description>
Returns the editor's [EditorInspector] instance.
</description> </description>
</method> </method>
<method name="get_open_scenes" qualifiers="const"> <method name="get_open_scenes" qualifiers="const">
@ -83,34 +87,35 @@
<return type="EditorFileSystem"> <return type="EditorFileSystem">
</return> </return>
<description> <description>
Returns the [EditorFileSystem]. Returns the editor's [EditorFileSystem] instance.
</description> </description>
</method> </method>
<method name="get_resource_previewer"> <method name="get_resource_previewer">
<return type="EditorResourcePreview"> <return type="EditorResourcePreview">
</return> </return>
<description> <description>
Returns the [EditorResourcePreview]. Returns the editor's [EditorResourcePreview] instance.
</description> </description>
</method> </method>
<method name="get_script_editor"> <method name="get_script_editor">
<return type="ScriptEditor"> <return type="ScriptEditor">
</return> </return>
<description> <description>
Returns the [ScriptEditor]. Returns the editor's [ScriptEditor] instance.
</description> </description>
</method> </method>
<method name="get_selected_path" qualifiers="const"> <method name="get_selected_path" qualifiers="const">
<return type="String"> <return type="String">
</return> </return>
<description> <description>
Returns the path of the directory currently selected in the [FileSystemDock]. If a file is selected, its base directory will be returned using [method String.get_base_dir] instead.
</description> </description>
</method> </method>
<method name="get_selection"> <method name="get_selection">
<return type="EditorSelection"> <return type="EditorSelection">
</return> </return>
<description> <description>
Returns the [EditorSelection]. Returns the editor's [EditorSelection] instance.
</description> </description>
</method> </method>
<method name="inspect_object"> <method name="inspect_object">
@ -121,14 +126,14 @@
<argument index="1" name="for_property" type="String" default="&quot;&quot;"> <argument index="1" name="for_property" type="String" default="&quot;&quot;">
</argument> </argument>
<description> <description>
Shows the given property on the given [code]object[/code] in the Editor's Inspector dock. Shows the given property on the given [code]object[/code] in the editor's Inspector dock.
</description> </description>
</method> </method>
<method name="is_playing_scene" qualifiers="const"> <method name="is_playing_scene" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Returns [code]true[/code], if a scene is currently being played; [code]false[/code] otherwise. Paused scenes are considered as being played. Returns [code]true[/code] if a scene is currently being played, [code]false[/code] otherwise. Paused scenes are considered as being played.
</description> </description>
</method> </method>
<method name="is_plugin_enabled" qualifiers="const"> <method name="is_plugin_enabled" qualifiers="const">
@ -137,7 +142,7 @@
<argument index="0" name="plugin" type="String"> <argument index="0" name="plugin" type="String">
</argument> </argument>
<description> <description>
Returns the enabled status of a plugin. The plugin name is the same as its directory name. Returns [code]true[/code] if the specified [code]plugin[/code] is enabled. The plugin name is the same as its directory name.
</description> </description>
</method> </method>
<method name="make_mesh_previews"> <method name="make_mesh_previews">
@ -225,6 +230,7 @@
<argument index="0" name="name" type="String"> <argument index="0" name="name" type="String">
</argument> </argument>
<description> <description>
Sets the editor's current main screen to the one specified in [code]name[/code]. [code]name[/code] must match the text of the tab in question exactly ([code]2D[/code], [code]3D[/code], [code]Script[/code], [code]AssetLib[/code]).
</description> </description>
</method> </method>
<method name="set_plugin_enabled"> <method name="set_plugin_enabled">

View File

@ -73,22 +73,22 @@
</methods> </methods>
<members> <members>
<member name="checkable" type="bool" setter="set_checkable" getter="is_checkable" default="false"> <member name="checkable" type="bool" setter="set_checkable" getter="is_checkable" default="false">
Used by the inspector, set when property is checkable. Used by the inspector, set to [code]true[/code] when the property is checkable.
</member> </member>
<member name="checked" type="bool" setter="set_checked" getter="is_checked" default="false"> <member name="checked" type="bool" setter="set_checked" getter="is_checked" default="false">
Used by the inspector, when the property is checked. Used by the inspector, set to [code]true[/code] when the property is checked.
</member> </member>
<member name="draw_red" type="bool" setter="set_draw_red" getter="is_draw_red" default="false"> <member name="draw_red" type="bool" setter="set_draw_red" getter="is_draw_red" default="false">
Used by the inspector, when the property must draw with error color. 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.
</member> </member>
<member name="keying" type="bool" setter="set_keying" getter="is_keying" default="false"> <member name="keying" type="bool" setter="set_keying" getter="is_keying" default="false">
Used by the inspector, when the property can add keys for animation. Used by the inspector, set to [code]true[/code] when the property can add keys for animation.
</member> </member>
<member name="label" type="String" setter="set_label" getter="get_label" default="&quot;&quot;"> <member name="label" type="String" setter="set_label" getter="get_label" default="&quot;&quot;">
Sets this property to change the label (if you want to show one). Set this property to change the label (if you want to show one).
</member> </member>
<member name="read_only" type="bool" setter="set_read_only" getter="is_read_only" default="false"> <member name="read_only" type="bool" setter="set_read_only" getter="is_read_only" default="false">
Used by the inspector, when the property is read-only. Used by the inspector, set to [code]true[/code] when the property is read-only.
</member> </member>
</members> </members>
<signals> <signals>

View File

@ -15,6 +15,7 @@
<argument index="0" name="segments" type="PoolVector3Array"> <argument index="0" name="segments" type="PoolVector3Array">
</argument> </argument>
<description> <description>
Adds the specified [code]segments[/code] to the gizmo's collision shape for picking. Call this function during [method redraw].
</description> </description>
</method> </method>
<method name="add_collision_triangles"> <method name="add_collision_triangles">
@ -69,6 +70,7 @@
<argument index="3" name="material" type="Material" default="null"> <argument index="3" name="material" type="Material" default="null">
</argument> </argument>
<description> <description>
Adds a mesh to the gizmo with the specified [code]billboard[/code] state, [code]skeleton[/code] and [code]material[/code]. If [code]billboard[/code] is [code]true[/code], the mesh will rotate to always face the camera. Call this function during [method redraw].
</description> </description>
</method> </method>
<method name="add_unscaled_billboard"> <method name="add_unscaled_billboard">
@ -88,6 +90,7 @@
<return type="void"> <return type="void">
</return> </return>
<description> <description>
Removes everything in the gizmo including meshes, collisions and handles.
</description> </description>
</method> </method>
<method name="commit_handle" qualifiers="virtual"> <method name="commit_handle" qualifiers="virtual">
@ -143,14 +146,14 @@
<argument index="0" name="index" type="int"> <argument index="0" name="index" type="int">
</argument> </argument>
<description> <description>
Gets whether a handle is highlighted or not. Returns [code]true[/code] if the handle at index [code]index[/code] is highlighted by being hovered with the mouse.
</description> </description>
</method> </method>
<method name="redraw" qualifiers="virtual"> <method name="redraw" qualifiers="virtual">
<return type="void"> <return type="void">
</return> </return>
<description> <description>
This function is called when the Spatial this gizmo refers to changes (the [method Spatial.update_gizmo] is called). This function is called when the [Spatial] this gizmo refers to changes (the [method Spatial.update_gizmo] is called).
</description> </description>
</method> </method>
<method name="set_handle" qualifiers="virtual"> <method name="set_handle" qualifiers="virtual">
@ -173,6 +176,7 @@
<argument index="0" name="hidden" type="bool"> <argument index="0" name="hidden" type="bool">
</argument> </argument>
<description> <description>
Sets the gizmo's hidden state. If [code]true[/code], the gizmo will be hidden. If [code]false[/code], it will be shown.
</description> </description>
</method> </method>
<method name="set_spatial_node"> <method name="set_spatial_node">
@ -181,6 +185,7 @@
<argument index="0" name="node" type="Node"> <argument index="0" name="node" type="Node">
</argument> </argument>
<description> <description>
Sets the reference [Spatial] node for the gizmo. [code]node[/code] must inherit from [Spatial].
</description> </description>
</method> </method>
</methods> </methods>

View File

@ -139,6 +139,8 @@
<return type="String"> <return type="String">
</return> </return>
<description> <description>
Override this method to set the gizmo's priority. Higher values correspond to higher priority. If a gizmo with higher priority conflicts with another gizmo, only the gizmo with higher priority will be used.
All built-in editor gizmos return a priority of [code]-1[/code]. If not overridden, this method will return [code]0[/code], which means custom gizmos will automatically override built-in gizmos.
</description> </description>
</method> </method>
<method name="has_gizmo" qualifiers="virtual"> <method name="has_gizmo" qualifiers="virtual">