Skip to content

Commit

Permalink
Merge pull request #9981 from godotengine/classref/sync-621cadc
Browse files Browse the repository at this point in the history
classref: Sync with current master branch (621cadc)
  • Loading branch information
AThousandShips authored Sep 21, 2024
2 parents 65177ea + 0cf8e77 commit 936b648
Show file tree
Hide file tree
Showing 42 changed files with 1,107 additions and 256 deletions.
62 changes: 61 additions & 1 deletion classes/class_array.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ Methods
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`find<class_Array_method_find>`\ (\ what\: :ref:`Variant<class_Variant>`, from\: :ref:`int<class_int>` = 0\ ) |const| |
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`find_custom<class_Array_method_find_custom>`\ (\ method\: :ref:`Callable<class_Callable>`, from\: :ref:`int<class_int>` = 0\ ) |const| |
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant<class_Variant>` | :ref:`front<class_Array_method_front>`\ (\ ) |const| |
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_typed_builtin<class_Array_method_get_typed_builtin>`\ (\ ) |const| |
Expand Down Expand Up @@ -183,6 +185,8 @@ Methods
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`rfind<class_Array_method_rfind>`\ (\ what\: :ref:`Variant<class_Variant>`, from\: :ref:`int<class_int>` = -1\ ) |const| |
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`rfind_custom<class_Array_method_rfind_custom>`\ (\ method\: :ref:`Callable<class_Callable>`, from\: :ref:`int<class_int>` = -1\ ) |const| |
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`shuffle<class_Array_method_shuffle>`\ (\ ) |
+-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`size<class_Array_method_size>`\ (\ ) |const| |
Expand Down Expand Up @@ -639,6 +643,8 @@ Removes all elements from the array. This is equivalent to using :ref:`resize<cl

Returns the number of times an element is in the array.

To count how many elements in an array satisfy a condition, see :ref:`reduce<class_Array_method_reduce>`.

.. rst-class:: classref-item-separator

----
Expand Down Expand Up @@ -749,6 +755,35 @@ Returns the index of the **first** occurrence of ``what`` in this array, or ``-1

\ **Note:** For performance reasons, the search is affected by ``what``'s :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>`. For example, ``7`` (:ref:`int<class_int>`) and ``7.0`` (:ref:`float<class_float>`) are not considered equal for this method.

.. rst-class:: classref-item-separator

----

.. _class_Array_method_find_custom:

.. rst-class:: classref-method

:ref:`int<class_int>` **find_custom**\ (\ method\: :ref:`Callable<class_Callable>`, from\: :ref:`int<class_int>` = 0\ ) |const| :ref:`🔗<class_Array_method_find_custom>`

Returns the index of the **first** element in the array that causes ``method`` to return ``true``, or ``-1`` if there are none. The search's start can be specified with ``from``, continuing to the end of the array.

\ ``method`` is a callable that takes an element of the array, and returns a :ref:`bool<class_bool>`.

\ **Note:** If you just want to know whether the array contains *anything* that satisfies ``method``, use :ref:`any<class_Array_method_any>`.


.. tabs::

.. code-tab:: gdscript

func is_even(number):
return number % 2 == 0

func _ready():
print([1, 3, 4, 7].find_custom(is_even.bind())) # prints 2



.. rst-class:: classref-item-separator

----
Expand Down Expand Up @@ -1129,6 +1164,19 @@ If :ref:`max<class_Array_method_max>` is not desirable, this method may also be
func is_length_greater(a, b):
return a.length() > b.length()

This method can also be used to count how many elements in an array satisfy a certain condition, similar to :ref:`count<class_Array_method_count>`:

::

func is_even(number):
return number % 2 == 0
func _ready():
var arr = [1, 2, 3, 4, 5]
# Increment count if it's even, else leaves count the same.
var even_count = arr.reduce(func(count, next): return count + 1 if is_even(next) else count, 0)
print(even_count) # Prints 2

