summaryrefslogtreecommitdiffstats
path: root/modules/mono/csharp_script.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Rename `instance()`->`instantiate()` when it's a verbLightning_A2021-06-191-5/+5
|
* Consolidate JSON, JSONParseResults and JSONParser into JSONMarcel Admiraal2021-06-191-1/+0
| | | | | Renames JSON.parse_string() to parse() Renames JSON.decode_data() to stringify()
* Fix slow load/save of scenes with many instances of the same scriptPedro J. Estébanez2021-06-131-5/+9
|
* Improve & fix Mono buildPedro J. Estébanez2021-06-131-1/+1
| | | | | | - 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`.
* Rename Reference to RefCountedPedro J. Estébanez2021-06-111-53/+53
|
* Core: Move DirAccess and FileAccess to `core/io`Rémi Verschelde2021-06-111-1/+1
| | | | | File handling APIs are typically considered part of I/O, and we did have most `FileAccess` implementations in `core/io` already.
* Merge pull request #49221 from Faless/mp/4.x_rpc_refactorRémi Verschelde2021-06-071-127/+8
|\ | | | | [Net] Refactor RPCs, remove RSETs
| * [Net] Refactor RPCs, remove RSETsFabio Alessandrelli2021-06-011-127/+8
| | | | | | | | | | | | | | | | | | | | 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.
* | Rename Quat to QuaternionMarcel Admiraal2021-06-041-1/+1
| |
* | Rename Variant TRANSFORM to TRANSFORM3DAaron Franke2021-06-031-1/+1
|/ | | Also _transform to _transform3d
* Fix typos with codespellRémi Verschelde2021-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using codespell 2.0.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang curvelinear dof doubleclick fave findn GIRD leapyear lod merchantibility nd numer ois ony que seeked synching te uint unselect webp EOF $ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po" $ git diff // undo unwanted changes ```
* Highlight control flow keywords with a different colorHugo Locurcio2021-05-051-0/+20
| | | | This makes them easier to distinguish from other keywords.
* Remove uses of `auto` for better readability and online code reviewsHugo Locurcio2021-04-261-2/+2
| | | | | | | | The current code style guidelines forbid the use of `auto`. Some uses of `auto` are still present, such as in UWP code (which can't be currently tested) and macros (where removing `auto` isn't easy).
* C#: Fix disconnecting event signals twiceIgnacio Etcheverry2021-03-151-11/+9
| | | | | `disconnect_event_signals` can be called twice (when managed instance is disposed and from the ScriptInstance destructor).
* Fix create c# script after partial class typesboronczyk2021-03-131-1/+1
|
* Add C# source generator for a new ScriptPath attributeIgnacio Etcheverry2021-03-061-60/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This source generator adds a newly introduced attribute, `ScriptPath` to all classes that: - Are top-level classes (not inner/nested). - Have the `partial` modifier. - Inherit `Godot.Object`. - The class name matches the file name. A build error is thrown if the generator finds a class that meets these conditions but is not declared `partial`, unless the class is annotated with the `DisableGodotGenerators` attribute. We also generate an `AssemblyHasScripts` assembly attribute which Godot uses to get all the script classes in the assembly, eliminating the need for Godot to search them. We can also avoid searching in assemblies that don't have this attribute. This will be good for performance in the future once we support multiple assemblies with Godot script classes. This is an example of what the generated code looks like: ``` using Godot; namespace Foo { [ScriptPathAttribute("res://Player.cs")] // Multiple partial declarations are allowed [ScriptPathAttribute("res://Foo/Player.cs")] partial class Player {} } [assembly:AssemblyHasScripts(new System.Type[] { typeof(Foo.Player) })] ``` The new attributes replace script metadata which we were generating by determining the namespace of script classes with a very simple parser. This fixes several issues with the old approach related to parser errors and conditional compilation. It also makes the task part of the MSBuild project build, rather than a separate step executed by the Godot editor.
* Improve resource load cachereduz2021-02-111-1/+1
| | | | | | -Added a new method in Resource: reset_state , used for reloading the same resource from disk -Added a new cache mode "replace" in ResourceLoader, which reuses existing loaded sub-resources but resets their data from disk (or replaces them if they chaged type) -Because the correct sub-resource paths are always loaded now, this fixes bugs with subresource folding or subresource ordering when saving.
* C # mono supports Unicode codemagian11272021-01-191-2/+2
|
* CI: Update to clang-format 11 and apply ternary operator changesRémi Verschelde2021-01-121-2/+2
|
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Rename empty() to is_empty()Marcel Admiraal2020-12-281-8/+8
|
* Fixes #42149 and fixes indentation errors to pass clang-formatEyad2020-12-191-5/+10
|
* Refactor DocData into core and editor (DocTools) partsThakee Nathees2020-12-021-1/+1
|
* Variant: Rename Type::_RID to Type::RIDRémi Verschelde2020-11-091-1/+1
| | | | | | | | The underscore prefix was used to avoid the conflict between the `RID` class name and the matching enum value in `Variant::Type`. This can be fixed differently by prefixing uses of the `RID` class in `Variant` with the scope resolution operator, as done already for `AABB`.
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-1/+1
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* C#: Fix custom event signals crash on hot-reloadIgnacio Etcheverry2020-10-261-5/+10
| | | | | Cleanup and re-initialization of event signals before and after hot-reload should be working correctly now.
* Fix code duplication in CSharpScriptopl-2020-10-131-116/+74
| | | | | | | | Removes code duplication between `CSharpScript::reload()` and `CSharpScript::initialize_for_managed_type()`. Removes a redundant `CSharpScript::update_exports()` call in `CSharpLanguage::reload_assemblies()` as `CSharpScript::reload()` already calls it when appropriate. Fixes missing update of RPC information in `CSharpScript::initialize_for_managed_type()`.
* Fix error message when exporting a write-only property without a setterEduardo Rodrigues2020-09-291-2/+2
|
* Merge pull request #40595 from neikeq/godot-net-sdk-and-net-standardRémi Verschelde2020-07-261-8/+3
|\ | | | | C#: Switch games to MSBuild Sdks and .NET Standard
| * C#: Switch games to MSBuild Sdks and .NET StandardIgnacio Etcheverry2020-07-251-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Godot.NET.Sdk ------------- Godot uses its own custom MSBuild Sdk for game projects. This new Sdk adds its own functionality on top of 'Microsoft.NET.Sdk'. The new Sdk is resolved from the NuGet package. All the default boilerplate was moved from game projects to the Sdk. The default csproj for game project can now be as simple as: ``` <Project Sdk="Godot.NET.Sdk/4.0.0-dev2"> <PropertyGroup> <TargetFramework>netstandard2.1</TargetFramework> </PropertyGroup> </Project> ``` Source files are included by automatically so Godot no longer needs to keep the csproj in sync when creating new source files. Define constants ---------------- Godot defines a list of constants for conditional compilation. When exporting games, this list also included engine 'features' and platform 'bits'. There were a few problems with that: - The 'features' constants were only defined when exporting games. Not when building the game for running in the editor player. - If the project was built externally by an IDE, the constants wouldn't be defined at all. The new Sdk assigns default values to these constants when not built from the Godot editor, i.e.: when built from an IDE or from the command line. The default define constants are determined from the system MSBuild is running on. However, it's not possible for MSBuild to determine the set of supported engine features. It's also not possible to determine if a project is being built to run on a 32-bit or 64-bit Godot executable. As such the 'features' and 'bits' constants had to be removed. The benefit of checking those at compile time was questionable, and they can still be checked at runtime. The new list of define constants includes: - GODOT - GODOT_<PLATFORM> Defaults to the platform MSBuild is running on. - GODOT_<PC/MOBILE/WEB> - TOOLS When building with the 'Debug' configuration (editor and editor player). - GODOT_REAL_T_IS_DOUBLE Not defined by default unless $(GodotRealTIsDouble) is overriden to be 'true'. .NET Standard ------------- The target framework of game projects was changed to 'netstandard2.1'.
* | Remove multilevel callsGeorge Marques2020-07-241-37/+2
|/ | | | | | In general they are more confusing to users because they expect inheritance to fully override parent methods. This behavior can be enabled by script writers using a simple super() call.
* Commit other files changed by file_format.shAaron Franke2020-07-131-3/+3
|
* Mono/C#: Fix several clang-tidy warnings and cleanupIgnacio Etcheverry2020-07-051-109/+204
|
* Fixes building mono release templatesNutmegStudio2020-05-301-0/+2
|
* Mono/C#: Fix values not updated in remote inspectorIgnacio Etcheverry2020-05-221-16/+40
|
* Mono/C#: Remove script load error about not a Godot.ObjectIgnacio Etcheverry2020-05-191-3/+1
| | | | | | | | | | | Any C# file can be loaded as script and at load time we don't yet know if it's actually meant to be used as a script. As such, such an check can result in a lot of false errors. If the file is really meant to be used as a script, an error would be printed later when attempting to instantiate it any way.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-128/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Modernize remaining uses of 0/NULL instead of nullptr (C++11)Rémi Verschelde2020-05-141-1/+1
| | | | | Using clang-tidy's `modernize-use-nullptr`. https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
* Merge pull request #38638 from pepegadeveloper123/mono_inherited_scene_bugRémi Verschelde2020-05-111-67/+92
|\ | | | | Fix inherited C# scene not inheriting parent's fields
| * Inherited C# scene not inheriting parent's fieldspepegadeveloper1232020-05-111-67/+92
| | | | | | | | | | | | | | | | | | | | | | | | When a child scene inherits a parent scene with a C# root node, the parent scene's export variables appear to assume values set in the parent scene, in the child scene's Inspector. However, when the child scene is played, the parent scene's export variables assume default values. When a node is created, it inherits its parent C# script's fields from the map CSharpScriptInstance::script->member_info. However this map was not initialized outside the editor, and this commit ensured it is. This fixes issues #36480 and #37581.
* | Implement CSharpScript::inherits_scriptIgnacio Etcheverry2020-05-101-4/+9
|/
* Mono: Fix hot-reloading of nested classesIgnacio Etcheverry2020-05-091-1/+1
|
* Add ability to bind typed arrays to script APIJuan Linietsky2020-04-211-0/+12
| | | | | | | Note: Only replaced 2 instances to test, Node.get_children and TileMap.get_used_cells Note: Will do a mass replace on later PRs of whathever I can find, but probably need a tool to grep through doc. Warning: Mono will break, needs to be fixed (and so do TypeScript and NativeScript, need to ask respective maintainers)
* Exposed RenderingDevice to script APIJuan Linietsky2020-04-201-1/+1
| | | | | | | | | | | | | Also added an easier way to load native GLSL shaders. Extras: Had to fix no-cache for subresources in resource loader, it was not properly working, making shaders not properly reload. Note: The precommit hooks are broken because they don't seem to support enums from one class being used in another. Feel free to fix this after merging this PR.
* Replace NULL with nullptrlupoDharkael2020-04-021-86/+86
|
* Merge pull request #37484 from Calinou/csharp-verbatim-string-highlightRémi Verschelde2020-04-011-1/+2
|\ | | | | Remove syntax highlighting for C# verbatim strings due to bugs
| * Remove syntax highlighting for C# verbatim strings due to bugsHugo Locurcio2020-04-011-1/+2
| | | | | | | | This closes #32336.
* | Mono/C#: Add iOS supportIgnacio Etcheverry2020-03-311-1/+1
|/ | | | | | Right now, games only work on devices when exported with FullAOT+Interpreter. There are some issues left that need to addressed for FullAOT alone. Right now, it's giving issues with the Godot.NativeCalls static constructor.
* Merge pull request #37116 from neikeq/issue-12917Rémi Verschelde2020-03-181-16/+0
|\ | | | | Sync csproj when files are changed from the Godot FileSystem dock
| * Sync csproj when files are changed from the Godot FileSystem dockIgnacio Etcheverry2020-03-181-16/+0
| |