Commit graph

5705 commits

Author SHA1 Message Date
reduz 5cecdfa8af Entirely removes BIND_VMETHOD in favor of GDVIRTUAL
* `_gui_input`, `_input`, `_unhandled_input` and `_unhandled_key_input` are now regular C++ virutal functions.
* Everything else converted to GDVIRTUAL
* BIND_VMETHOD is gone, always use the new syntax from now on.

Creating `_gui_input` method and using the binder to register events will no longer work, simply override the virtual function now.
2021-08-23 08:10:13 -03:00
Aaron Franke ae1702bee5
Replace HTTP links with HTTPS for sites with HTTPS versions 2021-08-22 20:13:11 -05:00
reduz 3682978aee Replace BIND_VMETHOD by new GDVIRTUAL syntax
* New syntax is type safe.
* New syntax allows for type safe virtuals in native extensions.
* New syntax permits extremely fast calling.

Note: Everything was replaced where possible except for `_gui_input` `_input` and `_unhandled_input`.
These will require API rework on a separate PR as they work different than the rest of the functions.

Added a new method flag METHOD_FLAG_OBJECT_CORE, used internally. Allows to not dump the core virtuals like `_notification` to the json API, since each language will implement those as it is best fits.
2021-08-22 08:23:58 -03:00
Aaron Franke ba96f31fad
Merge pull request #51919 from raulsntos/csharp-renames
Rename C# string extensions to follow GDScript
2021-08-21 16:55:37 -05:00
bruvzg e6801a098e [macOS] Request camera permission before session init. 2021-08-22 00:34:02 +03:00
Julien Nguyen 9bc5119d4e Fix assignment with operator on type member 2021-08-21 21:56:11 +02:00
Anilforextra c86db8b710 Remove redundant assignments.
Use used_in_transfer instead of used_in_compute twice.
2021-08-21 19:20:07 +05:45
Rémi Verschelde f5422c55fc
Merge pull request #49105 from vnen/gdscript-inner-preload-type
GDScript: Fix inner classes and preloaded scripts as types
2021-08-20 17:07:18 +02:00
George Marques 2e84a46a0f
GDScript: Make singleton functions be seen as static
Since those can be called without an instance.
2021-08-20 10:52:58 -03:00
Raul Santos f6a700e264 Rename C# string extensions to follow GDScript
Follow up to d9d77291bc.

Renames `String.Extension` -> `String.GetExtension()` and
`String.BaseName()` -> `String.GetBaseName()`.
This makes those methods more consistent with GDScript and with
the `GetBaseDir` method.
2021-08-20 13:52:57 +02:00
Rémi Verschelde 75697c0dfd
Merge pull request #51916 from mhilbrunner/vs-fix
Fix VisualScriptEditor after namespaces
2021-08-20 13:32:39 +02:00
Max Hilbrunner 2c98eede23 Fix VisualScriptEditor after namespaces 2021-08-20 13:11:29 +02:00
Ignacio Roldán Etcheverry d2c3a86844 C#: Fix bindings generator for Callable argument default value
Previously there weren't any Callable arguments with a default value,
but d4dd859991 introduced one.
2021-08-20 11:18:04 +02:00
Rémi Verschelde 603502c11c
Merge pull request #51902 from vnen/variant-internal-constructor
Fix initialization of objects in VariantInternal
2021-08-20 08:10:38 +02:00
George Marques a685535ad5
Fix initialization of objects in VariantInternal 2021-08-19 20:19:47 -03:00
George Marques 89695da337
GDScript: Fix memory leak when using self class as type 2021-08-18 18:58:45 -03:00
George Marques 1c8b076502
GDScript: Fix calling builtin static functions 2021-08-18 18:58:41 -03:00
George Marques 47545aeb1a
GDScript: Fix issue when calling new() on its own 2021-08-18 18:56:21 -03:00
George Marques 2ba4ee9198
GDScript: Fix inner classes and preloaded scripts as types 2021-08-18 18:56:21 -03:00
Rémi Verschelde c0bdea6a67
Merge pull request #51859 from nekomatata/bullet-body-motion-fixes
Fixes in Bullet body_test_motion
2021-08-18 22:46:10 +02:00
PouleyKetchoupp 45bc97b8b8 Fixes in Bullet body_test_motion
Synchronize fixes from the 3.x branch to keep Bullet code in sync for
later, even if it's disabled for now.
2021-08-18 13:18:19 -07:00
Max Hilbrunner 5161c97c9c Remove underscore hacks
Way less cruft. :)

Co-authored-by: Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com>
2021-08-17 16:10:28 +02:00
Max Hilbrunner 81f7d1890b Namespaces instead of underscore prefix for binds
Thanks to neikeq for the initial work.