See also :ref:`map<class_Array_method_map>`, :ref:`filter<class_Array_method_filter>`, :ref:`any<class_Array_method_any>` and :ref:`all<class_Array_method_all>`.

.. rst-class:: classref-item-separator
Expand Down Expand Up @@ -1193,6 +1241,18 @@ Returns the index of the **last** occurrence of ``what`` in this array, or ``-1`

----

.. _class_Array_method_rfind_custom:

.. rst-class:: classref-method

:ref:`int<class_int>` **rfind_custom**\ (\ method\: :ref:`Callable<class_Callable>`, from\: :ref:`int<class_int>` = -1\ ) |const| :ref:`🔗<class_Array_method_rfind_custom>`

Returns the index of the **last** element of the array that causes ``method`` to return ``true``, or ``-1`` if there are none. The search's start can be specified with ``from``, continuing to the beginning of the array. This method is the reverse of :ref:`find_custom<class_Array_method_find_custom>`.

.. rst-class:: classref-item-separator

----

.. _class_Array_method_shuffle:

.. rst-class:: classref-method
Expand Down Expand Up @@ -1287,7 +1347,7 @@ Sorts the array in ascending order. The final order is dependent on the "less th

Sorts the array using a custom :ref:`Callable<class_Callable>`.

\ ``func`` is called as many times as necessary, receiving two array elements as arguments. The function should return ``true`` if the first element should be moved *behind* the second one, otherwise it should return ``false``.
\ ``func`` is called as many times as necessary, receiving two array elements as arguments. The function should return ``true`` if the first element should be moved *before* the second one, otherwise it should return ``false``.

::

Expand Down
4 changes: 4 additions & 0 deletions classes/class_astar2d.rst
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ Returns an array with the IDs of the points that form the path found by AStar2D

If there is no valid path to the target, and ``allow_partial_path`` is ``true``, returns a path to the point closest to the target that can be reached.

\ **Note:** When ``allow_partial_path`` is ``true`` and ``to_id`` is disabled the search may take an unusually long time to finish.


.. tabs::

Expand Down Expand Up @@ -420,6 +422,8 @@ If there is no valid path to the target, and ``allow_partial_path`` is ``true``,

\ **Note:** This method is not thread-safe. If called from a :ref:`Thread<class_Thread>`, it will return an empty array and will print an error message.

Additionally, when ``allow_partial_path`` is ``true`` and ``to_id`` is disabled the search may take an unusually long time to finish.

.. rst-class:: classref-item-separator

----
Expand Down
4 changes: 4 additions & 0 deletions classes/class_astar3d.rst
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ Returns an array with the IDs of the points that form the path found by AStar3D

If there is no valid path to the target, and ``allow_partial_path`` is ``true``, returns a path to the point closest to the target that can be reached.

\ **Note:** When ``allow_partial_path`` is ``true`` and ``to_id`` is disabled the search may take an unusually long time to finish.


.. tabs::

Expand Down Expand Up @@ -455,6 +457,8 @@ If there is no valid path to the target, and ``allow_partial_path`` is ``true``,

\ **Note:** This method is not thread-safe. If called from a :ref:`Thread<class_Thread>`, it will return an empty array and will print an error message.

Additionally, when ``allow_partial_path`` is ``true`` and ``to_id`` is disabled the search may take an unusually long time to finish.

.. rst-class:: classref-item-separator

----
Expand Down
4 changes: 4 additions & 0 deletions classes/class_astargrid2d.rst
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,8 @@ Returns an array with the IDs of the points that form the path found by AStar2D

If there is no valid path to the target, and ``allow_partial_path`` is ``true``, returns a path to the point closest to the target that can be reached.

\ **Note:** When ``allow_partial_path`` is ``true`` and ``to_id`` is solid the search may take an unusually long time to finish.

.. rst-class:: classref-item-separator

----
Expand Down Expand Up @@ -573,6 +575,8 @@ If there is no valid path to the target, and ``allow_partial_path`` is ``true``,

\ **Note:** This method is not thread-safe. If called from a :ref:`Thread<class_Thread>`, it will return an empty array and will print an error message.

Additionally, when ``allow_partial_path`` is ``true`` and ``to_id`` is solid the search may take an unusually long time to finish.

.. rst-class:: classref-item-separator

----
Expand Down
69 changes: 69 additions & 0 deletions classes/class_classdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Methods
+------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`class_exists<class_ClassDB_method_class_exists>`\ (\ class\: :ref:`StringName<class_StringName>`\ ) |const| |
+------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`APIType<enum_ClassDB_APIType>` | :ref:`class_get_api_type<class_ClassDB_method_class_get_api_type>`\ (\ class\: :ref:`StringName<class_StringName>`\ ) |const| |
+------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`class_get_enum_constants<class_ClassDB_method_class_get_enum_constants>`\ (\ class\: :ref:`StringName<class_StringName>`, enum\: :ref:`StringName<class_StringName>`, no_inheritance\: :ref:`bool<class_bool>` = false\ ) |const| |
+------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`class_get_enum_list<class_ClassDB_method_class_get_enum_list>`\ (\ class\: :ref:`StringName<class_StringName>`, no_inheritance\: :ref:`bool<class_bool>` = false\ ) |const| |
Expand Down Expand Up @@ -95,6 +97,61 @@ Methods

.. rst-class:: classref-descriptions-group

Enumerations
------------

.. _enum_ClassDB_APIType:

.. rst-class:: classref-enumeration

enum **APIType**: :ref:`🔗<enum_ClassDB_APIType>`

.. _class_ClassDB_constant_API_CORE:

.. rst-class:: classref-enumeration-constant

:ref:`APIType<enum_ClassDB_APIType>` **API_CORE** = ``0``

Native Core class type.

.. _class_ClassDB_constant_API_EDITOR:

.. rst-class:: classref-enumeration-constant

:ref:`APIType<enum_ClassDB_APIType>` **API_EDITOR** = ``1``

Native Editor class type.

.. _class_ClassDB_constant_API_EXTENSION:

.. rst-class:: classref-enumeration-constant

:ref:`APIType<enum_ClassDB_APIType>` **API_EXTENSION** = ``2``

GDExtension class type.

.. _class_ClassDB_constant_API_EDITOR_EXTENSION:

.. rst-class:: classref-enumeration-constant

:ref:`APIType<enum_ClassDB_APIType>` **API_EDITOR_EXTENSION** = ``3``

GDExtension Editor class type.

.. _class_ClassDB_constant_API_NONE:

.. rst-class:: classref-enumeration-constant

:ref:`APIType<enum_ClassDB_APIType>` **API_NONE** = ``4``

Unknown class type.

.. rst-class:: classref-section-separator

----

.. rst-class:: classref-descriptions-group

Method Descriptions
-------------------

Expand Down Expand Up @@ -134,6 +191,18 @@ Returns whether the specified ``class`` is available or not.

----

.. _class_ClassDB_method_class_get_api_type:

.. rst-class:: classref-method

:ref:`APIType<enum_ClassDB_APIType>` **class_get_api_type**\ (\ class\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_ClassDB_method_class_get_api_type>`

