summaryrefslogtreecommitdiff
path: root/modules/mono
AgeCommit message (Collapse)Author
2020-05-19Merge pull request #38863 from neikeq/csharp-no-false-error-objtype-reloadRémi Verschelde
Mono/C#: Remove script load error about not a Godot.Object
2020-05-19Mono/C#: Remove script load error about not a Godot.ObjectIgnacio Etcheverry
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.
2020-05-16Added tests for ClassDBIgnacio Etcheverry
2020-05-14Style: Enforce separation line between function definitionsRémi Verschelde
I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
2020-05-14Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde
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.
2020-05-14Modernize remaining uses of 0/NULL instead of nullptr (C++11)Rémi Verschelde
Using clang-tidy's `modernize-use-nullptr`. https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
2020-05-14Port member initialization from constructor to declaration (C++11)Rémi Verschelde
Using `clang-tidy`'s `modernize-use-default-member-init` check and manual review of the changes, and some extra manual changes that `clang-tidy` failed to do. Also went manually through all of `core` to find occurrences that `clang-tidy` couldn't handle, especially all initializations done in a constructor without using initializer lists.
2020-05-11Merge pull request #38638 from pepegadeveloper123/mono_inherited_scene_bugRémi Verschelde
Fix inherited C# scene not inheriting parent's fields
2020-05-11Merge pull request #38650 from neikeq/dotnet-cli-supportRémi Verschelde
C#: Support for building with the dotnet CLI
2020-05-11C#: Support for building with the dotnet CLIIgnacio Etcheverry
By adding a reference to the 'Microsoft.NETFramework.ReferenceAssemblies' nuget package, we can build projects targeting .NET Framework with the dotnet CLI. By referencing this package we also don't need to install Mono on Linux/macOS or .NET Framework on Windows, as the assemblies are taken from the package.
2020-05-10Implement CSharpScript::inherits_scriptIgnacio Etcheverry
2020-05-11Inherited C# scene not inheriting parent's fieldspepegadeveloper123
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.
2020-05-10Revert "Renamed plane's d to distance"Rémi Verschelde
This reverts commit ec7b481170dcd6a7b4cf0e6c1221e204ff7945f3. This was wrong, `d` is not a distance but the `d` constant in the parametric equation `ax + by + cz = d` describing the plane.
2020-05-10Merge pull request #38621 from akien-mga/stylé-comme-jamaisRémi Verschelde
Style: clang-format: Disable if statements and case labels on single line
2020-05-10Merge pull request #38600 from neikeq/noIgnacio Roldán Etcheverry
Switch to nuget Microsoft.Build and rewrite GodotTools messasing protocol
2020-05-10Style: clang-format: Disable AllowShortCaseLabelsOnASingleLineRémi Verschelde
Part of #33027.
2020-05-10Style: clang-format: Disable AllowShortIfStatementsOnASingleLineRémi Verschelde
Part of #33027, also discussed in #29848. Enforcing the use of brackets even on single line statements would be preferred, but `clang-format` doesn't have this functionality yet.
2020-05-10Renamed plane's d to distanceMarcus Elg
2020-05-09C#: Rewrite GodotTools messaging protocolIgnacio Etcheverry
2020-05-09C#: Use Sdks in GodotTools csprojs and switch to nuget Microsoft.BuildIgnacio Etcheverry
2020-05-09C#/Mono: Check assembly version when loadingIgnacio Etcheverry
Not sure if we should check revision too, but this is good enough for what we want. This will be needed to load the correct Microsoft.Build when we switch to the nuget version.
2020-05-09C#: Remove StringExtensions.Empty() functionIgnacio Etcheverry
Causes issues with some editors as it's confused with `string.Empty`. Should use `string.IsNullOrEmpty(str)` instead.
2020-05-09Merge pull request #38596 from neikeq/msbuild-restoreIgnacio Roldán Etcheverry
Mono: Use msbuild instead of nuget.exe for restoring
2020-05-09Mono: Use msbuild instead of nuget.exe for restoringIgnacio Etcheverry
- Make GodotTools output directly to the SCons output directory. - Removed xbuild_fallback from the build system.
2020-05-09Mono: Fix hot-reloading of nested classesIgnacio Etcheverry
2020-05-07Merge pull request #36379 from aaronfranke/color-constructorsRémi Verschelde
Add a Color constructor for Color with alpha
2020-05-03Remove some C++11 polyfill defines that are no longer neededHugo Locurcio
2020-04-29Color with alpha constructorAaron Franke
2020-04-29Fix growMargin() not returning modified Rect2/Rect2iNannaquin
2020-04-29[Mono] Rename LinearInterpolate to LerpAaron Franke
2020-04-29Merge pull request #36960 from pycbouh/docs-improve-shortcutsRémi Verschelde
Improve shortcut formatting in docs
2020-04-23Mono/C#: Fix load hook not called for some assemblies on domain reloadIgnacio Etcheverry
2020-04-23C#: Fix always saving copy of csproj even with no changesIgnacio Etcheverry
This was a regression from 93d7ec88360a467a3041c0aa08390daa1f75892b (#38110). Mono's old implementation of Microsoft.Build hardcodes HasUnsavedChanges to always return true. This workaround can be reverted once we switch to official Microsoft.Build.
2020-04-23Merge pull request #38123 from neikeq/fix-hotreload-twiceRémi Verschelde
Mono/C#: Fix assemblies being reloaded a second time unnecesarily
2020-04-23C#: Revert marshalling of IDictionary/IEnumerable implementing typesIgnacio Etcheverry
Added marshalling for `System.Collections.Generic.List<T>` and `System.Collections.Generic.Dictionary<TKey, TValue>`.
2020-04-23Mono/C#: Fix assemblies being reloaded a second time unnecesarilyIgnacio Etcheverry
2020-04-22Merge pull request #38117 from neikeq/export-mono-array-godot-objectIgnacio Roldán Etcheverry
Mono/C#: Allow exporting System.Array of type Godot.Object
2020-04-22Merge pull request #38110 from neikeq/csproj-safer-migrationIgnacio Roldán Etcheverry
C#: Save copy of sln and csproj before applying fixes
2020-04-22Mono/C#: Allow exporting System.Array of type Godot.ObjectIgnacio Etcheverry
2020-04-22C#: Save copy of sln and csproj before applying fixesIgnacio Etcheverry
2020-04-22Mono/C#: Allow debugging exported gamesIgnacio Etcheverry
- Include PDB files in exported games. - Release export templates also allow debugging now. Right now the only way to enable debugging in exported games is with the environment variables, which may be cumbersome or not even possible on some platforms.
2020-04-21Add ability to bind typed arrays to script APIJuan Linietsky
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)
2020-04-20Exposed RenderingDevice to script APIJuan Linietsky
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.
2020-04-20Fix handling of PROPERTY_USAGE_SUBGROUP in DocData and editorRémi Verschelde
Subgroups were added in #37678 but not properly handled everywhere where PROPERTY_USAGE_GROUP is.
2020-04-18Mono: Fix include for Android supportRémi Verschelde
This was a typo in #37153. Co-authored-by: Ignacio Etcheverry <ignalfonsore@gmail.com>
2020-04-10Improve shortcut formatting in docsYuri Sizov
2020-04-03Fix C# bindings after recent breaking changesIgnacio Etcheverry
2020-04-02Replace more occurrences of NULL with nullptrRémi Verschelde
2020-04-02Replace NULL with nullptrlupoDharkael
2020-04-01Merge pull request #37484 from Calinou/csharp-verbatim-string-highlightRémi Verschelde
Remove syntax highlighting for C# verbatim strings due to bugs