Co-authored-by: Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com>
2021-08-17 16:10:09 +02:00
Rémi Verschelde 21a0af2686
Merge pull request #51762 from nekomatata/fix-crash-gdscript-cache
Fix crash when failing to load script from cache
2021-08-17 13:34:07 +02:00
PouleyKetchoupp 9973bf93ed Fix crash when failing to load script from cache 2021-08-16 16:27:25 -07:00
Rémi Verschelde cfdac0973c
Merge pull request #51698 from Paulb23/text-editor-settings
Reorganise text editor settings
2021-08-16 18:48:58 +02:00
Paulb23 bcfc591f86 Reorganise text editor settings 2021-08-16 17:18:49 +01:00
Ignacio Roldán Etcheverry 5ea500e599 Fix C# native instance bindings after recent re-write
This was needed after: 4469144891
2021-08-16 17:16:36 +02:00
Ricard Rovira Cubeles a8d12b5a61 Add constant to vector function parameters that don't actually modify their input.
Add more overloads of vector multiplication, required by templates to compile with float=64.
2021-08-15 16:45:37 +02:00
Rémi Verschelde 81512a3732
Style: Cleanup code using text_editor/completion/use_single_quotes 2021-08-13 21:27:57 +02:00
Rémi Verschelde 9e37336124
Merge pull request #51508 from AndreaCatania/mem-placement
Refactors the memnew_placement.
2021-08-13 14:58:02 +02:00
Rémi Verschelde 85e315d6e8
Merge pull request #51607 from aaronfranke/includes
Fix some unnecessary includes
2021-08-13 14:38:56 +02:00
AndreaCatania 98ceb60eb4 Refactors the memnew_placement.
With this commit the macro `memnew_placement` uses the standard memory
placement syntax: `new (mem) TheClass()`, and removes the outdated and
not used syntax:
```
_ALWAYS_INLINE_ void *operator new(size_t p_size, void *p_pointer, size_t check, const char *p_description) {
```

Thanks to this change, the function `memnew_placement` call is compatible with
any class, and can also initialize classes with non-empty constructor:
```
// This is valid, like before.
memnew_placement(mem, Variant);

// This works too:
memnew_placement(mem, Variant(123));
```
2021-08-13 10:18:34 +02:00
Anilforextra d73d8b8d78 Fix duplicate conditions. 2021-08-13 12:22:38 +05:45
Aaron Franke eb4902a455
Fix some unnecessary includes 2021-08-13 00:27:38 -05:00
kobewi 8a605d227d Prevent crash when awaiting in a getter/setter 2021-08-13 00:19:55 +02:00
Aaron Franke 03e2544d50
Use real_t and double where appropriate in Particles 2021-08-12 11:35:31 -05:00
Rémi Verschelde c89ad92c96
Merge pull request #51532 from nekomatata/layer-mask-accessors
Uniformize layer names, script methods and documentation
2021-08-12 17:55:11 +02:00
PouleyKetchoupp 989acbbe81 Uniformize layer names, script methods and documentation
- Back to 1-based layer names to make it clearer in editor UI
- Layer bit accessors are renamed to layer value and 1-based too
- Uniform errors and documentation in render and physics
- Fix a few remaining collision_layer used in place of collision_mask
2021-08-12 08:06:42 -07:00
Rémi Verschelde 6e9439198c
Resource: Remove unused _use_builtin_script() virtual method
And another piece of dead code found while searching for "use_builtin".
2021-08-12 12:16:17 +02:00
Marcel Admiraal cf771342cb Fix multiple issues with CSGPolygon 2021-08-12 09:52:38 +01:00
PouleyKetchoupp f9176a39ce Make radius & height in CapsuleShape3D independent
Also changed CapsuleMesh to make settings consistent between render and
physics.
2021-08-11 14:54:53 -07:00
Rémi Verschelde a57d420224
Merge pull request #51500 from timothyqiu/navmesh-doc 2021-08-11 14:12:56 +02:00
Haoyu Qiu 60298328ca Improve NavigationMesh typing, parameter validation and documentation 2021-08-11 18:18:10 +08:00
Rémi Verschelde c00303ff55
Merge pull request #47378 from aaronfranke/use-input-enums
Use key enum instead of plain integers for input code
2021-08-11 11:20:45 +02:00
Rémi Verschelde 2c88e1c15d
Merge pull request #51178 from Geometror/layout-options-textline-textparagraph
Various text layout improvements (TextLine, TextParagraph, Label, TextServer)
2021-08-11 07:51:57 +02:00
Hendrik Brucker 403f4902d0 Various text layout improvements (TextLine, TextParagraph, Label, TextServer) 2021-08-11 00:09:48 +02:00
Aaron Franke fa3a32a2d6
Use Key enum instead of plain integers 2021-08-10 16:26:55 -05:00
K. S. Ernest (iFire) Lee 18bd0fee5a
Merge pull request #49343 from theoway/node_auto_arrangement_graph_edit
Node Auto Arrangement in GraphEdit/VisualScript/VisualShader
2021-08-10 15:42:04 -04:00
Umang Kalra 12fc3f1eef Automatic arrangement of nodes in VisualScript/VisualShaders editors
This PR and commit adds the functionality to arrange nodes in VisualScript/VisualShader editor. The layout generated by this 
feature is compact, with minimum crossings between connections
& uniform horizontal & vertical gaps between the nodes. 

This work has been sponsored by GSoC '21.

Full list of additions/changes:
• Added arrange_nodes() method in GraphEdit module.
    • This method computes new positions for all the selected
      nodes by forming blocks and compressing them.
      The nodes are moved to these new positions. 
    • Adding this method to GraphEdit makes it available for 
      use in VisualScript/VisualShaders editors and its other
      subclasses. 
• Button with an icon has been added to call arrange_nodes() in GraphEdit. 
    • This button is inherited by VisualScript/VisualShaders editors
       to invoke the method.
• Undo/redo is functional with this method.
    • By using signals in arrange_nodes(), position changes are registered 
       in undo/redo stack of the subclass that is using the method. 
