Commit graph

1029 commits

Author SHA1 Message Date
Rémi Verschelde
6e39566344
Merge pull request #52883 from Germanrc/script_reload_fix
C# scripts reload in editor fixed
2021-09-24 08:33:49 +02:00
Germanrc
84a218d346 C# script reload fixed
Co-authored-by: Michael Bickel <mib@developium.net>
2021-09-21 23:03:45 +02:00
Rémi Verschelde
b37776fa2f
Merge pull request #52591 from timothyqiu/error-macros
[3.x] Remove do{ } while(0) wrapper around error macros
2021-09-21 10:38:34 +02:00
Hugo Locurcio
59eafe4cd3
Remove #ifdefs for handling compilation with Visual Studio < 2015
Godot 3.3 and later require Visual Studio 2017 to be compiled.

(cherry picked from commit fc0bfbb33b)
2021-09-19 11:30:22 +02:00
Aaron Franke
298e29c772
[3.x] Some more C# formatting and style fixes 2021-09-18 12:11:03 -05:00
Rémi Verschelde
bb2772d2f2
Merge pull request #52762 from magian1127/3.xTemp1 2021-09-18 14:51:07 +02:00
Magian
0263a87c8b C#, replace the current Xform method with a * operator. 2021-09-18 20:40:08 +08:00
Rémi Verschelde
316b5dad2d
Merge pull request #52390 from raulsntos/csharp-docs-3.x
[3.x] Add documentation to GodotSharp
2021-09-18 01:00:03 +02:00
Rémi Verschelde
4b50cd9b56
Merge pull request #52763 from magian1127/3.xtemp2 2021-09-17 12:26:36 +02:00
Magian
58e742e2c0 C# Array<String> Export Support Enum(String) 2021-09-17 14:03:27 +08:00
Rémi Verschelde
ae58f94323
Merge pull request #52445 from nekomatata/fix-mono-nodepath-default-arg-3.x 2021-09-16 15:20:17 +02:00
Rémi Verschelde
154cca3d5d
Merge pull request #52595 from lewiji/mono-build-solution-shortcut
[3.x] Add editor keyboard shortcut for Mono Build solution button
2021-09-14 16:00:10 +02:00
Lewis James
48a6264a87 Add editor keyboard shortcut for Mono Build solution button
Update GodotSharpEditor.cs & csharp_script.cpp with better casing and localisation for HintTooltip on Build button

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2021-09-14 13:24:03 +01:00
Raul Santos
6a7ca43297
Expose String.SimplifyPath in C#
(cherry picked from commit 126b1ea149)
2021-09-14 13:41:26 +02:00
Paul Joannon
e2b71de38b
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)

(cherry picked from commit 19f25b6847)
2021-09-14 13:41:26 +02:00
Haoyu Qiu
70853fd669 Remove do{ } while(0) wrapper around error macros 2021-09-12 15:04:53 +08:00
PouleyKetchoupp
781b979292 Fix NodePath default argument in mono bindings
Backport from master, mono was generating "" as default argument
instead of (NodePath)"".
2021-09-06 10:46:33 -07:00
Raul Santos
cacf3e28fd 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-04 20:15:53 +02:00
Raul Santos
d76562ceb9 Fix constant tag documentation in C# bindings generator 2021-09-03 23:02:14 +02:00
Rémi Verschelde
f0b37b1519
doc: Point URLs to 3.4 version of the online docs 2021-08-12 17:08:10 +02:00
Rémi Verschelde
a418d09617
Merge pull request #51166 from RandomShaper/fix_can_reset_3.x 2021-08-09 09:19:25 +02:00
Raul Santos
dd9c07ee46 Ensure MSBuildPanel buttons are instantiated 2021-08-06 22:32:54 +02:00
31
659b89c615
Fix 'script_class' null access when reloading a deleted C# script
(cherry picked from commit 6fd2edddc0)
2021-08-06 13:03:03 +02:00
Rémi Verschelde
70784f983b
Mono: Remove diagnostics incompatible with 3.x codebase 2021-08-06 12:59:17 +02:00
Raul Santos
332e31260e
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.

(cherry picked from commit 2deefd938f)
2021-08-06 11:10:04 +02:00
Raul Santos
ca32c18458
Add documentation to Dictionary in C#
Adds documentation to `Godot.Collections.Dictionary` in C#.

(cherry picked from commit 0669ffcd15)
2021-08-06 11:09:56 +02:00
Raul Santos
5c206c38f9
Simplify C# print methods
- Extracts the parameters logic to a single method
- Simplify the handling of null parameters

(cherry picked from commit ad460cde79)
2021-08-05 16:35:55 +02:00
Yuri Sizov
3857fd5ceb Fix the editor theme application for the Mono build log 2021-08-03 22:11:33 +03:00
Raul Santos
ecb973ab02
Use allowEmpty parameter in Split
(cherry picked from commit b7a66a820b)
2021-08-03 09:15:33 +02:00
Ignacio Roldán Etchevery
e72fdc4b95 C#+iOS: Cache AOT compilater output
Implemented some basic caching to avoid unnecessary AOT compilation
of unchanged assemblies that were already compiled previously.
This reduces iOS export times considerably for subsequent builds
since many dependencies never change, such as framework assemblies
and the Godot bindings.

