Commit graph

1786 commits

Author SHA1 Message Date
Rémi Verschelde 2edef2a795
Merge pull request #71825 from RedworkDE/net6-roll-forward
C#: Allow use of .NET 7
2023-01-27 00:13:54 +01:00
Rémi Verschelde 0d1b5f8832
Merge pull request #71356 from raulsntos/dotnet/get
C#: Lookup signals and methods in Get method
2023-01-27 00:13:13 +01:00
Rémi Verschelde 4f572d1587
Merge pull request #71535 from raulsntos/dotnet/pointers-are-yabai
C#: Skip methods with pointer parameters
2023-01-26 23:44:28 +01:00
Rémi Verschelde fdd3613de1
Merge pull request #71984 from raulsntos/dotnet/dictionary
Sync C# Dictionary with Core
2023-01-26 23:44:01 +01:00
Rémi Verschelde 239145d9cb
Merge pull request #71946 from raulsntos/dotnet/gd
C#: Sync GD with Core
2023-01-26 23:43:36 +01:00
Rémi Verschelde bacf594a49
Merge pull request #71583 from raulsntos/dotnet/math
C#: Add float an double overloads to Mathf
2023-01-26 23:43:11 +01:00
Rémi Verschelde c53066682b
Merge pull request #71787 from raulsntos/dotnet/restore-properties
C#: Restore `Scale` and `Rotation` properties
2023-01-26 23:42:46 +01:00
Rémi Verschelde fdd02b8827
Merge pull request #71988 from raulsntos/🦭-attributes
Seal C# attributes
2023-01-26 23:42:21 +01:00
Rémi Verschelde 0f840cb214
Merge pull request #72053 from raulsntos/dotnet/sync-context-dispose
C#: Implement disposable pattern and seal `GodotSynchronizationContext` class and related
2023-01-26 23:41:52 +01:00
Rémi Verschelde 63b5adf8a8
Merge pull request #72057 from raulsntos/dotnet/fix-must-be-variant
C#: Annotate API with `[MustBeVariant]`
2023-01-26 23:00:30 +01:00
Rémi Verschelde 2aa532ad6c
Merge pull request #65529 from magian1127/4.0FixDocTag
C# Improve the "Tag" conversion of documents
2023-01-26 22:58:26 +01:00
Raul Santos 256632a07e
C#: Skip documentation syntax in MustBeVariant analyzer 2023-01-25 17:29:08 +01:00
Raul Santos 0a0c730805
C#: Annotate API with MustBeVariant
- Add MustBeVariant attribute to generic parameters that are used in a Variant context
2023-01-25 17:28:59 +01:00
Raul Santos fc72604bef
C#: Implement disposable pattern and seal GodotSynchronizationContext class and related
- `GodotSynchronizationContext`
  - Implements `IDisposable` to dispose of the disposable field `_queue`.
  - Makes the class sealed.
- `GodotTaskScheduler`
  - Implements `IDisposable` to dispose of the disposable property `Context`.
  - Makes the class sealed.
- `Dispatcher`
  - Dispose of previous `GodotTaskScheduler` instances before creating a new one.