• Metadata of the method has been updated in ClassDB
• Method description has been added to class reference of GraphEdit
2021-08-11 00:44:28 +05:30
kobewi e0572f7ef7 Fix crash when parsing Dictionary 2021-08-10 15:57:56 +02:00
Rémi Verschelde 50d5569ad4
Merge pull request #51457 from nekomatata/moving-platforms-3d
Fix 3D moving platform logic
2021-08-10 14:12:01 +02:00
PouleyKetchoupp ec9fed69f4 Fix 3D moving platform logic
Same thing that was already done in 2D, applies moving platform motion
by using a call to move_and_collide that excludes the platform itself,
instead of making it part of the body motion.

Helps with handling walls and slopes correctly when the character walks
on the moving platform.

Also made some minor adjustments to the 2D version and documentation.

Co-authored-by: fabriceci <fabricecipolla@gmail.com>
2021-08-09 20:21:04 -07:00
SaracenOne 861bb3a488 Automatically call the _init function on base class if one does not exist. 2021-08-10 02:41:44 +01:00
Aaron Franke 430ad75963
Some work on double support 2021-08-09 17:43:48 -05:00
Rémi Verschelde c68b109f27
Merge pull request #51453 from Blackiris/fix-new-inherited-script
Fix infinite loop when creating a newly inherited GDScript file
2021-08-10 00:38:16 +02:00
Julien Nguyen 51b7179b5a Fix infinite loop when creating a newly inherited GdScript file 2021-08-09 23:52:31 +02:00
Rémi Verschelde 2de5d2361a
Merge pull request #51446 from nekomatata/fix-moving-platform-rotation
Fix applied rotation from moving platforms in move_and_slide
2021-08-09 23:20:44 +02:00
PouleyKetchoupp 5650c83e4b Fix applied rotation from moving platforms in move_and_slide
When synchronizing CharacterBody motion with moving the platform using
direct body state, only the linear velocity was taken into account.

This change exposes velocity at local point in direct body state and
uses it in move_and_slide to get the proper velocity that includes
rotations.
2021-08-09 12:30:17 -07:00
Aaron Franke 84f720966c
Use doubles for time in many other places 2021-08-09 14:05:42 -05:00
Rémi Verschelde 6e11017401
Merge pull request #51338 from V-Sekai/gltf-lights
Continue when glTF2 lights fail to parse.
2021-08-09 09:31:31 +02:00
Rémi Verschelde fa1a66dd68
Merge pull request #51180 from RandomShaper/native_script_inherits
Implement inherits_script() for NativeScript and PluginScript
2021-08-09 09:18:57 +02:00
K. S. Ernest (iFire) Lee 0c79a8fa22 Continue when glTF2 lights fail to parse. 2021-08-09 00:09:19 -07:00
bruvzg 7c3c5603d0 [Text Server] Improve object (image/table) inline alignment. 2021-08-08 22:35:47 +03:00
Rémi Verschelde 35b08b7cbc
Merge pull request #51322 from raulsntos/fix-msbuild-exception
Ensure MSBuildPanel buttons are instantiated
2021-08-07 12:19:26 +02:00
AndreaCatania e4e4a02d3d Removes const from set functions on the Gizmos 2021-08-07 09:15:57 +02:00
Raul Santos f20db58271 Ensure MSBuildPanel buttons are instantiated 2021-08-06 22:30:38 +02:00
Francois Belair 070d634966 Fix LSP completion crashing on scene-less scripts 2021-08-06 14:55:05 -04:00
Rémi Verschelde c44ebb020d
HTML5: Fix warnings and re-enable werror=yes on CI
Add a missing call to disable warnings on a forked env for freetype's
`sfnt.c`.
2021-08-06 12:12:37 +02:00
Rémi Verschelde 6ded4f52e8
Merge pull request #51283 from Razoric480/lsp-parse-from
Fix LSP parsing get_node only from the scene root
2021-08-06 10:13:09 +02:00
Rémi Verschelde 2f1bc509dc
Merge pull request #51301 from Faless/mp/4.x_gd_default_rpc
[Net] Default @rpc annotation should be puppet, not master.
2021-08-06 09:08:09 +02:00
Rémi Verschelde ba0982c51c
Merge pull request #51008 from raulsntos/csharp-renames 2021-08-06 09:07:02 +02:00
Fabio Alessandrelli d7dca072aa [Net] Default @rpc annotation should be puppet, not master. 2021-08-06 02:39:22 +02:00
Fabio Alessandrelli a816d74fdf [Net] Fix ENetMultiplayerPeer status during connection.
While the client emitting "peer_connect" for the server, the status was
still set to CONNECTION_CONNECTING, causing bugs in the upper layer.
2021-08-06 02:00:56 +02:00
Francois Belair 03f8fa9f62 Fix LSP parsing get_node only from the scene root 2021-08-05 12:30:06 -04:00
Raul Santos 2deefd938f Reduce C# Dictionary internal calls
- Implements new `KeyValuePairs` and `KeyValuePairAt` internal calls
to get the `key` and the `value` in one call.
- Caches the `DictionaryEntry` to reuse properties without repeating
internal calls.
2021-08-05 17:30:28 +02:00
Raul Santos 0669ffcd15 Add documentation to Dictionary in C#
Adds documentation to `Godot.Collections.Dictionary` in C#.
2021-08-05 17:30:27 +02:00
Raul Santos d2655cb131 Rename RotationQuaternion to be more similar to get_rotation_quaternion
Renames `RotationQuaternion` to be more consistent with `get_rotation_quaternion`
2021-08-05 17:29:55 +02:00
Raul Santos 5330c83690 Rename RandSeed to RandFromSeed and use ref param
Renames `RandSeed` method to be more consistent with `Math::rand_from_seed`
2021-08-05 17:29:55 +02:00
Rémi Verschelde a544e77822
Merge pull request #51247 from pycbouh/docs-extract-theme-items
Add theme item descriptions to the online documentation
2021-08-05 00:18:56 +02:00
Rémi Verschelde 73b1f5ac79
Merge pull request #48615 from Razoric480/lsp-rename
Implement LSP didSave notification and rename request
2021-08-05 00:18:31 +02:00
Yuri Sizov bf2839ea3e Add theme item descriptions to the online documentation 2021-08-04 22:27:10 +03:00
Rémi Verschelde 0cee8831b2
Merge pull request #51005 from Faless/mp/4.x_channels
[Net] Implement RPC channels in MultiplayerAPI.
2021-08-04 09:31:33 +02:00
31 6fd2edddc0 Fix 'script_class' null access when reloading a deleted C# script 2021-08-03 22:43:42 -05:00
Raul Santos ad460cde79 Simplify C# print methods
- Extracts the parameters logic to a single method
- Simplify the handling of null parameters
2021-08-03 23:12:27 +02:00
Yuri Sizov d3e413c659 Fix the editor theme application for the Mono build log 2021-08-03 22:13:32 +03:00
Fabio Alessandrelli 80fc90e82a
Merge pull request #50454 from Ev1lbl0w/gsoc21-dap
Implemented initial DAP support
2021-08-03 17:12:37 +02:00
Pedro J. Estébanez 2dcd064056 Implement inherits_script() for NativeScript and PluginScript 2021-08-02 17:50:50 +02:00
Haoyu Qiu 0ca38ffe76 Validates VisualScript.add_node input node 2021-08-02 23:36:13 +08:00
Ev1lbl0w 7bccd5487e
Implemented initial DAP support
Implemented "output" event