The AOT compiler asm output and object files are now placed in
`res://.mono/temp/obj/<CONFIG>/godot-aot-cache/` instead of a
temporary directory.
2021-08-02 17:27:47 +02:00
Ignacio Etcheverry
417a69c643 Implement CSharpScript::inherits_script()
(cherry picked from commit 840255a04b)
2021-08-02 15:30:13 +02:00
Pedro J. Estébanez
7426b3fa91 Add Script::inherits_script()
Partial cherry-pick of 5d4dc2d45c.

Co-authored-by: Juan Linietsky <reduzio@gmail.com>
2021-08-02 15:18:30 +02:00
Raul Santos
9fd201c7a4
Ignore paths with invalid chars in PathWhich
(cherry picked from commit d636ebbfe9)
2021-07-27 12:17:14 +02:00
Raul Santos
2d60a64260
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.

(cherry picked from commit accd05f4ad)
2021-07-27 12:17:09 +02:00
Aaron Franke
1180256090
Add documentation to Array in C#
(cherry picked from commit 080f44a3b7)
2021-07-26 13:35:52 +02:00
Raul Santos
6ea8334012
Fix documentation in StringExtensions
(cherry picked from commit ba99387bf3)
2021-07-26 13:35:12 +02:00
Aaron Franke
17551fe29e
[3.x] Add a simple C# .editorconfig 2021-07-24 16:27:57 -04:00
Rémi Verschelde
f8264abb46
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.

(cherry picked from commit 671467b888)
2021-07-20 13:05:04 +02:00
JestemStefan
9513354f68 Added signed_angle_to for Vector3
Added signed_angle_to method for Vector3

Added signed_angle_to for Vector3

formatting fix...
2021-07-09 12:49:12 +02:00
Hugo Locurcio
3b11b1022d
Remove unused code related to Travis CI
(cherry picked from commit 257a8a337e)
2021-07-06 11:19:56 +02:00
Aaron Franke
85a0345d57
[3.x] Add Quat angle_to method 2021-06-18 11:00:44 -04:00
Marcel Admiraal
7e03bd1671 Remove duplicate WARN_PRINTS macro 2021-06-18 12:57:59 +01:00
Aaron Franke
b3ac1669c0
[3.x] Fix C# bindings generator for default value types 2021-06-18 01:07:28 -04:00
Pedro J. Estébanez
2d1943b8d1
Fix slow load/save of scenes with many instances of the same script
(cherry picked from commit 2ca6b9c610)
2021-06-17 12:47:54 +02:00
Marcel Admiraal
5a58516231 Remove duplicate ERR_PRINTS macro 2021-06-16 11:56:25 +01:00
Rémi Verschelde
80e1585a6e
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.

(cherry picked from commit c1c76850cb)
2021-06-07 12:06:59 +02:00
Ignacio Roldán Etchevery
a3722a73aa C#+iOS: Fix crash at exit for passing NULL domain to mono_jit_cleanup 2021-06-02 01:34:00 +02:00
Ignacio Roldán Etchevery
4838e609ee C#+iOS: Fixes for games exported with Use Interpreter disabled
Added `SystemConfiguration.framework` to the Xcode project to fix
undefined symbols errors building without the interpreter, like:
`_SCNetworkReachabilityScheduleWithRunLoop`.

Added explicit static constructors to the generated `NativeCalls`
class to avoid a `TypeInitializationException` at startup when
Godot attempts to read the static fields (like `godot_api_hash`)
from this class.
This seems to be an issue with Mono's AOT compiler and classes
with the `beforefieldinit` attribute. Not sure if it only happens
when the fields are only accessed via reflection as was our case.
Explicitly declaring the static constructor makes the C# compiler
not add the `beforefieldinit` attribute to the class.
2021-06-02 01:34:00 +02:00
Ignacio Roldán Etchevery
21a739e3b1 C#+iOS: Fix P/Invoke symbols being stripped by the linker
We use `Mono.Cecil` to search for P/Invoke methods in assemblies in
order to collect symbols that we must prevent from being stripped.

We could pass the symbols as `-u` linker arguments (`-Wl,-u,symbol`)
for the native target (not for the project), but it was simpler to
generate referencing code and avoid changes to Godot's iOS exporter.
2021-06-02 01:34:00 +02:00
Ignacio Roldán Etchevery
c9047de455 C#+iOS: Fix simulator builds
Replaced obsolete preprocessor check for simulator/device in C code.
Architecture can no longer be used to determine this with Apple Silicon.
The new code uses `TARGET_OS_SIMULATOR` from `TargetConditionals.h`.

We have some mono libs which can only be used in devide builds.
We were adding them as static libs. Previously it was only causing
warnings because missing arch for the simulator, but now this
is treated as an error.

To fix this we turn them into xcframeworks with dummy static libs
for the simulator and the actual ones for devices.
2021-06-02 01:34:00 +02:00