Commit graph

1302 commits

Author SHA1 Message Date
Ignacio Roldán Etcheverry 875b5fbf17
Merge pull request #52607 from paulloz/improve-cs-method-listing
Improve C# method listing
2021-09-13 20:21:48 +02:00
Paul Joannon 19f25b6847
Improve C# method listing
- implement CSharpInstance::get_method_list
- loop through parent classes in CSharpInstance::get_method_list and CSharpScript::get_script_method_list (#46408)
2021-09-12 19:54:54 +02:00
Raul Santos 2962a440ea Fix autoloads iteration
Removes the range iterator usage in the autoloads map since `OrderedHashMap`
does not implement range iterators.
2021-09-12 13:22:18 +02:00
Ignacio Roldán Etcheverry 6679be45aa
Merge pull request #52492 from raulsntos/fix-csharp-array-properties
Fix properties arrays in C# bindings generator
2021-09-09 20:38:58 +02:00
Max Hilbrunner 75be697817
Merge pull request #52246 from Paulb23/verbatim-string
Syntax highlight c# verbatim string literal
2021-09-08 14:48:22 +02:00
Raul Santos c6b1c8093f Fix properties arrays in C# bindings generator 2021-09-08 12:52:39 +02:00
Max Hilbrunner 9ada29e918
Merge pull request #52289 from Calinou/remove-old-msvc-support-ifdef
Remove `#ifdefs` for handling compilation with Visual Studio < 2015
2021-09-07 21:01:44 +02:00
Fabio Alessandrelli bf9aae09ba [Net] Move multiplayer to core subdir, split RPCManager.
Move multiplayer classes to "core/multiplayer" subdir.

Move the RPCConfig and enums (TransferMode, RPCMode) to a separate
file (multiplayer.h), and bind them to the global namespace.

Move the RPC handling code to its own class (RPCManager).

Renames "get_rpc_sender_id" to "get_remote_sender_id".
2021-09-07 11:14:30 +02:00
Raul Santos 48c66b80ad Add documentation to GodotSharp
- Adds documentation to almost every class and member in `GodotSharp`
- Fixes some old documentation to more closely follow the XML comments convention
2021-09-03 19:03:31 +02:00
Raul Santos 415529400b Fix constant tag documentation in C# bindings generator 2021-09-03 18:54:40 +02:00
Raul Santos 5508d4606b Fix PackedInt64Array typo in bindings_generator.h 2021-09-03 18:54:40 +02:00
Aaron Franke 1933df0013
Some more C# formatting 2021-09-02 15:12:15 -05:00
George Marques 25ae279317
Merge pull request #52270 from KoBeWi/goodbye_polar
Remove cartesian2polar and polar2cartesian
2021-09-01 09:33:13 -03:00
George Marques cf59028972
Merge pull request #48237 from KoBeWi/they_came_from_angle
Add Vector2.from_angle() method
2021-09-01 09:32:42 -03:00
Hugo Locurcio fc0bfbb33b
Remove #ifdefs for handling compilation with Visual Studio < 2015
Godot 3.3 and later require Visual Studio 2017 to be compiled.
2021-08-31 20:04:17 +02:00
kobewi 3f3739ccb5 Add Vector2.from_angle() method 2021-08-31 01:53:58 +02:00
Juan Linietsky bcd73fc00a
Merge pull request #52240 from Rubonnek/rename-rel-path
Rename `String::is_rel_path` to `String::is_relative_path`
2021-08-30 20:45:45 -03:00
kobewi 017c94222e Remove cartesian2polar and polar2cartesian 2021-08-31 01:41:41 +02:00
Paulb23 cf36fb405c syntax highlight c# verbatim string literal 2021-08-30 11:38:03 +01:00
Wilson E. Alvarez d11c1afc04
Rename String::is_rel_path to String::is_relative_path 2021-08-29 20:41:29 -04:00
Fabio Alessandrelli 64b9f30b92 [Net] Rename RPC "puppet" to "auth" (authority). Drop "master".
This commit completely removes the RPC_MODE_MASTER ("master" keyword),
and renames the RPC_MODE_PUPPET to RPC_MODE_AUTHORITY ("auth" keyword).

This commit also renames the "Node.[get|set]_network_master" methods to
"Node.[get|set]_network_authority".

This commit also renames the RPC_MODE_REMOTE constant to RPC_MODE_ANY.

RPC_MODE_MASTER in Godot 3.x meant that a given RPC would be callable by
any puppet peer on the master, while RPC_MODE_PUPPET meant that it would
be callable by the master on any puppet.

Beside proving to be very confusing to the user (referring to where it
could be called instead of who can call it) the RPC_MODE_MASTER is quite
useless. It is almost the same as RPC_MODE_REMOTE (anyone can call) with
the exception that the network master cannot. While this could be useful
to check in some case, in such a function you would anyway need to check
in code who is the caller via get_rpc_sender_id(), so adding the check
there for those rare cases does not warrants a dedicated mode.
2021-08-30 00:54:38 +02:00
Lyuma 31f790299c Use OrderedHashMap for autoloads to preserve order 2021-08-26 21:55:26 -07:00
Max Hilbrunner ee4a8e6a85
Merge pull request #52087 from raulsntos/expose-simplify-path
Expose `String.SimplifyPath` in C#
2021-08-25 18:37:08 +02:00
Raul Santos 126b1ea149 Expose String.SimplifyPath in C# 2021-08-25 16:51:14 +02:00
Raul Santos 4e6e6bcd2f Rename String.IsAbsPath() to String.IsAbsolutePath() 2021-08-25 03:02:55 +02:00
Ignacio Roldán Etcheverry e95fa21b45
Merge pull request #47295 from omegachysis/script-bind-mutex
Fix race condition on `script_binding` in C#
2021-08-24 06:09:43 +02: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
Magian facb96034b check that the element type is indeed String 2021-08-20 18:35:04 +08: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
Magian 07a578d100 C# Array<String> Export Support Enum(String) 2021-08-18 20:30:51 +08: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 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
Aaron Franke 03e2544d50
Use real_t and double where appropriate in Particles 2021-08-12 11:35:31 -05:00
Raul Santos f20db58271 Ensure MSBuildPanel buttons are instantiated 2021-08-06 22:30:38 +02:00
Rémi Verschelde ba0982c51c
Merge pull request #51008 from raulsntos/csharp-renames 2021-08-06 09:07:02 +02: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
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
Aaron Franke 2733b9abd8
Remove obsolete "dectime" method
Replaced by "move_toward"
2021-07-30 16:41:28 -05: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
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
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
Rémi Verschelde 92299989bd
Use Ref<T> references as iterators where relevant
And const when possible.
2021-07-26 19:27:11 +02: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
Rémi Verschelde ac3322b0af
Use const references where possible for List range iterators 2021-07-25 12:22:25 +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
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
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
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
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
Fabio Alessandrelli 88d68346ee [Net] Rename NetworkedMultiplayerPeer to MultiplayerPeer. 2021-07-12 16:36:34 +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
Hugo Locurcio 257a8a337e
Remove unused code related to Travis CI 2021-07-01 18:02:00 +02:00
Grzegorz Puławski fa82727f5b Fixing mono build after instance() -> instanciate() name change 2021-06-23 16:07:23 +02:00
Lightning_A e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
Rémi Verschelde 9b7c963d19
Merge pull request #48804 from EricEzaM/scripting-multi-error-support
Added support for scripts reporting multiple errors to ScriptTextEditor
2021-06-20 00:38:49 +02:00
Eric M d0e78c86d7 Added support for scripts reporting multiple errors to ScriptTextEditor
Scripts can now report multiple errors to the scripting editors in the engine. UI elements were added to support multiple errors.
2021-06-19 22:20:30 +10:00
Marcel Admiraal 2bafcd3422 Consolidate JSON, JSONParseResults and JSONParser into JSON
Renames JSON.parse_string() to parse()
Renames JSON.decode_data() to stringify()
2021-06-19 08:01:40 +01:00
Rémi Verschelde 7aebb8f81c
Merge pull request #44156 from aaronfranke/quat-angle-to
Add Quaternion angle_to method
2021-06-18 12:35:58 +02:00
Aaron Franke e6c7567da7
Fix a typo in C# bindings generator for default value types 2021-06-18 01:13:00 -04:00
Aaron Franke 93b494d4ae
Add Quaternion angle_to method 2021-06-17 23:57:00 -04:00
Pedro J. Estébanez 2ca6b9c610 Fix slow load/save of scenes with many instances of the same script 2021-06-13 13:32:44 +02:00
Rémi Verschelde 600b4c9c7b
Merge pull request #34668 from aaronfranke/to-string
[Core] Reformat structure string operators
2021-06-13 11:58:24 +02:00
Pedro J. Estébanez f59488e94e Improve & fix Mono build
- Fix C++ compile errors about pending variable renames after the `Reference` to `RefCount` change.
- Fix C# compile errors due to the recent rename of `EnablePlugin()` and `Build()`, which are now underscore-prefixed in bindings.
- Additional rename: `godot_icall_Reference_Dtor` to  `godot_icall_RefCounted_Dtor`.
2021-06-13 11:21:14 +02:00
Rémi Verschelde ac73059b56
Merge pull request #49123 from aaronfranke/it-is-time
Add a Time singleton
2021-06-12 22:55:25 +02:00
Pedro J. Estébanez 04688b92ff Rename Reference to RefCounted 2021-06-11 18:48:42 +02:00
Aaron Franke 554c776e08
Reformat structure string operators
The order of numbers is not changed except for Transform2D. All logic is done inside of their structures (and not in Variant).

For the number of decimals printed, they now use String::num_real which works best with real_t, except for Color which is fixed at 4 decimals (this is a reliable number of float digits when converting from 16-bpc so it seems like a good choice)
2021-06-11 10:53:20 -04:00
Rémi Verschelde 8d4046929c
Merge pull request #49511 from akien-mga/core-diraccess-fileaccess-io
Core: Move DirAccess and FileAccess to `core/io`
2021-06-11 16:51:10 +02:00
Rémi Verschelde 6b0183ec89
Merge pull request #49279 from Calinou/rename-string-is-abs-path-method
Rename `String.is_abs_path()` to `String.is_absolute_path()`
2021-06-11 15:58:16 +02:00
Aaron Franke f64fea1b23
Add Time singleton 2021-06-11 09:32:39 -04:00
Rémi Verschelde 9e328bb5b7
Core: Move DirAccess and FileAccess to core/io
File handling APIs are typically considered part of I/O, and we did have most
`FileAccess` implementations in `core/io` already.
2021-06-11 14:52:39 +02:00
Rémi Verschelde 896aa94283
Merge pull request #49221 from Faless/mp/4.x_rpc_refactor
[Net] Refactor RPCs, remove RSETs
2021-06-07 17:00:08 +02:00
Rémi Verschelde c1c76850cb
Style: Cleanup uses of double spaces between words
Or after punctuation. Tried to leave third-party stuff alone, unless it has
been heavily modified for Godot.
2021-06-07 11:03:08 +02:00
Rémi Verschelde 6f7d45d210
Merge pull request #45364 from madmiraal/rename-quat
Rename Quat to Quaternion
2021-06-05 13:32:08 +02:00
Marcel Admiraal beae6527e0 Add missing override keyword to CSharpLanguage::is_control_flow_keyword() 2021-06-04 18:39:30 +01:00
Marcel Admiraal 8acd13a456 Rename Quat to Quaternion 2021-06-04 18:14:32 +01:00
Rémi Verschelde 5d9cab3aeb
Merge pull request #38430 from aaronfranke/transform3d 2021-06-03 23:07:21 +02:00
Aaron Franke 2e13e3ed4a
Allow clamping vectors and colors 2021-06-03 12:05:20 -04:00
Aaron Franke 94bc0bd919
Rename Vector2 clamped to limit_length and add limit_length to Vector3 2021-06-03 12:04:57 -04:00
Hugo Locurcio 5ea1c75d63
Rename String.is_abs_path() to String.is_absolute_path()
This is more consistent with `NodePath.is_absolute()`.
2021-06-03 16:00:06 +02:00
Aaron Franke a3c29ed899
Rename files and the exposed name for Transform3D 2021-06-03 07:30:01 -04:00
Aaron Franke 08a85352fb
Rename Variant TRANSFORM to TRANSFORM3D
Also _transform to _transform3d
2021-06-03 07:30:01 -04:00
Aaron Franke de3f6699a5
Rename Transform to Transform3D in core 2021-06-03 07:30:01 -04:00
Fabio Alessandrelli d779b5aa3e [Net] Refactor RPCs, remove RSETs
In this PR:
- Removed rset
- rpc_config can now optionally configure transfer mode
  (reliable/unreliable/ordered) and channel (channels are not actually
  implemented yet.)
- Refactor how the RPC id is computed to minimize the logic in Node and
  scripts that now only needs a single `get_rpc_methods` function.
2021-06-01 17:24:21 +02:00
reduz 0d2e02945b Implement shader caching
* Shader compilation is now cached. Subsequent loads take less than a millisecond.
* Improved game, editor and project manager startup time.
* Editor uses .godot/shader_cache to store shaders.
* Game uses user://shader_cache
* Project manager uses $config_dir/shader_cache
* Options to tweak shader caching in project settings.
* Editor path configuration moved from EditorSettings to new class, EditorPaths, so it can be available early on (before shaders are compiled).
* Reworked ShaderCompilerRD to ensure deterministic shader code creation (else shader may change and cache will be invalidated).
* Added shader compression with SMOLV: https://github.com/aras-p/smol-v
2021-05-31 10:13:09 +02:00