Refactored "seq" field generation

Prevent debugging when editor and client are in different projects

Removed unneeded references to peer on the parser

Refactored way to detect project path

Implemented "setBreakpoints" request

Fix double events when terminating from client

Refactored "stopped" event

Implemented "stopped" with breakpoint event

Implemented "stackTrace", "scopes" and "variables" request

Report incoming number of stack dump variables

Implemented proper reporting of scopes and variables from stack frames

Prevent editor from grabbing focus when a DAP session is active

Implemented "next" and "stepIn" requests

Implemented "Source" checksum computing

Switched expected errors from macros to silent guards

Refactored message_id

Respect client settings regarding lines/columns behavior

Refactored nested DAP fields

Implement reporting of "Members" and "Globals" scopes as well

Fix error messages not being shown, and improved wrong path message
2021-08-02 10:43:35 +01:00
Rémi Verschelde 8465ecc3ae
Merge pull request #51036 from winterpixelgames/master-ws-fix
WebsocketPeer outbound buffer fixes and buffer size query
2021-08-01 11:12:15 +02:00
Jordan Schidlowsky de02cf44ae Websocket peer outbound buffer fixes. Expose outbound buffered amount. 2021-07-31 19:48:31 -06:00
Rémi Verschelde 6acbcf7a86
Merge pull request #50625 from nekomatata/body-one-direction-layers
One-directional collision layer check for rigid bodies and soft bodies
2021-07-31 22:12:46 +02:00
Haoyu Qiu 284c6c81eb Make action names translatable 2021-07-31 22:19:51 +08:00
Aaron Franke 2733b9abd8
Remove obsolete "dectime" method
Replaced by "move_toward"
2021-07-30 16:41:28 -05:00
Haoyu Qiu 0f1e107ede Do nothing when dragging CSGBox handle perpendicular to the camera 2021-07-31 02:25:05 +08:00
Fabio Alessandrelli 2cf39b97ae [Net] Implement RPC channels in MultiplayerAPI. 2021-07-30 17:29:50 +02:00
Rémi Verschelde 23bf04ae9a
Merge pull request #51052 from V-Sekai/gltf-fallbacks
glTF2 fallback load PNG and JPG
2021-07-30 17:04:29 +02:00
Rémi Verschelde 83ccf39adc
Merge pull request #51067 from akien-mga/doc-return-argument-self-closing-tags
doc: Use self-closing tags for `return` and `argument`
2021-07-30 16:42:52 +02:00
K. S. Ernest (iFire) Lee ddff1c10c3 glTF2 fallback load PNG and JPG 2021-07-30 07:30:50 -07:00
Rémi Verschelde 7adf4cc9b5
doc: Use self-closing tags for return and argument
For the time being we don't support writing a description for those, preferring
having all details in the method's description.