2023-01-25 17:04:41 +01:00
Aaron Franke 2a65f6812b
Add PROPERTY_USAGE_NEVER_DUPLICATE flag and use for script
Co-authored-by: Yakov Borevich <j.borevich@gmail.com>
2023-01-24 16:37:50 -06:00
Aaron Franke 2bc0bcbd26
PropertyUsage: Rename "DO_NOT_SHARE_ON_DUPLICATE" to "ALWAYS_DUPLICATE" 2023-01-24 16:05:07 -06:00
Raul Santos 47ca2f2e09
C#: Sync GD with Core
- Add overloads to print methods that take a single `string`.
- Use `StringBuilder` to append print parameters.
- Remove `PrintStack` method.
- Add `ErrorString`.
- Remove `Str` method.
- Add exception to `Range` when step is 0.
- Add `VarToBytesWithObjects` and `BytesToVarWithObjects`.
- Remove optional boolean parameter from `VarToBytes` and `BytesToVar`.
- Move `InstanceFromId` to `Godot.Object`.
- Add `Godot.Object.IsInstanceIdValid`.
- Update documentation.
2023-01-24 19:18:38 +01:00
Raul Santos e7b719b7ec
Seal C# attributes 2023-01-24 18:42:25 +01:00
Raul Santos 95ef4dc84f
Sync C# Dictionary with Core
- Implement `ICollection` methods explicitly.
- Add `Merge` method.
- Add `RecursiveEqual` method.
- Update documentation.
2023-01-24 17:19:52 +01:00
Raul Santos 8b07f95ba0
C#: Add float an double overloads to Mathf
- Add `float` and `double` overloads to all methods of `Mathf`.
This allows the methods to be usable with `float`, `double` or `real_t`.
- Use `System.MathF` in the `float` overloads which may result in
better performance.
- Constants remain as `real_t` for the time being.
- Add aggresive inlining for methods that wrap `System.Math` calls.
2023-01-24 15:01:26 +01:00
Magian 35bfce2afd C# Improve the "Tag" conversion of documents
[codeblocks] for Keep only the [CSharp] part.
[param] is changed to <c>.
[b] for bold text.
[i] for italic text.
4.0 now uses variant, so [variant] to <see cref="Godot.Variant"/>.
since Rider does not support [u], only comments have been modified.
2023-01-24 18:40:48 +08:00
Raul Santos b29193945d
C#: Move LinearToDb and DbToLinear to Mathf 2023-01-23 20:20:54 +01:00
Rémi Verschelde 5b1df48c6c
Convert en_GB spelling to en_US with codespell 2023-01-23 11:02:20 +01:00
RedworkDE 3f1241cb82 C#: Allow use of .NET 7
The editor will use .NET 7 if it is installed and fall back to .NET 6 otherwise.
Exported projects will use .NET 7 or .NET 6 depending on the value of TargetFramework in the csproj.
2023-01-21 23:11:37 +01:00
Juan Linietsky dddd8d43f6 Support script global resource name in EditorFileSystem
* Works for binary and text files.
* Makes EditorQuickOpen work with custom resources again.
* Information is cached and easily accessible.

Properly fixes #66179. Supersedes #66215 and supersedes #62417

**WARNING**: This required breaking backwards binary compatibility (.res and .scn files). Files saved after this PR is merged will no longer open in any earlier versions of Godot.
2023-01-21 14:19:27 +01:00
Raul Santos 04996df61e
C#: Restore Scale and Rotation properties 2023-01-21 04:59:13 +01:00
Rémi Verschelde 5dd3a6dbe2
Merge pull request #71638 from raulsntos/dotnet/export-plugin
C#: Implement `ExportPlugin::_get_name` and move `GLOBAL_DEF` to CSharpLanguage
2023-01-18 22:29:37 +01:00
Raul Santos 3425d43fed
C#: Move GLOBAL_DEFs to CSharpLanguage ctor
Also documents the .NET project settings.
2023-01-18 21:53:58 +01:00
Raul Santos 62106fe5e3
C#: Implement ExportPlugin::_get_name 2023-01-18 18:17:38 +01:00
Raul Santos 4bdcfe1443
Sync C# vectors with Core
- Remove `Vector2.Lerp` overload that takes a weight parameter of type `Vector2`.
- Remove `Vector3.Lerp` overload that takes a weight parameter of type `Vector3`.
- Remove `Color.Lerp` overload that takes a weight parameter of type `Color`.
- Remove `Angle` method from `Vector2i`.
- Remove `AngleTo` method from `Vector2i`.
- Remove `AngleToPoint` method from `Vector2i`.
- Remove `Cross` method from `Vector2i`.
- Remove `DistanceSquaredTo` method from `Vector2i` and `Vector3i`.
- Remove `DistanceTo` method from `Vector2i` and `Vector3i`.
- Remove `Dot` method from `Vector2i` and `Vector3i`.
- Remove `PosMod` method from `Vector2i` and `Vector3i`.
- Remove `Orthogonal` method from `Vector2i`.
- Remove `&` operator from `Vector2i` and `Vector3i`.
2023-01-17 18:07:33 +01:00
Rémi Verschelde 3a53990e9c
Merge pull request #71516 from raulsntos/dotnet/property-accessors
C#: Make property accessors internal
2023-01-17 17:30:49 +01:00
Raul Santos ab5e532f1a
C#: Skip methods with pointer parameters 2023-01-17 04:32:05 +01:00
Raul Santos 47e355f965
C#: Make property accessors internal 2023-01-16 15:15:26 +01:00
Raul Santos 0ccb5f3954
C#: Implement Mathf.SinCos
Implement `Mathf.SinCos` that wraps a call to `System.Math.SinCos`,
this allows us to use the `SinCos` method more conveniently with
`real_t`.