Returns the API type of ``class``. See :ref:`APIType<enum_ClassDB_APIType>`.

.. rst-class:: classref-item-separator

----

.. _class_ClassDB_method_class_get_enum_constants:

.. rst-class:: classref-method
Expand Down
2 changes: 1 addition & 1 deletion classes/class_compositoreffect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ The callback is called before our transparent rendering pass, but after our sky

:ref:`EffectCallbackType<enum_CompositorEffect_EffectCallbackType>` **EFFECT_CALLBACK_TYPE_POST_TRANSPARENT** = ``4``

The callback is called after our transparent rendering pass, but before any build in post effects and output to our render target.
The callback is called after our transparent rendering pass, but before any built-in post-processing effects and output to our render target.

.. _class_CompositorEffect_constant_EFFECT_CALLBACK_TYPE_MAX:

Expand Down
2 changes: 1 addition & 1 deletion classes/class_editorplugin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1593,7 +1593,7 @@ Removes an import plugin registered by :ref:`add_import_plugin<class_EditorPlugi

|void| **remove_inspector_plugin**\ (\ plugin\: :ref:`EditorInspectorPlugin<class_EditorInspectorPlugin>`\ ) :ref:`🔗<class_EditorPlugin_method_remove_inspector_plugin>`

Removes an inspector plugin registered by :ref:`add_import_plugin<class_EditorPlugin_method_add_import_plugin>`
Removes an inspector plugin registered by :ref:`add_inspector_plugin<class_EditorPlugin_method_add_inspector_plugin>`.

.. rst-class:: classref-item-separator

Expand Down
4 changes: 3 additions & 1 deletion classes/class_editorsettings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,8 @@ If ``true``, the Asset Library uses multiple threads for its HTTP requests. This

If ``true``, automatically switches to the **Remote** scene tree when running the project from the editor. If ``false``, stays on the **Local** scene tree when running the project from the editor.

\ **Warning:** Enabling this setting can cause stuttering when running a project with a large amount of nodes (typically a few thousands of nodes or more), even if the editor window isn't focused. This is due to the remote scene tree being updated every second regardless of whether the editor is focused.

.. rst-class:: classref-item-separator

----
Expand Down Expand Up @@ -3681,7 +3683,7 @@ The default property name style to display in the Inspector dock. This style can

If ``true``, add a margin around Array, Dictionary, and Resource Editors that are not already colored.

\ **Note:** If :ref:`interface/inspector/nested_color_mode<class_EditorSettings_property_interface/inspector/nested_color_mode>` is set to **Containers & Resources** this parameter will have no effect since those editors will already be colored
\ **Note:** If :ref:`interface/inspector/nested_color_mode<class_EditorSettings_property_interface/inspector/nested_color_mode>` is set to **Containers & Resources** this parameter will have no effect since those editors will already be colored.

.. rst-class:: classref-item-separator

Expand Down
2 changes: 1 addition & 1 deletion classes/class_enginedebugger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Returns ``true`` if the debugger is skipping breakpoints otherwise ``false``.

|void| **line_poll**\ (\ ) :ref:`🔗<class_EngineDebugger_method_line_poll>`

Forces a processing loop of debugger events. The purpose of this method is just processing events every now and then when the script might get too busy, so that bugs like infinite loops can be caught
Forces a processing loop of debugger events. The purpose of this method is just processing events every now and then when the script might get too busy, so that bugs like infinite loops can be caught.

.. rst-class:: classref-item-separator

Expand Down
2 changes: 2 additions & 0 deletions classes/class_filedialog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ Properties
+---------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`show_hidden_files<class_FileDialog_property_show_hidden_files>` | ``false`` |
+---------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
| :ref:`Vector2i<class_Vector2i>` | size | ``Vector2i(640, 360)`` (overrides :ref:`Window<class_Window_property_size>`) |
+---------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | title | ``"Save a File"`` (overrides :ref:`Window<class_Window_property_title>`) |
+---------------------------------------------------+-----------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`use_native_dialog<class_FileDialog_property_use_native_dialog>` | ``false`` |
Expand Down
2 changes: 1 addition & 1 deletion classes/class_fontfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ Removes all kerning overrides.

|void| **clear_size_cache**\ (\ cache_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FontFile_method_clear_size_cache>`

Removes all font sizes from the cache entry
Removes all font sizes from the cache entry.

.. rst-class:: classref-item-separator

Expand Down
Loading

0 comments on commit 936b648

Please sign in to comment.