Using self-closing tags saves half the lines, and prevents contributors from
thinking that they should write the argument or return documentation there.
2021-07-30 15:29:52 +02:00
Fabio Alessandrelli b4fc69e0e2 [Net] Fix ENet 'connect_to_host' creating only one channel.
Passing `0` to `enet_host_create` will allow the maximum amount of
channel supported by ENet. For some reasons, `connect_to_host` will
instead only create 1 channel when passed `0`.
This commit normalize the behaviour to always allocate the maximum
allowed channels when passing `0`.
2021-07-30 15:25:37 +02:00
K. S. Ernest (iFire) Lee 882f7d9bdf In glTF2 animations, log spam less when running. 2021-07-29 22:56:19 -07:00
Rémi Verschelde bdcc8741e4
Merge pull request #51009 from raulsntos/fix-csharp-split
Use `allowEmpty` parameter in Split
2021-07-29 23:04:39 +02:00
Rémi Verschelde 44012fa61d
Merge pull request #51022 from raulsntos/csharp-interpolated-strings
Use C# interpolated strings
2021-07-29 22:12:45 +02:00
Raul Santos 37d8f8c92b Use C# interpolated strings
Uses interpolated strings wherever possible.
String concatenations are still left where used for breaking long lines.
2021-07-29 17:20:44 +02:00
Raul Santos b7a66a820b Use allowEmpty parameter in Split 2021-07-29 12:57:35 +02:00
Fabio Alessandrelli f39547b9bd [Net] Refactor ENetMultiplayerPeer to use ENet wrappers. 2021-07-29 10:59:00 +02:00
Fabio Alessandrelli 42a1777531 [Net] Implement lower level ENet wrappers. 2021-07-29 10:59:00 +02:00
Fabio Alessandrelli 1e8bf86379 [Net] Add generate_unique_id to MultiplayerPeer.
Used by ENetMultiplayerPeer and WebSocketServer to generate network IDs,
and exposed to the user for p2p networks (e.g. WebRTCMultiplayerPeer)
and custom MultiplayerPeer implementations.
2021-07-29 10:40:03 +02:00
Rémi Verschelde d426523440
Merge pull request #49723 from aaronfranke/fix-csg-sphere
Fix CSGSphere3D mesh creation
2021-07-28 09:02:07 +02:00
Rémi Verschelde 1777d8008e
Merge pull request #50913 from Razoric480/lsp-SymbolKind-fix
Fix LSP reporting wrong types
2021-07-27 13:32:41 +02:00
Rémi Verschelde 7cbdb9b4c3
Merge pull request #50917 from raulsntos/more-iterators 2021-07-27 08:05:15 +02:00
Raul Santos d636ebbfe9 Ignore paths with invalid chars in PathWhich 2021-07-27 04:16:20 +02:00
Raul Santos 3fe67fb5ad Use C++ iterators in the Mono module 2021-07-27 02:48:28 +02:00
Francois Belair 41ef9cf789 Fix LSP reporting wrong types 2021-07-26 16:26:23 -04:00
Rémi Verschelde 92299989bd
Use Ref<T> references as iterators where relevant
And const when possible.
2021-07-26 19:27:11 +02:00
Rémi Verschelde 8f6c16e4a4
Merge pull request #50847 from reduz/implement-binary-shader-compilation
Implement Binary Shader Compilation
2021-07-26 17:09:48 +02:00
reduz cf3f404d31 Implement Binary Shader Compilation
* Added an extra stage before compiling shader, which is generating a binary blob.
* On Vulkan, this allows caching the SPIRV reflection information, which is expensive to parse.
* On other (future) RenderingDevices, it allows caching converted binary data, such as DXIL or MSL.