Using `Math.SinCos` is often cheaper than separate calls to `Math.Sin`
and `Math.Cos`, and they are often used together.
2023-01-16 13:29:32 +01:00
Rémi Verschelde ba551727ef
Merge pull request #71458 from raulsntos/dotnet/quaternion
C#: Make `Length` and `LengthSquared` into methods in `Quaternion`.
2023-01-16 09:20:53 +01:00
Rémi Verschelde 88c81bfbe5
Merge pull request #71456 from raulsntos/dotnet/sync-plane
C#: Sync `Plane` with Core
2023-01-16 09:20:30 +01:00
Rémi Verschelde 94312ab943
Merge pull request #71445 from raulsntos/dotnet/transforms
C#: Add missing `Transform{2D,3D}` and `Basis` constructors
2023-01-16 09:20:07 +01:00
Raul Santos 7a19c87c7e
C#: Sync Plane with Core
- Add `Plane(Vector3)` constructor.
- Rename `IntersectRay` to `IntersectsRay`.
- Rename `IntersectSegment` to `IntersectsSegment`.
- Replace `Center` property with `GetCenter` method.
- Add and fix documentation about the _normal_ parameter
to Core and C# documentation.
2023-01-15 19:47:42 +01:00
Raul Santos 5136366112
C#: Add missing Transform{2D,3D} and Basis constructors
- Remove `Transform3D(Quaternion, Vector3)` constructor from C#.
- Add `Transform3D(Projection)` constructor to C#.
- Add documentation to the `Transform3D(Projection)` constructor in Core.
- Add `Transform3D` constructor with only real_t params to C# that mirrors `Transform2D`.
- Expose `Basis` constructor with only real_t params in C#.
- Add `Transform2D(real_t, Vector2, real_t, Vector2)` constructor to C#.
2023-01-15 15:45:43 +01:00
Raul Santos 0476fc5a07
C#: Replace Rotation and Scale properties with get methods
- Replace `Rotation` property with `GetRotation` method in `Transform2D`.
- Replace `Scale` property with `GetScale` method in `Transform2D`.
- Replace `Scale` property with `GetScale` method in `Basis`.

Core does not expose set methods.
2023-01-15 14:06:16 +01:00
Raul Santos 28a8caac26
C#: Make Length and LengthSquared into methods in Quaternion.
The `Length` and `LengthSquared` members are implemented as methods
in every other C# struct, `Quaternion` was the only one implementing
them as properties.
2023-01-15 14:03:44 +01:00
Rémi Verschelde d6d87b6ca4
Merge pull request #71374 from raulsntos/dotnet/remove-spherical_interpolate_with
C#: Remove `SphericalInterpolateWith` from Transform3D
2023-01-15 13:08:15 +01:00
Rémi Verschelde e51426cab9
Merge pull request #71423 from raulsntos/dotnet/intersects-without-include_borders
C#: Remove `includeBorders` parameter from `Rect2i.Intersects` and `AABB.Intersects`
2023-01-15 13:07:13 +01:00
Raul Santos 949a2778ca
C#: Sync Basis with Core
- Remove `GetOrthogonalIndex` method (moved to `GridMap`).
- Remove `GetRow` and `SetRow` methods.
2023-01-14 20:06:45 +01:00
Raul Santos c990f7984e
C#: Remove includeBorders parameter from Rect2i.Intersects and AABB.Intersects 2023-01-14 04:39:40 +01:00
Raul Santos 4438315242
C#: Remove SphericalInterpolateWith from Transform3D 2023-01-14 02:10:59 +01:00
Raul Santos a6ba914f15
C#: Lookup signals and methods in Get method
Allows to retrieve `Callable`s and `Signal`s using `Get` like it works in GDScript.
2023-01-13 22:19:25 +01:00
Yuri Sizov 4c5e09f96a
Merge pull request #71339 from raulsntos/dotnet/is_finite
Add `IsFinite` to C# Variants
2023-01-13 23:34:51 +03:00
Yuri Sizov bdb3543c2a
Merge pull request #71343 from raulsntos/dotnet/is_zero_approx
Add `IsZeroApprox` to C# vectors
2023-01-13 23:31:24 +03:00
Raul Santos 14c16746f3
Add IsZeroApprox to C# vectors 2023-01-13 18:53:39 +01:00