Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc] Use "param" instead of "code" to refer to parameters #3 #64196

Merged
merged 1 commit into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/classes/Resource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<param index="0" name="subresources" type="bool" default="false" />
<description>
Duplicates the resource, returning a new resource with the exported members copied. [b]Note:[/b] To duplicate the resource the constructor is called without arguments. This method will error when the constructor doesn't have default values.
By default, sub-resources are shared between resource copies for efficiency. This can be changed by passing [code]true[/code] to the [code]subresources[/code] argument which will copy the subresources.
[b]Note:[/b] If [code]subresources[/code] is [code]true[/code], this method will only perform a shallow copy. Nested resources within subresources will not be duplicated and will still be shared.
By default, sub-resources are shared between resource copies for efficiency. This can be changed by passing [code]true[/code] to the [param subresources] argument which will copy the subresources.
[b]Note:[/b] If [param subresources] is [code]true[/code], this method will only perform a shallow copy. Nested resources within subresources will not be duplicated and will still be shared.
[b]Note:[/b] When duplicating a resource, only [code]export[/code]ed properties are copied. Other properties will be set to their default value in the new resource.
</description>
</method>
Expand Down
8 changes: 4 additions & 4 deletions doc/classes/ResourceFormatLoader.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<param index="0" name="path" type="String" />
<param index="1" name="add_types" type="bool" />
<description>
If implemented, gets the dependencies of a given resource. If [code]add_types[/code] is [code]true[/code], paths should be appended [code]::TypeName[/code], where [code]TypeName[/code] is the class name of the dependency.
If implemented, gets the dependencies of a given resource. If [param add_types] is [code]true[/code], paths should be appended [code]::TypeName[/code], where [code]TypeName[/code] is the class name of the dependency.
[b]Note:[/b] Custom resource types defined by scripts aren't known by the [ClassDB], so you might just return [code]"Resource"[/code] for them.
</description>
</method>
Expand Down Expand Up @@ -67,16 +67,16 @@
<param index="2" name="use_sub_threads" type="bool" />
<param index="3" name="cache_mode" type="int" />
<description>
Loads a resource when the engine finds this loader to be compatible. If the loaded resource is the result of an import, [code]original_path[/code] will target the source file. Returns a [Resource] object on success, or an [enum Error] constant in case of failure.
The [code]cache_mode[/code] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details.
Loads a resource when the engine finds this loader to be compatible. If the loaded resource is the result of an import, [param original_path] will target the source file. Returns a [Resource] object on success, or an [enum Error] constant in case of failure.
The [param cache_mode] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details.
</description>
</method>
<method name="_rename_dependencies" qualifiers="virtual const">
<return type="int" />
<param index="0" name="path" type="String" />
<param index="1" name="renames" type="Dictionary" />
<description>
If implemented, renames dependencies within the given resource and saves it. [code]renames[/code] is a dictionary [code]{ String =&gt; String }[/code] mapping old dependency paths to new paths.
If implemented, renames dependencies within the given resource and saves it. [param renames] is a dictionary [code]{ String =&gt; String }[/code] mapping old dependency paths to new paths.
Returns [constant OK] on success, or an [enum Error] constant in case of failure.
</description>
</method>
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/ResourceFormatSaver.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<param index="1" name="resource" type="String" />
<param index="2" name="flags" type="int" />
<description>
Saves the given resource object to a file at the target [code]path[/code]. [code]flags[/code] is a bitmask composed with [enum ResourceSaver.SaverFlags] constants.
Saves the given resource object to a file at the target [param path]. [param flags] is a bitmask composed with [enum ResourceSaver.SaverFlags] constants.
Returns [constant OK] on success, or an [enum Error] constant in case of failure.
</description>
</method>
Expand Down
22 changes: 11 additions & 11 deletions doc/classes/ResourceLoader.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
<param index="0" name="path" type="String" />
<param index="1" name="type_hint" type="String" default="&quot;&quot;" />
<description>
Returns whether a recognized resource exists for the given [code]path[/code].
An optional [code]type_hint[/code] can be used to further specify the [Resource] type that should be handled by the [ResourceFormatLoader]. Anything that inherits from [Resource] can be used as a type hint, for example [Image].
Returns whether a recognized resource exists for the given [param path].
An optional [param type_hint] can be used to further specify the [Resource] type that should be handled by the [ResourceFormatLoader]. Anything that inherits from [Resource] can be used as a type hint, for example [Image].
</description>
</method>
<method name="get_dependencies">
<return type="PackedStringArray" />
<param index="0" name="path" type="String" />
<description>
Returns the dependencies for the resource at the given [code]path[/code].
Returns the dependencies for the resource at the given [param path].
</description>
</method>
<method name="get_recognized_extensions_for_type">
Expand All @@ -55,7 +55,7 @@
<return type="bool" />
<param index="0" name="path" type="String" />
<description>
Returns whether a cached resource is available for the given [code]path[/code].
Returns whether a cached resource is available for the given [param path].
Once a resource has been loaded by the engine, it is cached in memory for faster access, and future calls to the [method load] method will use the cached version. The cached resource can be overridden by using [method Resource.take_over_path] on a new resource for that same path.
</description>
</method>
Expand All @@ -65,10 +65,10 @@
<param index="1" name="type_hint" type="String" default="&quot;&quot;" />
<param index="2" name="cache_mode" type="int" enum="ResourceLoader.CacheMode" default="1" />
<description>
Loads a resource at the given [code]path[/code], caching the result for further access.
Loads a resource at the given [param path], caching the result for further access.
The registered [ResourceFormatLoader]s are queried sequentially to find the first one which can handle the file's extension, and then attempt loading. If loading fails, the remaining ResourceFormatLoaders are also attempted.
An optional [code]type_hint[/code] can be used to further specify the [Resource] type that should be handled by the [ResourceFormatLoader]. Anything that inherits from [Resource] can be used as a type hint, for example [Image].
The [code]cache_mode[/code] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details.
An optional [param type_hint] can be used to further specify the [Resource] type that should be handled by the [ResourceFormatLoader]. Anything that inherits from [Resource] can be used as a type hint, for example [Image].
The [param cache_mode] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details.
Returns an empty resource if no [ResourceFormatLoader] could handle the file.
GDScript has a simplified [method @GDScript.load] built-in method which can be used in most situations, leaving the use of [ResourceLoader] for more advanced scenarios.
</description>
Expand All @@ -86,8 +86,8 @@
<param index="0" name="path" type="String" />
<param index="1" name="progress" type="Array" default="[]" />
<description>
Returns the status of a threaded loading operation started with [method load_threaded_request] for the resource at [code]path[/code]. See [enum ThreadLoadStatus] for possible return values.
An array variable can optionally be passed via [code]progress[/code], and will return a one-element array containing the percentage of completion of the threaded loading.
Returns the status of a threaded loading operation started with [method load_threaded_request] for the resource at [param path]. See [enum ThreadLoadStatus] for possible return values.
An array variable can optionally be passed via [param progress], and will return a one-element array containing the percentage of completion of the threaded loading.
</description>
</method>
<method name="load_threaded_request">
Expand All @@ -97,8 +97,8 @@
<param index="2" name="use_sub_threads" type="bool" default="false" />
<param index="3" name="cache_mode" type="int" enum="ResourceLoader.CacheMode" default="1" />
<description>
Loads the resource using threads. If [code]use_sub_threads[/code] is [code]true[/code], multiple threads will be used to load the resource, which makes loading faster, but may affect the main thread (and thus cause game slowdowns).
The [code]cache_mode[/code] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details.
Loads the resource using threads. If [param use_sub_threads] is [code]true[/code], multiple threads will be used to load the resource, which makes loading faster, but may affect the main thread (and thus cause game slowdowns).
The [param cache_mode] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details.
</description>
</method>
<method name="remove_resource_format_loader">
Expand Down
10 changes: 5 additions & 5 deletions doc/classes/ResourcePreloader.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
<param index="0" name="name" type="StringName" />
<param index="1" name="resource" type="Resource" />
<description>
Adds a resource to the preloader with the given [code]name[/code]. If a resource with the given [code]name[/code] already exists, the new resource will be renamed to "[code]name[/code] N" where N is an incrementing number starting from 2.
Adds a resource to the preloader with the given [param name]. If a resource with the given [param name] already exists, the new resource will be renamed to "[param name] N" where N is an incrementing number starting from 2.
</description>
</method>
<method name="get_resource" qualifiers="const">
<return type="Resource" />
<param index="0" name="name" type="StringName" />
<description>
Returns the resource associated to [code]name[/code].
Returns the resource associated to [param name].
</description>
</method>
<method name="get_resource_list" qualifiers="const">
Expand All @@ -35,22 +35,22 @@
<return type="bool" />
<param index="0" name="name" type="StringName" />
<description>
Returns [code]true[/code] if the preloader contains a resource associated to [code]name[/code].
Returns [code]true[/code] if the preloader contains a resource associated to [param name].
</description>
</method>
<method name="remove_resource">
<return type="void" />
<param index="0" name="name" type="StringName" />
<description>
Removes the resource associated to [code]name[/code] from the preloader.
Removes the resource associated to [param name] from the preloader.
</description>
</method>
<method name="rename_resource">
<return type="void" />
<param index="0" name="name" type="StringName" />
<param index="1" name="newname" type="StringName" />
<description>
Renames a resource inside the preloader from [code]name[/code] to [code]newname[/code].
Renames a resource inside the preloader from [param name] to [param newname].
</description>
</method>
</methods>
Expand Down
4 changes: 2 additions & 2 deletions doc/classes/ResourceSaver.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
<param index="1" name="path" type="String" default="&quot;&quot;" />
<param index="2" name="flags" type="int" enum="ResourceSaver.SaverFlags" default="0" />
<description>
Saves a resource to disk to the given path, using a [ResourceFormatSaver] that recognizes the resource object. If [code]path[/code] is empty, [ResourceSaver] will try to use [member Resource.resource_path].
The [code]flags[/code] bitmask can be specified to customize the save behavior using [enum SaverFlags] flags.
Saves a resource to disk to the given path, using a [ResourceFormatSaver] that recognizes the resource object. If [param path] is empty, [ResourceSaver] will try to use [member Resource.resource_path].
The [param flags] bitmask can be specified to customize the save behavior using [enum SaverFlags] flags.
Returns [constant OK] on success.
</description>
</method>
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/RichTextEffect.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<return type="bool" />
<param index="0" name="char_fx" type="CharFXTransform" />
<description>
Override this method to modify properties in [code]char_fx[/code]. The method must return [code]true[/code] if the character could be transformed successfully. If the method returns [code]false[/code], it will skip transformation to avoid displaying broken text.
Override this method to modify properties in [param char_fx]. The method must return [code]true[/code] if the character could be transformed successfully. If the method returns [code]false[/code], it will skip transformation to avoid displaying broken text.
</description>
</method>
</methods>
Expand Down
24 changes: 12 additions & 12 deletions doc/classes/RichTextLabel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<param index="3" name="color" type="Color" default="Color(1, 1, 1, 1)" />
<param index="4" name="inline_align" type="int" enum="InlineAlignment" default="5" />
<description>
Adds an image's opening and closing tags to the tag stack, optionally providing a [code]width[/code] and [code]height[/code] to resize the image and a [code]color[/code] to tint the image.
If [code]width[/code] or [code]height[/code] is set to 0, the image size will be adjusted in order to keep the original aspect ratio.
Adds an image's opening and closing tags to the tag stack, optionally providing a [param width] and [param height] to resize the image and a [param color] to tint the image.
If [param width] or [param height] is set to 0, the image size will be adjusted in order to keep the original aspect ratio.
</description>
</method>
<method name="add_text">
Expand All @@ -39,7 +39,7 @@
<return type="void" />
<param index="0" name="bbcode" type="String" />
<description>
Parses [code]bbcode[/code] and adds tags to the tag stack as needed.
Parses [param bbcode] and adds tags to the tag stack as needed.
[b]Note:[/b] Using this method, you can't close a tag that was opened in a previous [method append_text] call. This is done to improve performance, especially when updating large RichTextLabels since rebuilding the whole BBCode every time would be slower. If you absolutely need to close a tag in a future method call, append the [member text] instead of using [method append_text].
</description>
</method>
Expand Down Expand Up @@ -176,7 +176,7 @@
<return type="void" />
<param index="0" name="effect" type="Variant" />
<description>
Installs a custom effect. [code]effect[/code] should be a valid [RichTextEffect].
Installs a custom effect. [param effect] should be a valid [RichTextEffect].
</description>
</method>
<method name="is_menu_visible" qualifiers="const">
Expand Down Expand Up @@ -208,7 +208,7 @@
<return type="Dictionary" />
<param index="0" name="expressions" type="PackedStringArray" />
<description>
Parses BBCode parameter [code]expressions[/code] into a dictionary.
Parses BBCode parameter [param expressions] into a dictionary.
</description>
</method>
<method name="pop">
Expand Down Expand Up @@ -294,7 +294,7 @@
<return type="void" />
<param index="0" name="level" type="int" />
<description>
Adds an [code][indent][/code] tag to the tag stack. Multiplies [code]level[/code] by current [member tab_size] to determine new margin length.
Adds an [code][indent][/code] tag to the tag stack. Multiplies [param level] by current [member tab_size] to determine new margin length.
</description>
</method>
<method name="push_italics">
Expand All @@ -309,7 +309,7 @@
<param index="1" name="type" type="int" enum="RichTextLabel.ListType" />
<param index="2" name="capitalize" type="bool" />
<description>
Adds [code][ol][/code] or [code][ul][/code] tag to the tag stack. Multiplies [code]level[/code] by current [member tab_size] to determine new margin length.
Adds [code][ol][/code] or [code][ul][/code] tag to the tag stack. Multiplies [param level] by current [member tab_size] to determine new margin length.
</description>
</method>
<method name="push_meta">
Expand Down Expand Up @@ -380,21 +380,21 @@
<param index="0" name="line" type="int" />
<description>
Removes a line of content from the label. Returns [code]true[/code] if the line exists.
The [code]line[/code] argument is the index of the line to remove, it can take values in the interval [code][0, get_line_count() - 1][/code].
The [param line] argument is the index of the line to remove, it can take values in the interval [code][0, get_line_count() - 1][/code].
</description>
</method>
<method name="scroll_to_line">
<return type="void" />
<param index="0" name="line" type="int" />
<description>
Scrolls the window's top line to match [code]line[/code].
Scrolls the window's top line to match [param line].
</description>
</method>
<method name="scroll_to_paragraph">
<return type="void" />
<param index="0" name="paragraph" type="int" />
<description>
Scrolls the window's top line to match first line of the [code]paragraph[/code].
Scrolls the window's top line to match first line of the [param paragraph].
</description>
</method>
<method name="select_all">
Expand Down Expand Up @@ -440,9 +440,9 @@
<param index="1" name="expand" type="bool" />
<param index="2" name="ratio" type="int" />
<description>
Edits the selected column's expansion options. If [code]expand[/code] is [code]true[/code], the column expands in proportion to its expansion ratio versus the other columns' ratios.
Edits the selected column's expansion options. If [param expand] is [code]true[/code], the column expands in proportion to its expansion ratio versus the other columns' ratios.
For example, 2 columns with ratios 3 and 4 plus 70 pixels in available width would expand 30 and 40 pixels, respectively.
If [code]expand[/code] is [code]false[/code], the column will not contribute to the total ratio.
If [param expand] is [code]false[/code], the column will not contribute to the total ratio.
</description>
</method>
</methods>
Expand Down
Loading