This PR makes the shader cache include the reflection information, hence editor startup times are significantly improved.
I tested this well and it appears to work, and I added a lot of consistency checks, but because it includes writing and reading binary information, rare bugs may pop up, so be aware.
There was not much of a choice for storing the reflection information, given shaders can be a lot, take a lot of space and take time to parse.
2021-07-26 08:40:39 -03:00
Rémi Verschelde 54f6b30bd4
Merge pull request #50840 from Gallilus/VisualScript-drop-preload-nodes-change-action-name
Change "Add Preload Node" action to "Add Node(s)"
2021-07-26 08:29:31 +02:00
Aaron Franke b2156b22ea
Fix CSGSphere3D mesh creation 2021-07-26 00:09:52 -04:00
Ignacio Roldán Etcheverry 0c68ccecda
Merge pull request #50867 from aaronfranke/cs-array-empty
Add documentation to Array in C#
2021-07-26 04:46:35 +02:00
Raul Santos accd05f4ad Use Array.Empty instead of allocating a every time
Use `System.Array.Empty<T>` to get an empty array instead of allocating
a new one every time. Since arrays are immutable there is no need to
allocate them every time.
2021-07-26 03:52:31 +02:00
Aaron Franke 080f44a3b7
Add documentation to Array in C# 2021-07-25 18:04:18 -04:00
Raul Santos b3274a7064 Fix bindings generator range iterator errors 2021-07-25 21:32:54 +02:00
Julien Nguyen 6938dd72f2 Fix instantiate line class 2021-07-25 14:20:31 +02:00
Gallilus 70a6ff0a71
Change "Add Preload Node" action to "Add Node(s)"
The action might also drop Custom Nodes
2021-07-25 13:47:57 +02:00
Rémi Verschelde ff0b5f8fa1
Merge pull request #50809 from akien-mga/iterators-const-references 2021-07-25 12:52:58 +02:00
Rémi Verschelde ac3322b0af
Use const references where possible for List range iterators 2021-07-25 12:22:25 +02:00
luz paz 3564c16cb8
Fix various typos with codespell
Found via `codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,fave,findn,hist,inout,leapyear,lod,nd,numer,ois,ony,paket,seeked,sinc,switchs,te,uint`
2021-07-25 11:21:51 +02:00
Raul Santos ba99387bf3 Fix documentation in StringExtensions 2021-07-24 22:58:41 +02:00
Ignacio Roldán Etcheverry 2ee395a277
Merge pull request #50757 from aaronfranke/simple-cs-editorconfig
Add a simple C# `.editorconfig`
2021-07-24 21:48:41 +02:00
Aaron Franke 4e6efd1b07
Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
Aaron Franke 5f8275d9ac
Add a simple C# .editorconfig 2021-07-23 17:04:53 -04:00
Rémi Verschelde 4c3d5850de
Merge pull request #50748 from JFonS/gizmo_rework
Node3D gizmo improvements
2021-07-23 21:55:16 +02:00
Rémi Verschelde 28160e1a6f
Merge pull request #50779 from DavidCambre/Revert-unnecessary-changes
Revert unnecessary changes to VisualScriptEmitSignal
2021-07-23 21:53:21 +02:00
jfons cfb555a081 Node3D gizmo improvements
* Clean-up of node_3d_editor_plugin.{h,cpp}: removed unused code, fixed some bugs.
* Moved node_3d_editor_gizmos.{h,cpp} to editor/plugins.
* Added support for multiple gizmos per node. This means custom gizmos will no longer override the built-in ones and that multiple gizmos can be used in more complex nodes.
* Added support for handle IDs. When adding handles to a gizmo, an ID can be specified for each one, making it easier to work with gizmos that have a variable number of handles.
* Added support for subgizmos, selectable elements that can be transformed without needing a node of their own. By overriding _subgizmo_intersect_frustum() and/or _subgizmo_intersect_ray() gizmos can define which subgizmos should be selected on a region or click selection. Subgizmo transformations are applied using get/set/commit virtual methods, similar to how handles work.
2021-07-23 21:01:10 +02:00
David Cambré 74ca014364 Revert unnecessary changes to VisualScriptEmitSignal
Revert unnecessary changes to VisualScriptEmitSignal, commit 2032b56005b2f6add6b105a00f04c05f9b292eec
2021-07-23 19:34:27 +02:00
Andrea Catania 2cd347f4fa
Fix GLTF crash when the material is not set.
Sometimes there are meshes that doesn't have materials, so make sure to check this case before extracting the name.
2021-07-23 11:54:22 +02:00
Rémi Verschelde 7a6d77ec9e
Merge pull request #50704 from dsnopek/webrtc-gdnative-version
Update GDNative API version for changes from #50659
2021-07-22 12:47:19 +02:00
Hugo Locurcio 8ff8c1e5f8
Improve documentation for GDScript constants 2021-07-22 09:50:24 +02:00
David Snopek fee3e6b960 Update GDNative API version for changes from #50659 2021-07-21 10:28:16 -05:00
Rémi Verschelde a0aeb56424
Merge pull request #50688 from AndreaCatania/AndreaCatania-patch-4
Set the surface name when GLTF file is imported.
2021-07-21 15:53:52 +02:00
Rémi Verschelde 88bf6e1c6d
Merge pull request #48972 from DavidCambre/Expose_VisualScriptCustomNode_TypeHints_m 2021-07-21 12:02:17 +02:00
Rémi Verschelde 2273f13fbe
Merge pull request #50686 from Calinou/use-standard-inf-nan-constants
Use the standard C `INFINITY` and `NAN` constants directly
2021-07-21 11:50:26 +02:00
Andrea Catania c174a598b1
Set the surface name when GLTF file is imported. 2021-07-21 11:28:49 +02:00
Rémi Verschelde b5f5fac840
Merge pull request #49749 from DavidCambre/VisualScriptFunction_Call_Set_Get_Improvement-2
VisualScriptFunctionNodes Improvements
2021-07-21 11:22:59 +02:00
Rémi Verschelde d4bbdb8367
Merge pull request #50521 from aaronfranke/iseqapprox
Use `is_equal_approx` in more places
2021-07-21 11:16:19 +02:00
David Cambré 1c4c0f9960 expose type hints for VisualScriptCustomNode
Co-Authored-By: Rémi Verschelde <rverschelde@gmail.com>
2021-07-21 10:52:45 +02:00
Hugo Locurcio 4bd5e4fd9b
Use the standard C INFINITY and NAN constants directly
The `Math_INF` and `Math_NAN` defines were just aliases for those
constants, so we might as well use them directly.

