summaryrefslogtreecommitdiff
path: root/modules/mono/editor
AgeCommit message (Collapse)Author
2022-09-05Merge pull request #65321 from rburing/physics_server_2d_extensionRémi Verschelde
Create GDExtension classes for PhysicsServer2D
2022-09-04Create GDExtension classes for PhysicsServer2DRicardo Buring
This allows a 2D physics server created entirely from GDExtension. Based on the structure of PhysicsServer3DExtension by reduz.
2022-09-04Add float arg to build_assemblies.pyAlmighty Laxz
2022-09-01C#: Assume 64-bit types when type has no metaRaul Santos
When the C# bindings generator finds a type without meta assume the type refers to the 64-bit version of the type: - `float` is converted to `double` - `int` is converted to `long`
2022-08-29Rename String `plus_file` to `path_join`Aaron Franke
2022-08-29Merge pull request #65046 from ↵Ignacio Roldán Etcheverry
neikeq/dotnet-fix-exported-game-uninitialized-callbacks C#: Fix exported game crash because of uninitialized callbacks
2022-08-29Merge pull request #64987 from raulsntos/dotnet/linux-exportIgnacio Roldán Etcheverry
Fix .NET exporting in Linux
2022-08-29C#: Fix exported game crash because of uninitialized callbacksIgnacio Roldán Etcheverry
This was a regression from 2c180f62d985194060f1a8d2070c130081177c90, where I forgot to update the source generator.
2022-08-29Merge pull request #64119 from YuriSizov/theme-init-databaseRémi Verschelde
2022-08-29[Web] Rename JavaScript platform to Web.Fabio Alessandrelli
Also rename export name from "HTML5" to "Web".
2022-08-29Merge pull request #64956 from raulsntos/dotnet/format-ciRémi Verschelde
Add `dotnet format` to CI to check C# style
2022-08-29Merge pull request #64900 from raulsntos/dotnet/fix-exceptionsIgnacio Roldán Etcheverry
Fix various C# exceptions
2022-08-29Merge pull request #64994 from raulsntos/dotnet/property-indexersIgnacio Roldán Etcheverry
C#: Ignore property indexers and report if exported
2022-08-28C#: Ignore property indexers and report if exportedRaul Santos
Ignore property indexers since they are unsupported and report a diagnostic if an user tries to export it.
2022-08-28Fix .NET exporting in LinuxRaul Santos
- Fix platform detection after Linux OS name was renamed from `LinuxBSD` to `Linux` - Fix arch detection after renaming `64` to `x86_64` - Fix typo in `find_hostfxr`
2022-08-27Fix C# style with `dotnet format`Raul Santos
2022-08-27Rename `hint_tooltip` to `tooltip_text` & setgetMicky
`hint_tooltip` -> `tooltip_text` `set_tooltip` -> `set_tooltip_text` `_get_tooltip` -> `get_tooltip_text` Updates documentation, too.
2022-08-26Add ThemeDB, expose previously static Theme methodsYuri Sizov
2022-08-26Fix various C# exceptionsRaul Santos
- Replace `IndexOutOfRangeException` with `ArgumentOutOfRangeException` - Replace `Exception` with a more specific exception - Add the parameter name to argument exception - Update documentation for methods that throw exceptions - Use `StringBuilder` to build exception messages - Ensure exception messages end with a period
2022-08-26Restore RigidBody2/3D, SoftBody names in physicsfabriceci
2022-08-26Merge pull request #64901 from raulsntos/dotnet/equalsIgnacio Roldán Etcheverry
C#: Use pattern matching to simplify `Equals`
2022-08-26Remove `[Signal]` attribute from eventsRaul Santos
- Remove event as a valid target of `SignalAttribute` - Stop adding the `[Signal]` attribute to events in bindings_generator - Make bindings_generator use the `EventHandler` suffix to be consistent with the C# source generator - Remove obsolete comment about the signal's delegate name
2022-08-25C#: Preserve order of exported fields/categoriesPaul Joannon
2022-08-25Merge pull request #52815 from magian1127/temp3Ignacio Roldán Etcheverry
C# Generate SnakeName const
2022-08-25Various C# documentation improvementsRaul Santos
Fixes wrong/invalid documentation and add documentation to some OS members.
2022-08-25C# Generate StringName(SnakeName) for all class membersMagian
2022-08-25Unify bits, arch, and android_arch into env["arch"]Aaron Franke
Fully removes the `bits` option and adapts the code that relied on it. Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2022-08-25Merge pull request #64731 from raulsntos/dotnet6-variant-generics-analyzerRémi Verschelde
C#: Add `MustBeVariant` attribute and analyzer
2022-08-25Add MustBeVariant attribute and analyzerRaul Santos
- MustBeVariant attribute can be used to enforce that generic types must be a marshable from/to Variant. - Also renames all diagnostic ids to be valid unicode identifiers.
2022-08-24Remove mentions of the Server platform from the Mono moduleAaron Franke
2022-08-24Merge pull request #64742 from zaevi/csharp_add_grouping_attributesIgnacio Roldán Etcheverry
C#: Add grouping attributes for properties.
2022-08-24Merge pull request #64743 from raulsntos/dotnet6-signal-analyzerIgnacio Roldán Etcheverry
Improve C# signal analyzer errors
2022-08-24Use pattern matching to simplify `Equals`Raul Santos
- Simplify and unify `Equals` implementation of C# struct types - Also add pattern matching to replace a cast in `DebuggingUtils`
2022-08-22C#: Replace `Xform` and `XformInv` with `*` operatorRaul Santos
- In cases where both `Xform`/`XformInv` and the `*` operator were implemented the `Xform`/`XformInv` methods were removed in favor of the `*` operator. - In cases where the `Xform`/`XformInv` existed but not the `*` operator, the `Xform`/`XformInv` methods were replaced with the `*` operator. - In cases where no method existed, a new `*` operator has been implemented to support the same operations that are supported in GDScript. - Fixes the `Transform.Xform` and `Transform.XformInv` with `Rect2` implementation to use a zero `Rect2` size to start expanding from (which is how it's implemented in C++).
2022-08-22Improve C# signal analyzer errorsRaul Santos
Report the specific parameters that are not supported.
2022-08-23C#: Add grouping attributes for properties.Zae
2022-08-22C#: Replace P/Invoke with delegate pointersIgnacio Roldán Etcheverry
- Moves interop functions to UnmanagedCallbacks struct that contains the function pointers and is passed to C#. - Implements UnmanagedCallbacksGenerator, a C# source generator that generates the UnmanagedCallbacks struct in C# and the body for the NativeFuncs methods (their implementation just calls the function pointer in the UnmanagedCallbacks). The generated methods are needed because .NET pins byref parameters of native calls, even if they are 'ref struct's, which don't need pinning. The generated methods use `Unsafe.AsPointer` so that we can benefit from byref parameters without suffering overhead of pinning. Co-authored-by: Raul Santos <raulsntos@gmail.com>
2022-08-22C#: Use custom project setting for C# project files nameIgnacio Roldán Etcheverry
The setting is initially assigned the name of the Godot project, but it's kept freezed to prevent issues when renaming the Godot project. The user can always rename the C# project and solution manually and change the setting to the new name.
2022-08-22C#: Re-introduce generic Godot Array and DictionaryIgnacio Roldán Etcheverry
This new version does not support the following type arguments: - Generic types - Array of Godot Object (Godot.Object[]) or derived types The new implementation uses delegate pointers to call the Variant conversion methods. We do type checking only once in the static constructor to get the conversion delegates. Now, we no longer need to do type checking every time, and we no longer have to box value types. This is the best implementation I could come up with, as C# generics don't support anything similar to C++ template specializations.
2022-08-22C#: Array, Dictionary and marshaling refactoringIgnacio Roldán Etcheverry
- Array and Dictionary now store `Variant` instead of `System.Object`. - Removed generic Array and Dictionary. They cause too much issues, heavily relying on reflection and very limited by the lack of a generic specialization. - Removed support for non-Godot collections. Support for them also relied heavily on reflection for marshaling. Support for them will likely be re-introduced in the future, but it will have to rely on source generators instead of reflection. - Reduced our use of reflection. The remaining usages will be moved to source generators soon. The only usage that I'm not sure yet how to replace is dynamic invocation of delegates.
2022-08-22C#: Add dedicated Variant struct, replacing System.ObjectIgnacio Roldán Etcheverry
2022-08-22C#: Add source generator for method listIgnacio Roldán Etcheverry
2022-08-22C#: Add source generator for signals as eventsIgnacio Roldán Etcheverry
Changed the signal declaration signal to: ``` // The following generates a MySignal event [Signal] public delegate void MySignalEventHandler(int param); ```
2022-08-22C#: Re-implement assembly reloading with ALCsIgnacio Roldán Etcheverry
2022-08-22C#: Make GodotSharp API a NuGet packageIgnacio Roldán Etcheverry
In the past, the Godot editor distributed the API assemblies and copied them to project directories for projects to reference them. This changed with the move to .NET 5/6. Godot no longer copies the assemblies to project directories. However, the project Sdk still tried to reference them from the same location. From now on, the GodotSharp API is distributed as a NuGet package, which the Sdk can reference. Added an option to `build_assemblies.py` to copy all Godot NuGet packages to an existing local NuGet source. This will be needed during development, while packages are not published to a remote NuGet repository. This option also makes sure to remove packages of the same version installed (~/.nuget/packages). Very useful during development, when packages change, to make sure the package being used by a project is the same we just built and not one from a previous build. A local NuGet source can be created like this: ``` mkdir ~/MyLocalNuGetSource && \ dotnet nuget add source ~/MyLocalNuGetSource/ -n MyLocalNuGetSource ```
2022-08-22C#: Initial NativeAOT supportIgnacio Roldán Etcheverry
This commit adds initial support for games exported as NativeAOT shared libraries. At this moment, the NativeAOT runtime is experimental. Additionally, Godot is not trim-safe as it still makes some use of reflection. For the time being, a rd.xml file is needed to prevent code triming: ``` <Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata"> <Application> <Assembly Name="GodotSharp" Dynamic="Required All" /> <Assembly Name="GAME_ASSEMBLY" Dynamic="Required All" /> </Application> </Directives> ``` These are the csproj changes for publishing: ``` <PropertyGroup> <NativeLib>Shared</NativeLib> </PropertyGroup> <ItemGroup> <RdXmlFile Include="rd.xml" /> <PackageReference Include="Microsoft.DotNet.ILCompiler" Version="7.0.0-*" /> </ItemGroup> ``` More info: - https://github.com/dotnet/runtimelab/blob/feature/NativeAOT/docs/using-nativeaot/compiling.md - https://github.com/dotnet/runtimelab/tree/feature/NativeAOT/samples/NativeLibrary - https://github.com/dotnet/runtimelab/blob/feature/NativeAOT/docs/using-nativeaot/rd-xml-format.md
2022-08-22C#: Upgrade to .NET 6 (5.0 -> 6.0)Ignacio Roldán Etcheverry
2022-08-22C#: Static marshaling for bindings and source generatorsIgnacio Roldán Etcheverry
Previously, we added source generators for invoking/accessing methods, properties and fields in scripts. This freed us from the overhead of reflection. However, the generated code still used our dynamic marshaling functions, which do runtime type checking and box value types. This commit changes the bindings and source generators to include 'static' marshaling. Based on the types known at compile time, now we generate the appropriate marshaling call for each type.
2022-08-22C#: Add source generator for properties and exports default valuesIgnacio Roldán Etcheverry
The editor no longer needs to create temporary instances to get the default values. The initializer values of the exported properties are still evaluated at runtime. For example, in the following example, `GetInitialValue()` will be called when first looks for default values: ``` [Export] int MyValue = GetInitialValue(); ``` Exporting fields with a non-supported type now results in a compiler error rather than a runtime error when the script is used.
2022-08-22C#/netcore: Add base desktop game export implementationIgnacio Roldán Etcheverry
This base implementation is still very barebones but it defines the path for how exporting will work (at least when embedding the .NET runtime). Many manual steps are still needed, which should be automatized in the future. For example, in addition to the API assemblies, now you also need to copy the GodotPlugins assembly to each game project.