From 77049548571a2360c4cc5a12bddf661c68c6dadf Mon Sep 17 00:00:00 2001 From: Godot Organization Date: Sat, 28 Dec 2024 03:20:51 +0000 Subject: [PATCH] classref: Sync with current master branch (99a8ab7) --- classes/class_@globalscope.rst | 4 +- classes/class_array.rst | 20 +++++----- classes/class_arraymesh.rst | 8 ++-- classes/class_displayserver.rst | 2 +- classes/class_dtlsserver.rst | 8 ++-- classes/class_editorimportplugin.rst | 10 ++--- classes/class_editorinterface.rst | 2 + classes/class_editorsettings.rst | 14 ------- .../class_editortranslationparserplugin.rst | 10 ++--- classes/class_geometry2d.rst | 2 +- classes/class_httpclient.rst | 2 +- classes/class_navigationpolygon.rst | 6 +-- classes/class_navigationserver2d.rst | 28 ++++++++++++++ classes/class_navigationserver3d.rst | 28 ++++++++++++++ classes/class_object.rst | 38 +++++++++---------- classes/class_os.rst | 10 ++--- classes/class_packedbytearray.rst | 2 +- classes/class_polygonpathfinder.rst | 16 ++++---- classes/class_projectsettings.rst | 14 +++++++ classes/class_string.rst | 2 +- classes/class_stringname.rst | 2 +- classes/class_window.rst | 6 +-- 22 files changed, 146 insertions(+), 88 deletions(-) diff --git a/classes/class_@globalscope.rst b/classes/class_@globalscope.rst index e2a6aa43908..d515825e912 100644 --- a/classes/class_@globalscope.rst +++ b/classes/class_@globalscope.rst @@ -2329,7 +2329,7 @@ Key Code mask. .. rst-class:: classref-enumeration-constant -:ref:`KeyModifierMask` **KEY_MODIFIER_MASK** = ``532676608`` +:ref:`KeyModifierMask` **KEY_MODIFIER_MASK** = ``2130706432`` Modifier key mask. @@ -6452,7 +6452,7 @@ Converts one or more arguments of any type to string in the best way possible an .. code-tab:: csharp - var a = new Godot.Collections.Array { 1, 2, 3 }; + Godot.Collections.Array a = [1, 2, 3]; GD.Print("a", "b", a); // Prints ab[1, 2, 3] diff --git a/classes/class_array.rst b/classes/class_array.rst index 098085d538e..4189e5e9cd4 100644 --- a/classes/class_array.rst +++ b/classes/class_array.rst @@ -35,14 +35,14 @@ An array data structure that can contain a sequence of elements of any :ref:`Var .. code-tab:: csharp - var array = new Godot.Collections.Array{"First", 2, 3, "Last"}; + Godot.Collections.Array array = ["First", 2, 3, "Last"]; GD.Print(array[0]); // Prints "First" GD.Print(array[2]); // Prints 3 - GD.Print(array[array.Count - 1]); // Prints "Last" + GD.Print(array[^1]); // Prints "Last" - array[2] = "Second"; + array[1] = "Second"; GD.Print(array[1]); // Prints "Second" - GD.Print(array[array.Count - 3]); // Prints "Second" + GD.Print(array[^3]); // Prints "Second" @@ -707,7 +707,7 @@ This method can often be combined with :ref:`resize` .. code-tab:: csharp - var array = new Godot.Collections.Array(); + Godot.Collections.Array array = []; array.Resize(5); array.Fill(2); GD.Print(array); // Prints [2, 2, 2, 2, 2] @@ -874,7 +874,7 @@ Returns ``true`` if the array contains the given ``value``. .. code-tab:: csharp - var arr = new Godot.Collections.Array { "inside", 7 }; + Godot.Collections.Array arr = ["inside", 7]; // By C# convention, this method is renamed to `Contains`. GD.Print(arr.Contains("inside")); // Prints True GD.Print(arr.Contains("outside")); // Prints False @@ -1068,7 +1068,7 @@ Returns a random element from the array. Generates an error and returns ``null`` .. code-tab:: csharp - var array = new Godot.Collections.Array { 1, 2, 3.25f, "Hi" }; + Godot.Collections.Array array = [1, 2, 3.25f, "Hi"]; GD.Print(array.PickRandom()); // May print 1, 2, 3.25, or "Hi". @@ -1355,7 +1355,7 @@ Sorts the array in ascending order. The final order is dependent on the "less th .. code-tab:: csharp - var numbers = new Godot.Collections.Array { 10, 5, 2.5, 8 }; + Godot.Collections.Array numbers = [10, 5, 2.5, 8]; numbers.Sort(); GD.Print(numbers); // Prints [2.5, 5, 8, 10] @@ -1448,8 +1448,8 @@ Appends the ``right`` array to the left operand, creating a new **Array**. This .. code-tab:: csharp // Note that concatenation is not possible with C#'s native Array type. - var array1 = new Godot.Collections.Array{"One", 2}; - var array2 = new Godot.Collections.Array{3, "Four"}; + Godot.Collections.Array array1 = ["One", 2]; + Godot.Collections.Array array2 = [3, "Four"]; GD.Print(array1 + array2); // Prints ["One", 2, 3, "Four"] diff --git a/classes/class_arraymesh.rst b/classes/class_arraymesh.rst index 5b1ea586e55..d26df0aa57c 100644 --- a/classes/class_arraymesh.rst +++ b/classes/class_arraymesh.rst @@ -46,16 +46,16 @@ The most basic example is the creation of a single triangle: .. code-tab:: csharp - var vertices = new Vector3[] - { + Vector3[] vertices = + [ new Vector3(0, 1, 0), new Vector3(1, 0, 0), new Vector3(0, 0, 1), - }; + ]; // Initialize the ArrayMesh. var arrMesh = new ArrayMesh(); - var arrays = new Godot.Collections.Array(); + Godot.Collections.Array arrays = []; arrays.Resize((int)Mesh.ArrayType.Max); arrays[(int)Mesh.ArrayType.Vertex] = vertices; diff --git a/classes/class_displayserver.rst b/classes/class_displayserver.rst index 0a9e3475221..493bc95a07d 100644 --- a/classes/class_displayserver.rst +++ b/classes/class_displayserver.rst @@ -4440,7 +4440,7 @@ Passing an empty array will disable passthrough support (all mouse events will b DisplayServer.WindowSetMousePassthrough(GetNode("Polygon2D").Polygon); // Reset region to default. - DisplayServer.WindowSetMousePassthrough(new Vector2[] {}); + DisplayServer.WindowSetMousePassthrough([]); diff --git a/classes/class_dtlsserver.rst b/classes/class_dtlsserver.rst index 7f0d3aaf062..c93162b1b44 100644 --- a/classes/class_dtlsserver.rst +++ b/classes/class_dtlsserver.rst @@ -39,7 +39,7 @@ Below a small example of how to use it: server.listen(4242) var key = load("key.key") # Your private key. var cert = load("cert.crt") # Your X509 certificate. - dtls.setup(key, cert) + dtls.setup(TlsOptions.server(key, cert)) func _process(delta): while server.is_connection_available(): @@ -66,19 +66,19 @@ Below a small example of how to use it: { private DtlsServer _dtls = new DtlsServer(); private UdpServer _server = new UdpServer(); - private Godot.Collections.Array _peers = new Godot.Collections.Array(); + private Godot.Collections.Array _peers = []; public override void _Ready() { _server.Listen(4242); var key = GD.Load("key.key"); // Your private key. var cert = GD.Load("cert.crt"); // Your X509 certificate. - _dtls.Setup(key, cert); + _dtls.Setup(TlsOptions.Server(key, cert)); } public override void _Process(double delta) { - while (Server.IsConnectionAvailable()) + while (_server.IsConnectionAvailable()) { PacketPeerUdp peer = _server.TakeConnection(); PacketPeerDtls dtlsPeer = _dtls.TakeConnection(peer); diff --git a/classes/class_editorimportplugin.rst b/classes/class_editorimportplugin.rst index 79924d0207d..18e3bc4b0b2 100644 --- a/classes/class_editorimportplugin.rst +++ b/classes/class_editorimportplugin.rst @@ -85,7 +85,7 @@ Below is an example EditorImportPlugin that imports a :ref:`Mesh` fr public override string[] _GetRecognizedExtensions() { - return new string[] { "special", "spec" }; + return ["special", "spec"]; } public override string _GetSaveExtension() @@ -110,14 +110,14 @@ Below is an example EditorImportPlugin that imports a :ref:`Mesh` fr public override Godot.Collections.Array _GetImportOptions(string path, int presetIndex) { - return new Godot.Collections.Array - { + return + [ new Godot.Collections.Dictionary { { "name", "myOption" }, { "default_value", false }, - } - }; + }, + ]; } public override Error _Import(string sourceFile, string savePath, Godot.Collections.Dictionary options, Godot.Collections.Array platformVariants, Godot.Collections.Array genFiles) diff --git a/classes/class_editorinterface.rst b/classes/class_editorinterface.rst index a944a284e79..899254d26c5 100644 --- a/classes/class_editorinterface.rst +++ b/classes/class_editorinterface.rst @@ -699,6 +699,8 @@ Plays the main scene. |void| **popup_create_dialog**\ (\ callback\: :ref:`Callable`, base_type\: :ref:`StringName` = "", current_type\: :ref:`String` = "", dialog_title\: :ref:`String` = "", type_blocklist\: :ref:`Array`\[:ref:`StringName`\] = [], type_suffixes\: :ref:`Dictionary` = {}\ ) :ref:`🔗` +**Experimental:** This method may be changed or removed in future versions. + Pops up an editor dialog for creating an object. The ``callback`` must take a single argument of type :ref:`StringName` which will contain the type name of the selected object or be empty if no item is selected. diff --git a/classes/class_editorsettings.rst b/classes/class_editorsettings.rst index f75bdfdcb91..1c3d3fbca99 100644 --- a/classes/class_editorsettings.rst +++ b/classes/class_editorsettings.rst @@ -273,8 +273,6 @@ Properties +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`editors/bone_mapper/handle_colors/unset` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`int` | :ref:`editors/grid_map/editor_side` | - +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`editors/grid_map/palette_min_width` | +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`editors/grid_map/pick_distance` | @@ -2275,18 +2273,6 @@ The modulate color to use for "past" frames displayed in the animation editor's ---- -.. _class_EditorSettings_property_editors/grid_map/editor_side: - -.. rst-class:: classref-property - -:ref:`int` **editors/grid_map/editor_side** :ref:`🔗` - -Specifies the side of 3D editor's viewport where GridMap's mesh palette will appear. - -.. rst-class:: classref-item-separator - ----- - .. _class_EditorSettings_property_editors/grid_map/palette_min_width: .. rst-class:: classref-property diff --git a/classes/class_editortranslationparserplugin.rst b/classes/class_editortranslationparserplugin.rst index 2285fd023cb..84ba7f0783d 100644 --- a/classes/class_editortranslationparserplugin.rst +++ b/classes/class_editortranslationparserplugin.rst @@ -69,7 +69,7 @@ Below shows an example of a custom parser that extracts strings from a CSV file public override string[] _GetRecognizedExtensions() { - return new string[] { "csv" }; + return ["csv"]; } } @@ -92,11 +92,11 @@ To add a translatable string associated with context or plural, add it to ``msgi .. code-tab:: csharp // This will add a message with msgid "Test 1", msgctxt "context", and msgid_plural "test 1 plurals". - msgidsContextPlural.Add(new Godot.Collections.Array{"Test 1", "context", "test 1 Plurals"}); + msgidsContextPlural.Add(["Test 1", "context", "test 1 Plurals"]); // This will add a message with msgid "A test without context" and msgid_plural "plurals". - msgidsContextPlural.Add(new Godot.Collections.Array{"A test without context", "", "plurals"}); + msgidsContextPlural.Add(["A test without context", "", "plurals"]); // This will add a message with msgid "Only with context" and msgctxt "a friendly context". - msgidsContextPlural.Add(new Godot.Collections.Array{"Only with context", "a friendly context", ""}); + msgidsContextPlural.Add(["Only with context", "a friendly context", ""]); @@ -126,7 +126,7 @@ To add a translatable string associated with context or plural, add it to ``msgi public override string[] _GetRecognizedExtensions() { - return new string[] { "gd" }; + return ["gd"]; } diff --git a/classes/class_geometry2d.rst b/classes/class_geometry2d.rst index 290d96a72b9..4bffcb0beb4 100644 --- a/classes/class_geometry2d.rst +++ b/classes/class_geometry2d.rst @@ -500,7 +500,7 @@ The operation may result in an outer polygon (boundary) and inner polygon (hole) .. code-tab:: csharp - var polygon = new Vector2[] { new Vector2(0, 0), new Vector2(100, 0), new Vector2(100, 100), new Vector2(0, 100) }; + Vector2[] polygon = [new Vector2(0, 0), new Vector2(100, 0), new Vector2(100, 100), new Vector2(0, 100)]; var offset = new Vector2(50, 50); polygon = new Transform2D(0, offset) * polygon; GD.Print((Variant)polygon); // Prints [(50, 50), (150, 50), (150, 150), (50, 150)] diff --git a/classes/class_httpclient.rst b/classes/class_httpclient.rst index ac1d509bd55..c8a1255c744 100644 --- a/classes/class_httpclient.rst +++ b/classes/class_httpclient.rst @@ -1092,7 +1092,7 @@ To create a POST request with query strings to push to the server, do: var fields = new Godot.Collections.Dictionary { { "username", "user" }, { "password", "pass" } }; string queryString = new HttpClient().QueryStringFromDict(fields); - string[] headers = { "Content-Type: application/x-www-form-urlencoded", $"Content-Length: {queryString.Length}" }; + string[] headers = ["Content-Type: application/x-www-form-urlencoded", $"Content-Length: {queryString.Length}"]; var result = new HttpClient().Request(HttpClient.Method.Post, "index.php", headers, queryString); diff --git a/classes/class_navigationpolygon.rst b/classes/class_navigationpolygon.rst index 8b2eecc205f..75ad745a7fd 100644 --- a/classes/class_navigationpolygon.rst +++ b/classes/class_navigationpolygon.rst @@ -39,7 +39,7 @@ To bake a navigation mesh at least one outline needs to be added that defines th .. code-tab:: csharp var newNavigationMesh = new NavigationPolygon(); - var boundingOutline = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0) }; + Vector2[] boundingOutline = [new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0)]; newNavigationMesh.AddOutline(boundingOutline); NavigationServer2D.BakeFromSourceGeometryData(newNavigationMesh, new NavigationMeshSourceGeometryData2D()); GetNode("NavigationRegion2D").NavigationPolygon = newNavigationMesh; @@ -63,9 +63,9 @@ Adding vertices and polygon indices manually. .. code-tab:: csharp var newNavigationMesh = new NavigationPolygon(); - var newVertices = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0) }; + Vector2[] newVertices = [new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0)]; newNavigationMesh.Vertices = newVertices; - var newPolygonIndices = new int[] { 0, 1, 2, 3 }; + int[] newPolygonIndices = [0, 1, 2, 3]; newNavigationMesh.AddPolygon(newPolygonIndices); GetNode("NavigationRegion2D").NavigationPolygon = newNavigationMesh; diff --git a/classes/class_navigationserver2d.rst b/classes/class_navigationserver2d.rst index 9a0b4ebe438..d0e10a4fdbe 100644 --- a/classes/class_navigationserver2d.rst +++ b/classes/class_navigationserver2d.rst @@ -199,6 +199,8 @@ Methods +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array`\[:ref:`RID`\] | :ref:`map_get_regions`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`map_get_use_async_iterations`\ (\ map\: :ref:`RID`\ ) |const| | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`map_get_use_edge_connections`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`map_is_active`\ (\ map\: :ref:`RID`\ ) |const| | @@ -211,6 +213,8 @@ Methods +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`map_set_link_connection_radius`\ (\ map\: :ref:`RID`, radius\: :ref:`float`\ ) | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`map_set_use_async_iterations`\ (\ map\: :ref:`RID`, enabled\: :ref:`bool`\ ) | + +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`map_set_use_edge_connections`\ (\ map\: :ref:`RID`, enabled\: :ref:`bool`\ ) | +-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`obstacle_create`\ (\ ) | @@ -1226,6 +1230,18 @@ Returns all navigation regions :ref:`RID`\ s that are currently assig ---- +.. _class_NavigationServer2D_method_map_get_use_async_iterations: + +.. rst-class:: classref-method + +:ref:`bool` **map_get_use_async_iterations**\ (\ map\: :ref:`RID`\ ) |const| :ref:`🔗` + +Returns ``true`` if the ``map`` synchronization uses an async process that runs on a background thread. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer2D_method_map_get_use_edge_connections: .. rst-class:: classref-method @@ -1298,6 +1314,18 @@ Set the map's link connection radius used to connect links to navigation polygon ---- +.. _class_NavigationServer2D_method_map_set_use_async_iterations: + +.. rst-class:: classref-method + +|void| **map_set_use_async_iterations**\ (\ map\: :ref:`RID`, enabled\: :ref:`bool`\ ) :ref:`🔗` + +If ``enabled`` is ``true`` the ``map`` synchronization uses an async process that runs on a background thread. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer2D_method_map_set_use_edge_connections: .. rst-class:: classref-method diff --git a/classes/class_navigationserver3d.rst b/classes/class_navigationserver3d.rst index 87fc2187ee8..17ee28dd2ad 100644 --- a/classes/class_navigationserver3d.rst +++ b/classes/class_navigationserver3d.rst @@ -219,6 +219,8 @@ Methods +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`map_get_up`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`map_get_use_async_iterations`\ (\ map\: :ref:`RID`\ ) |const| | + +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`map_get_use_edge_connections`\ (\ map\: :ref:`RID`\ ) |const| | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`map_is_active`\ (\ map\: :ref:`RID`\ ) |const| | @@ -237,6 +239,8 @@ Methods +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`map_set_up`\ (\ map\: :ref:`RID`, up\: :ref:`Vector3`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | |void| | :ref:`map_set_use_async_iterations`\ (\ map\: :ref:`RID`, enabled\: :ref:`bool`\ ) | + +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`map_set_use_edge_connections`\ (\ map\: :ref:`RID`, enabled\: :ref:`bool`\ ) | +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RID` | :ref:`obstacle_create`\ (\ ) | @@ -1501,6 +1505,18 @@ Returns the map's up direction. ---- +.. _class_NavigationServer3D_method_map_get_use_async_iterations: + +.. rst-class:: classref-method + +:ref:`bool` **map_get_use_async_iterations**\ (\ map\: :ref:`RID`\ ) |const| :ref:`🔗` + +Returns ``true`` if the ``map`` synchronization uses an async process that runs on a background thread. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer3D_method_map_get_use_edge_connections: .. rst-class:: classref-method @@ -1609,6 +1625,18 @@ Sets the map up direction. ---- +.. _class_NavigationServer3D_method_map_set_use_async_iterations: + +.. rst-class:: classref-method + +|void| **map_set_use_async_iterations**\ (\ map\: :ref:`RID`, enabled\: :ref:`bool`\ ) :ref:`🔗` + +If ``enabled`` is ``true`` the ``map`` synchronization uses an async process that runs on a background thread. + +.. rst-class:: classref-item-separator + +---- + .. _class_NavigationServer3D_method_map_set_use_edge_connections: .. rst-class:: classref-method diff --git a/classes/class_object.rst b/classes/class_object.rst index 15a71a7913e..4478b872264 100644 --- a/classes/class_object.rst +++ b/classes/class_object.rst @@ -355,14 +355,14 @@ Combined with :ref:`_set` and :ref:`_get_prope public override Godot.Collections.Array _GetPropertyList() { - return new Godot.Collections.Array() - { + return + [ new Godot.Collections.Dictionary() { { "name", "FakeProperty" }, - { "type", (int)Variant.Type.Int } - } - }; + { "type", (int)Variant.Type.Int }, + }, + ]; } @@ -445,11 +445,11 @@ The example below displays a list of numbers shown as words going from ``ZERO`` } } - private Godot.Collections.Array _numbers = new(); + private Godot.Collections.Array _numbers = []; public override Godot.Collections.Array _GetPropertyList() { - var properties = new Godot.Collections.Array(); + Godot.Collections.Array properties = []; for (int i = 0; i < _numberCount; i++) { @@ -690,14 +690,14 @@ Combined with :ref:`_get` and :ref:`_get_prope public override Godot.Collections.Array _GetPropertyList() { - return new Godot.Collections.Array() - { + return + [ new Godot.Collections.Dictionary() { { "name", "FakeProperty" }, - { "type", (int)Variant.Type.Int } - } - }; + { "type", (int)Variant.Type.Int }, + }, + ]; } @@ -810,19 +810,19 @@ Adds a user-defined signal named ``signal``. Optional arguments for the signal c .. code-tab:: csharp - AddUserSignal("Hurt", new Godot.Collections.Array() - { + AddUserSignal("Hurt", + [ new Godot.Collections.Dictionary() { { "name", "damage" }, - { "type", (int)Variant.Type.Int } + { "type", (int)Variant.Type.Int }, }, new Godot.Collections.Dictionary() { { "name", "source" }, - { "type", (int)Variant.Type.Object } - } - }); + { "type", (int)Variant.Type.Object }, + }, + ]); @@ -924,7 +924,7 @@ Calls the ``method`` on the object and returns the result. Unlike :ref:`call` | :ref:`navigation/pathfinding/max_threads` | ``4`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ + | :ref:`bool` | :ref:`navigation/world/map_use_async_iterations` | ``true`` | + +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`network/limits/debugger/max_chars_per_second` | ``32768`` | +---------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`network/limits/debugger/max_errors_per_second` | ``400`` | @@ -9196,6 +9198,18 @@ Maximum number of threads that can run pathfinding queries simultaneously on the ---- +.. _class_ProjectSettings_property_navigation/world/map_use_async_iterations: + +.. rst-class:: classref-property + +:ref:`bool` **navigation/world/map_use_async_iterations** = ``true`` :ref:`🔗` + +If enabled, navigation map synchronization uses an async process that runs on a background thread. This avoids stalling the main thread but adds an additional delay to any navigation map change. + +.. rst-class:: classref-item-separator + +---- + .. _class_ProjectSettings_property_network/limits/debugger/max_chars_per_second: .. rst-class:: classref-property diff --git a/classes/class_string.rst b/classes/class_string.rst index 7cfa63f0b92..2f90f6d02e8 100644 --- a/classes/class_string.rst +++ b/classes/class_string.rst @@ -1231,7 +1231,7 @@ Returns the concatenation of ``parts``' elements, with each element separated by .. code-tab:: csharp - var fruits = new string[] {"Apple", "Orange", "Pear", "Kiwi"}; + string[] fruits = ["Apple", "Orange", "Pear", "Kiwi"]; // In C#, this method is static. GD.Print(string.Join(", ", fruits)); // Prints "Apple, Orange, Pear, Kiwi" diff --git a/classes/class_stringname.rst b/classes/class_stringname.rst index 81c58628174..f56bd8467fd 100644 --- a/classes/class_stringname.rst +++ b/classes/class_stringname.rst @@ -1171,7 +1171,7 @@ Returns the concatenation of ``parts``' elements, with each element separated by .. code-tab:: csharp - var fruits = new string[] {"Apple", "Orange", "Pear", "Kiwi"}; + string[] fruits = ["Apple", "Orange", "Pear", "Kiwi"]; // In C#, this method is static. GD.Print(string.Join(", ", fruits)); // Prints "Apple, Orange, Pear, Kiwi" diff --git a/classes/class_window.rst b/classes/class_window.rst index fd88bfb20fc..8f1e7c72952 100644 --- a/classes/class_window.rst +++ b/classes/class_window.rst @@ -1326,13 +1326,13 @@ Passing an empty array will disable passthrough support (all mouse events will b .. code-tab:: csharp // Set region, using Path2D node. - GetNode("Window").MousePassthrough = GetNode("Path2D").Curve.GetBakedPoints(); + GetNode("Window").MousePassthroughPolygon = GetNode("Path2D").Curve.GetBakedPoints(); // Set region, using Polygon2D node. - GetNode("Window").MousePassthrough = GetNode("Polygon2D").Polygon; + GetNode("Window").MousePassthroughPolygon = GetNode("Polygon2D").Polygon; // Reset region to default. - GetNode("Window").MousePassthrough = new Vector2[] {}; + GetNode("Window").MousePassthroughPolygon = [];