Some portions of the code were already using `INFINITY` directly.
2021-07-21 10:41:08 +02:00
David Cambré 10b4cb75f2 Improve and streamline VisualScriptFuncNodes Call Set Get
This PR improves and streamlines the workflow for VisualScriptFunctionNodes Call Set Get
Uniform design.
Drag in set-get from tree is now working.
Removes redundant method_select popup.
2021-07-21 10:15:36 +02:00
Rémi Verschelde 2642f0e4fc
WebXR: Fix build after SNAME addition
Was missed as WebXR build was disabled prior to #50563.
2021-07-21 09:28:42 +02:00
Rémi Verschelde a255b186bc
Merge pull request #50563 from dsnopek/webxr-enable-ci
Re-enable building WebXR in GitHub Actions
2021-07-21 09:05:37 +02:00
Aaron Franke 78b0a7da03
Use is_equal_approx in more places 2021-07-21 00:32:37 -04:00
Fabio Alessandrelli ff85bbc41c
Merge pull request #50658 from dsnopek/webrtc-get-buffered-amount
Add get_buffered_amount() to WebRTCDataChannel
2021-07-21 06:28:08 +02:00
Nick Huelin e50ab50169 Fix visual script icons
This pull request fixes an issue where the visual script icons weren't representative of their data.
2021-07-20 17:23:42 -04:00
David Snopek abb45f5fe7 Add get_buffered_amount() to WebRTCDataChannel 2021-07-20 12:58:39 -05:00
Fabio Alessandrelli de4ad63e6f
Merge pull request #49882 from Faless/mp/4.x_rpc_gd
[Net] New `@rpc` annotation, "sync" is no longer part of mode.
2021-07-20 13:55:54 +02:00
Rémi Verschelde 124e27b7b2
Merge pull request #50581 from DavidCambre/VisualScript-Drop-Custom-Nodes
Allow dropping custom node scripts in VisualScript editor
2021-07-20 12:46:50 +02:00
Fabio Alessandrelli ddb68f76ff [Net] Single rpc annotation. "sync" no longer part of mode.
- Move the "sync" property for RPCs to RPCConfig.

- Unify GDScript annotations into a single one:
  - `@rpc(master)` # default
  - `@rpc(puppet)`
  - `@rpc(any)` # former `@remote`

- Implement three additional `@rpc` options:
  - The second parameter is the "sync" option (which also calls the
    function locally when RPCing). One of "sync", "nosync".
  - The third parameter is the transfer mode (reliable, unreliable,
    ordered).
  - The third parameter is the channel (unused for now).
2021-07-20 11:17:59 +02:00
PouleyKetchoupp 940838c174 One-directional collision layer check for rigid bodies and soft bodies
Check for each body individually if it collides with the other one or
ignores it.

When a body is being ignored, the other body's mass is considered
infinite when applying impulses to avoid extra overlapping.
2021-07-19 17:24:04 -07:00
Marcel Admiraal b8fe576355 Ensure KinematicBodies only interact with other Bodies with matching mask. 2021-07-19 17:03:43 +01:00
Rémi Verschelde 855c7c7414
Merge pull request #50566 from reduz/optimize-stringname-usage
Optimize StringName usage
2021-07-19 15:20:25 +02:00
reduz 6631f66c2a Optimize StringName usage
* Added a new macro SNAME() that constructs and caches a local stringname.
* Subsequent usages use the cached version.
* Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time.
* Replaced all theme usages by this new macro.
* Replace all signal emission usages by this new macro.
* Replace all call_deferred usages by this new macro.

This is part of ongoing work to optimize GUI and the editor.
2021-07-18 21:20:02 -03:00
Yuri Roubinsky 88088f351a Prevents some warnings from appearing in visual scripts 2021-07-18 19:41:51 +03:00
David Cambré aefde680a4 VisualScript-Drop-Custom-Nodes
Allows to drop custom node scripts directly in VisualScript
2021-07-18 15:48:35 +02:00
David Snopek 756ed308ee Fix "IDHandler.get_prop is not a function" error when calling some methods on WebRTCDataChannel 2021-07-17 20:03:37 -05:00
David Snopek 3963a11b2f Re-enable building WebXR in GitHub Actions 2021-07-17 15:37:35 -05:00
Francois Belair 7c5335081c Implement didSave notification and rename request 2021-07-17 11:50:00 -04:00
Meriipu 1475f617a3 Expose the resource name the client used to the websocket server
This information is exposed to the websocket server through the
client_connected-signal.

example.com/chat?id=10 gives the resource name "/chat?id=10"
2021-07-17 07:48:18 +02:00
Hugo Locurcio 97d8608c7d
Enable range coder compression by default in NetworkedMultiplayerENet
From empirical testing, this seems to provide the best compression
compared to other compression algorithms when used in the
Multiplayer Bomber demo.

Other algorithms may provide better compression ratios for more
complex games, but some compression is probably better than
no compression.

Zstandard was also not very efficient in my testing, so I added
a note in the documentation.
2021-07-16 21:49:02 +02:00
Rémi Verschelde 9427bf3842
Merge pull request #50480 from Faless/js/4.x_ci 2021-07-15 16:20:17 +02:00
Fabio Alessandrelli 3d8acc7a54 [HTML5] Fix build (with module_webxr_enabled=no).
The XR API changed a bit, and it's not just a rename, though probably an
easy update for someone who is qualified :).
2021-07-15 14:37:21 +02:00
Rémi Verschelde 671467b888
Mono: Remove info dialog discouraging use in production
While there are still various bugs to solve and features to implement, the C#
support as of Godot 3.4 is fairly mature and already used by a number of users
in production. Now that we default to dotnet CLI as build tool, it also seems
to be more reliable than MSBuild.

