summaryrefslogtreecommitdiffstats
path: root/modules/mono/csharp_script.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | C#: Move build button to EditorRunBarRaul Santos2023-08-031-2/+0
| | | | | | | | | | | | | | - Move C# build button to `EditorRunBar`. - Add C# build icon. - Add shortcut macros to `GodotTools`. - Move C# build shortcuts to C#.
* | C#: Fix command line exportingRedworkDE2023-07-071-1/+1
| |
* | C# Fix reloading of non-tool scriptsRedworkDE2023-06-281-1/+2
| |
* | C#: Fix editor integration breaking and causing error spam when reloading ↵RedworkDE2023-06-211-19/+27
| | | | | | | | | | | | | | | | assemblies fails - Do not reload scripts from non-collectible assemblies - Do not load GodotTools as collectible - Do not attempt to reload the same project assembly forever
* | C#: Set `PropertyInfo.class_name` for method parametersRaul Santos2023-06-161-0/+6
| |
* | Style: Harmonize header includes in modulesRémi Verschelde2023-06-151-16/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This applies our existing style guide, and adds a new rule to that style guide for modular components such as platform ports and modules: Includes from the platform port or module ("local" includes) should be listed first in their own block using relative paths, before Godot's "core" includes which use "absolute" (project folder relative) paths, and finally thirdparty includes. Includes in `#ifdef`s come after their relevant section, i.e. the overall structure is: - Local includes * Conditional local includes - Core includes * Conditional core includes - Thirdparty includes * Conditional thirdparty includes
* | C#: Unify project name handling and fix issues with the handling of some ↵RedworkDE2023-06-141-5/+2
|/ | | | | | special characters Co-authored-by: Raul Santos <raulsntos@gmail.com>
* Fix crash when using base types of extension-based types from C#Mikael Hermansson2023-06-121-2/+11
|
* Merge pull request #75188 from RedworkDE/net-synchronize-insertRémi Verschelde2023-06-061-1/+4
|\ | | | | | | C#: Synchronize adding ScriptInstances
| * C#: Synchronize adding ScriptInstancesRedworkDE2023-05-221-1/+4
| |
* | C#: Add global class supportRaul Santos2023-05-291-3/+71
|/ | | | Co-authored-by: willnationsdev <willnationsdev@gmail.com>
* Merge pull request #76659 from ↵Yuri Sizov2023-05-191-0/+6
|\ | | | | | | | | shana/shana/75152-fix-crash-when-initializing-glue-generation Skip initializing the C# runtime when generating glue bindings
| * Skip initializing the C# runtime when generating glue bindingsAndreia Gaita2023-05-181-0/+6
| | | | | | | | | | | | | | | | | | The bindings generator doesn't require the C# runtime in order to generate the glue, and when it the glue generation runs, it exits immediately afterwards, so we can skip this initialization when the `--generate-mono-glue` flag is passed in. Fixes issue 75152
* | Merge pull request #72288 from MewPurPur/use-string-repeatClay John2023-05-051-6/+1
|\ \ | |/ |/| Use `String.repeat()` to optimize several String methods
| * Use String.repeat() in more placesVolTer2023-05-011-6/+1
| |
* | Fix "hides member" warnings in `csharp_script.cpp`Ninni Pipping2023-03-251-66/+66
| |
* | Prevent crashing on startup if project has scripted theme typesYuri Sizov2023-03-081-8/+0
| | | | | | | | Also avoid order of operation conflicts by moving C# binding generation hook to main.cpp
* | Validate that C# class names are valid identifiersAleks Rutins2023-03-041-0/+5
| |
* | C#: Fix crash when errors occur before language initialization.RedworkDE2023-03-011-1/+3
| |
* | Remove unused `ScriptLanguage` methodsvoidedWarranties2023-02-261-5/+0
| |
* | [macOS] Replace all `Alt/Option+Letter/Number` default shortcuts to avoid ↵bruvzg2023-02-201-0/+1
| | | | | | | | conflicts with special character input.
* | C#: Rename `Object` to `GodotObject`Raul Santos2023-01-271-1/+1
| |
* | C#: Renames to follow .NET naming conventionsRaul Santos2023-01-271-28/+34
|/ | | | Renamed C# types and members to use PascalCase and follow .NET naming conventions.
* Support script global resource name in EditorFileSystemJuan Linietsky2023-01-211-0/+4
| | | | | | | | | | * 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.
* C#: Move `GLOBAL_DEF`s to CSharpLanguage ctorRaul Santos2023-01-181-0/+5
| | | | Also documents the .NET project settings.
* Refactor ProjectSetting overridesJuan Linietsky2023-01-131-1/+1
| | | | | | | | | | | | | * Overrides no longer happen for set/get. * They must be checked with a new function: `ProjectSettings::get_setting_with_override()`. * GLOBAL_DEF/GLOBAL_GET updated to use this This change solves many problems: * General confusion about getting the actual or overriden setting. * Feature tags available after settings are loaded were being ignored, they are now considered. * Hacks required for the Project Settings editor to work. Fixes #64100. Fixes #64014. Fixes #61908.
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
* C#: Rename `ConvertToX` methodsRaul Santos2022-12-231-1/+1
| | | | | | | - Renamed `ConvertToX` to `ConvertToNativeX`. - Renamed `ConvertToXObject` to `ConvertToX`. - Renamed `ConvertToXManaged` to `ConvertToX`. - Fix `Signal` name in bindings generator and csharp script.
* C#: Add note about the class name in instantiate errorRaul Santos2022-12-171-1/+1
| | | | | Adds a note about the requirement that a C# class name must match the script filename in which the they are defined to the instantiate error.
* Rename all gdnative occurences to gdextensionGilles Roudière2022-12-121-3/+3
| | | | | | | | | | | | | Non-exhaustive list of case-sensitive renames: GDExtension -> GDNative GDNATIVE -> GDEXTENSION gdextension -> gdnative ExtensionExtension ->Extension (for where there was GDNativeExtension) EXTENSION_EXTENSION ->EXTENSION (for where there was GDNATIVE_EXTENSION) gdnlib -> gdextension gdn_interface -> gde_interface gdni -> gde_interface
* Merge pull request #67023 from raulsntos/dotnet/fix-signal-callback-generationIgnacio Roldán Etcheverry2022-12-021-7/+7
|\ | | | | C#: Fix signature of generated signal callbacks
| * C#: Fix signature of generated signal callbacksRaul Santos2022-10-071-7/+7
| | | | | | | | | | - Use `long` and `double` types since signals currently only support 64-bit types. - Fix bug for checking if the type name is a class registered in ClassDB.
* | Use forward-declarations in big editor classestrollodel2022-11-291-0/+1
| |
* | C#: Load assemblies as collectible only in the Godot editorIgnacio Roldán Etcheverry2022-10-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We use collectible AssemblyLoadContexts as that's the only way to allow reloading assemblies after building. However, collectible assemblies have some restrictions: - https://learn.microsoft.com/en-us/dotnet/framework/reflection-and-codedom/collectible-assemblies#restrictions-on-collectible-assemblies Those restrictions can cause issues with third-party code, such as some mocking libraries. In order to work around this problem, we're going to load assemblies as collectible only in Godot editor, and not when running games. These issues will still exist in the editor, but this will be enough for some users.
* | GDScript/C#: Tweak error message for invalid script type for objectRémi Verschelde2022-10-041-2/+2
|/ | | | See #66870.
* Rename and expose `RefCounted::get_reference_count()`Marc Gilleron2022-09-211-4/+4
|
* C#: Fix module builds for Windows 32-bit with mingw-w64Ignacio Roldán Etcheverry2022-09-081-41/+48
| | | | The lambda was giving issues, so I re-wrote it as a static function.
* Merge pull request #65266 from raulsntos/dotnet/reload-non-tool-scriptsRémi Verschelde2022-09-051-5/+39
|\ | | | | | | Create script instance of reloaded scripts even if they're not tools
| * C#: Create script instance of reloaded scripts even if they're not toolsRaul Santos2022-09-041-5/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Scripts that are instantiated at some point will always be recreated if they ever become placeholders to prevent non-tool scripts instantiated manually by users to become placeholders, if they do become placeholders due to errors that prevent instantiation (such as a missing parameterless constructor) these scripts will also be recreated replacing the temporary placeholder. If a script is marked as a tool but becomes a non-tool script in a rebuild, the script will become a placeholder and will no longer be considered applicable to be replaced by an instance since the user explicitly removed the Tool attribute.
* | C#: Connect only once for each signal of a scriptRaul Santos2022-09-031-12/+8
|/ | | | | | | Since the list of signals in `CSharpScript::event_signals` retrieved from calling `ScriptManagerBridge.UpdateScriptClassInfo` already includes the signals from base scripts there is no need to iterate the hierarchy again on `CSharpInstance::connect_event_signals`.
* Rename String `plus_file` to `path_join`Aaron Franke2022-08-291-2/+2
|
* C#: Replace P/Invoke with delegate pointersIgnacio Roldán Etcheverry2022-08-221-14/+5
| | | | | | | | | | | | | | | | - 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>
* C#: Use custom project setting for C# project files nameIgnacio Roldán Etcheverry2022-08-221-14/+9
| | | | | | | | | 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.
* C#: Add dedicated Variant struct, replacing System.ObjectIgnacio Roldán Etcheverry2022-08-221-1/+1
|
* C#: Add source generator for method listIgnacio Roldán Etcheverry2022-08-221-51/+58
|
* C#: Add source generator for signals as eventsIgnacio Roldán Etcheverry2022-08-221-39/+71
| | | | | | | | | Changed the signal declaration signal to: ``` // The following generates a MySignal event [Signal] public delegate void MySignalEventHandler(int param); ```
* C#: Re-implement assembly reloading with ALCsIgnacio Roldán Etcheverry2022-08-221-243/+108
|
* C#: Initial NativeAOT supportIgnacio Roldán Etcheverry2022-08-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* C#: Re-introduce exception logging and error stack traces in editorIgnacio Roldán Etcheverry2022-08-221-77/+5
| | | | | These two had been disabled while moving to .NET 5, as the previous implementation relied on Mono embedding APIs.
* C#: Ensure we only create one CSharpScript per typeIgnacio Roldán Etcheverry2022-08-221-15/+35
| | | | | | | | Previously, for each scripts class instance that was created from code rather than by the engine, we were constructing, configuring and assigning a new CSharpScript. This has changed now and we make sure there's only one CSharpScript associated to each type.