The documentation can (and does for the most part) point out some caveats that
users should be aware of, but this info dialog has outlived its intended
purpose.
2021-07-15 11:48:19 +02:00
Rémi Verschelde 06568bbfdf
Misc cleanup of header includes
Was looking for misuse of module headers without checking that the module is
actually enabled and got carried away...
2021-07-15 00:46:43 +02:00
Tomasz Chabora 1054956461 Document remaining Visual Script classes 2021-07-13 23:43:46 +02:00
Rémi Verschelde 4e4bcbc986
Merge pull request #47604 from christinoleo/master
Separate underscore from grapheme punctuation to enable doubleclick and caret jump over snakecase variables in editor
2021-07-13 19:09:11 +02:00
Rémi Verschelde 8747f25653
Merge pull request #50381 from reduz/implement-disable-classes
Implement the ability to disable classes
2021-07-13 15:31:38 +02:00
Leonardo Christino 8b91828e4f Separate underscore from grapheme punctuation to enable doubleclick and caret jump over snakecase variables in editor 2021-07-13 10:03:26 -03:00
reduz 5ad4f26659 Implement the ability to disable classes
* This PR adds the ability to disable classes when building.
* For now it's only possible to do this via command like:
  `scons disable_classes=RayCast2D,Area3D`
* Eventually, a proper UI will be implemented to create a build config file to do this at large scale, as well as detect what is used in the project.
2021-07-13 09:25:14 -03:00
Rémi Verschelde aab6dc301c
Merge pull request #50086 from Geometror/label-improve-layout-options
Improvements to Label's layout options
2021-07-13 13:10:42 +02:00
Rémi Verschelde fc00a83901
Merge pull request #50262 from nekomatata/convex-hull-simplification
Options to clean/simplify convex hull generated from mesh
2021-07-12 22:15:40 +02:00
Fabio Alessandrelli 97e763dddf [Net] Rename WebRTCMultiplayer to WebRTCMultiplayerPeer. 2021-07-12 16:36:34 +02:00
Fabio Alessandrelli b31e8530b2 [Net] Rename NetworkedMultiplayerENet to ENetMultiplayerPeer. 2021-07-12 16:36:34 +02:00
Fabio Alessandrelli 88d68346ee [Net] Rename NetworkedMultiplayerPeer to MultiplayerPeer. 2021-07-12 16:36:34 +02:00
Fabio Alessandrelli 31142ac3ee [Net] Remove most multiplayer hooks from SceneTree.
Use `multiplayer` or `get_multiplayer()` instead of `get_tree()`.
2021-07-12 15:28:01 +02:00
Yuri Roubinsky f9ab70eb60 Fix creating a new function in visual scripts 2021-07-10 14:45:53 +03:00
Rémi Verschelde ca2fda629f
Merge pull request #50290 from reduz/redo-instance-bindings
Redo how instance bindings work
2021-07-09 23:25:33 +02:00
reduz 4469144891 Redo how instance bindings work
* The harcoded 8 slots are no more and impose limits in the new extension system.
* New system is limitless, although it will impose small performance hit with a mutex.
* Use a token to request the instance binding.

**Warning**: Mono will most likely break as a result of this, will need to be modified to use the new system.
2021-07-08 17:08:12 -03:00
Julien Nguyen bf8795c7af Fix crash when writing $. in the editor 2021-07-08 20:49:57 +02:00
Francois Belair 10429019ad Implement didClose notification in LSP 2021-07-08 11:40:15 -04:00
PouleyKetchoupp 1de995ae99 Options to clean/simplify convex hull generated from mesh
Clean: remove duplicate and interior vertices (uses Bullet algorithm)
Simplify: modify the geometry for further simplification (uses VHACD
algorithm)

In the editor, single convex hull now uses the clean option.
Added a new editor entry to create a simplified convex hull, can be
useful for creating convex hull from highly tessellated triangle meshes.
2021-07-07 12:14:12 -07:00
Rémi Verschelde fa90b6e285
Merge pull request #50162 from Calinou/inspector-hint-allow-ormmaterial3d
Allow using ORMMaterial3D by using BaseMaterial3D as a resource hint
2021-07-06 22:56:06 +02:00
Rémi Verschelde 8771e910e1
Merge pull request #49964 from Calinou/websocketserver-improve-error-reporting
Improve error reporting in WebSocketServer
2021-07-06 13:38:43 +02:00
Rémi Verschelde 5ade46199f
Merge pull request #35847 from raniejade/ranie/fix-api-generator
Fix gdnative api generation for methods that return enums
2021-07-06 13:35:23 +02:00
Hugo Locurcio 58455b18b5
Improve error reporting in WebSocketServer
This should make troubleshooting easier.
2021-07-05 16:35:21 +02:00
Rémi Verschelde ffab3949e3
Merge pull request #50048 from Calinou/remove-travis-code
Remove unused code related to Travis CI
2021-07-05 14:15:24 +02:00
Hugo Locurcio 8f7e1b53ff
Allow using ORMMaterial3D by using BaseMaterial3D as a resource hint
Previously, only StandardMaterial3D could be defined as an alternative
to ShaderMaterial.

This also reorders the CanvasItemMaterial property hints to follow
alphabetical order (which is enforced by the inspector).
2021-07-04 17:49:36 +02:00
Hendrik Brucker 56a8d3f30c Improvements to Label's layout options
- Added options to trim the text in case it overruns
- Added more autowrap modes
- Improved line breaking, which ignores trailing spaces
2021-07-04 16:43:55 +02:00
Fabio Alessandrelli a28d25c441 [Crypto] Delete mbedtls ctx in deconstructor.
Would cause memory leak when the context was `start`ed but not
`finish`ed.
2021-07-03 16:12:55 +02:00