summaryrefslogtreecommitdiffstats
path: root/modules/mono/csharp_script.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Swap arguments of ResourceSaver.save()kobewi2022-07-291-1/+1
|
* [Net] Modularize multiplayer, expose MultiplayerAPI to extensions.Fabio Alessandrelli2022-07-261-22/+17
| | | | | | | | | - RPC configurations are now dictionaries. - Script.get_rpc_methods renamed to Script.get_rpc_config. - Node.rpc[_id] and Callable.rpc now return an Error. - Refactor MultiplayerAPI to allow extension. - New MultiplayerAPI.rpc method with Array argument (for scripts). - Move the default MultiplayerAPI implementation to a module.
* Implement Vector4, Vector4i, Projectionreduz2022-07-231-0/+3
| | | | | | | | | | | | | Implement built-in classes Vector4, Vector4i and Projection. * Two versions of Vector4 (float and integer). * A Projection class, which is a 4x4 matrix specialized in projection types. These types have been requested for a long time, but given they were very corner case they were not added before. Because in Godot 4, reimplementing parts of the rendering engine is now possible, access to these types (heavily used by the rendering code) becomes a necessity. **Q**: Why Projection and not Matrix4? **A**: Godot does not use Matrix2, Matrix3, Matrix4x3, etc. naming convention because, within the engine, these types always have a *purpose*. As such, Godot names them: Transform2D, Transform3D or Basis. In this case, this 4x4 matrix is _always_ used as a _Projection_, hence the naming.
* Merge pull request #62805 from raulsntos/csharp-rpcRémi Verschelde2022-07-071-17/+16
|\
| * C#: New `RPCAttribute`Raul Santos2022-07-071-17/+16
| | | | | | | | | | Replace old RPC attributes with a new single `RPCAttribute` which works like the GDScript `@rpc` annotation.
* | C#: Enable exporting nodes to the inspectorRaul Santos2022-07-061-0/+6
|/
* Support explicit values in flag properties, add C# flags supportRaul Santos2022-06-031-2/+4
| | | | | | | | | - Add support for explicit values in properties using `PROPERTY_HINT_FLAGS` that works the same way it does for enums. - Fix enums and flags in VisualScriptEditor (it wasn't considering the explicit value). - Use `PROPERTY_HINT_FLAGS` for C# enums with the FlagsAttribute instead of `PROPERTY_HINT_ENUM`.
* Add a new HashSet templatereduz2022-05-201-9/+9
| | | | | * Intended to replace RBSet in most cases. * Optimized for iteration speed
* Replace most uses of Map by HashMapreduz2022-05-161-19/+19
| | | | | | | | | | | | * Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
* Add a new HashMap implementationreduz2022-05-121-4/+4
| | | | | | | | | | | | | | | | | Adds a new, cleaned up, HashMap implementation. * Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing). * Keeps elements in a double linked list for simpler, ordered, iteration. * Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much for performance vs keeping the key, but helps replace old code). * Uses a more modern C++ iterator API, deprecates the old one. * Supports custom allocator (in case there is a wish to use a paged one). This class aims to unify all the associative template usage and replace it by this one: * Map<> (whereas key order does not matter, which is 99% of cases) * HashMap<> * OrderedHashMap<> * OAHashMap<>
* Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`Hugo Locurcio2022-05-031-8/+8
| | | | | | These typedefs don't save much typing compared to the full `Ref<Resource>` and `Ref<RefCounted>`, yet they sometimes introduce confusion among new contributors.
* Narrow FileAccess scope to prevent deadlocks.bruvzg2022-04-121-6/+8
|
* Make FileAccess and DirAccess classes reference counted.bruvzg2022-04-111-5/+1
|
* String: Remove TTR and DTR defines in non-tools buildRémi Verschelde2022-03-281-1/+1
| | | | | This ensures we don't use TTR in runtime code, as it's specifically meant to source translations for the editor.
* Refactor GDScript/C# script templates logic to be editor-onlyRémi Verschelde2022-03-281-2/+4
| | | | | Not a full refactor as it still goes through ScriptLanguage so it's hacky, but at least it can now compile without this.
* Remove VARIANT_ARG* macrosreduz2022-03-091-3/+3
| | | | | | | | * Very old macros from the time Godot was created. * Limited arguments to 5 (then later changed to 8) in many places. * They were replaced by C++11 Variadic Templates. * Renamed methods that take argument pointers to have a "p" suffix. This was used in some places and not in others, so made it standard. * Also added a dereference check for Variant*. Helped catch a couple of bugs.
* Remove duplicate editor settings definitionskobewi2022-03-061-2/+2
|
* Attach mono thread before getting nativeName fieldRaul Santos2022-02-071-2/+2
| | | | | In order to access the `nativeName` constant field from a C# class, the mono scope thread must be attached or the mono domain will be null.
* Store panels and docks singletons in their own classestrollodel2022-01-201-2/+2
|
* Merge pull request #55679 from raulsntos/script_reload_fixIgnacio Roldán Etcheverry2022-01-161-5/+7
|\ | | | | C# scripts reload in editor fixed
| * C# script reload fixedRaul Santos2021-12-061-5/+7
| | | | | | | | | | Co-authored-by: Michael Bickel <mib@developium.net> Co-authored-by: Germanrc <german_1995a@hotmail.com>
* | Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | | | | | Happy new year to the wonderful Godot community!
* | Merge pull request #53957 from fabriceci/new-template-workflowRémi Verschelde2022-01-031-44/+21
|\ \
| * | Improve editor template workflowfabriceci2022-01-021-44/+21
| |/ | | | | | | Co-Authored-By: jmb462 <jmb462@gmail.com>
* / Fix getting properties state when reloading C#Raul Santos2021-12-281-1/+10
|/ | | | | | | | When reloading C# classes and keep their properties values they are retrieved and stored in a state list. Retrieving the properties was only getting the fields of the C# class and not inherited fields so those properties values were lost on reload. Now we also try to find the field in the parent classes.
* Move logic for saving project features to ProjectSettings save_customAaron Franke2021-11-251-5/+1
|
* Use "enum class" for input enumsAaron Franke2021-11-121-1/+1
|
* Rename `PROPERTY_USAGE_NOEDITOR` to `PROPERTY_USAGE_NO_EDITOR`Hugo Locurcio2021-11-031-1/+1
| | | | | This is consistent with other constants that include `NO`, such as `PROPERTY_HINT_COLOR_NO_ALPHA`.
* Ensure C# script properties are added to the endRaul Santos2021-10-301-4/+15
| | | | | | Ensures that the `get_property_list` and `get_script_property_list` methods push the script properties to the end of the given list, this prevents the script property from appearing after the script variables.
* clang-format: Enable `BreakBeforeTernaryOperators`Rémi Verschelde2021-10-281-4/+4
| | | | | clang-format keeps breaking the way it handles break *after* ternary operators, so I give up and go with the only style they seem to actually test.
* clang-format: Disable alignment of operands, too unreliableRémi Verschelde2021-10-281-18/+17
| | | | | | | | | Sets `AlignOperands` to `DontAlign`. `clang-format` developers seem to mostly care about space-based indentation and every other version of clang-format breaks the bad mismatch of tabs and spaces that it seems to use for operand alignment. So it's better without, so that it respects our two-tabs `ContinuationIndentWidth`.
* Keep order for C# exported membersRaul Santos2021-10-221-8/+8
|
* C#: Fix property set call boxing value when unboxed was expectedIgnacio Roldán Etcheverry2021-10-191-1/+1
|
* [Net] Rename RPC constants and annotation arguments.Fabio Alessandrelli2021-10-011-2/+2
| | | | | | | | | any -> any_peer sync -> call_local ordered -> unreliable_ordered Multiplayer.RPC_MODE_ANY -> RPC_MODE_ANY_PEER Multiplayer.TRANSFER_MODE_ORDERED -> TRANSFER_MODE_UNRELIABLE_ORDERED
* Update C# RPC attributes to share new Any/Auth naming conventionEdward Auttonberry2021-09-281-2/+2
| | | | Update attribute class references in mono cache
* Merge pull request #51835 from magian1127/patch1Rémi Verschelde2021-09-171-4/+16
|\
| * check that the element type is indeed StringMagian2021-08-201-6/+13
| |
| * C# Array<String> Export Support Enum(String)Magian2021-08-181-2/+7
| |
* | Merge pull request #52633 from lewiji/mono-build-solution-shortcut-4.0Rémi Verschelde2021-09-141-0/+3
|\ \
| * | Add editor keyboard shortcut for Mono Build solution buttonLewis James2021-09-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Apply suggestions from code review Merging @akien-mga's suggestion with the matching change to the CS project Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
* | | Improve C# method listingPaul Joannon2021-09-121-4/+35
|/ / | | | | | | | | - implement CSharpInstance::get_method_list - loop through parent classes in CSharpInstance::get_method_list and CSharpScript::get_script_method_list (#46408)
* | Merge pull request #52246 from Paulb23/verbatim-stringMax Hilbrunner2021-09-081-1/+1
|\ \ | | | | | | Syntax highlight c# verbatim string literal
| * | syntax highlight c# verbatim string literalPaulb232021-08-301-1/+1
| | |
* | | [Net] Move multiplayer to core subdir, split RPCManager.Fabio Alessandrelli2021-09-071-11/+11
|/ / | | | | | | | | | | | | | | | | | | | | Move multiplayer classes to "core/multiplayer" subdir. Move the RPCConfig and enums (TransferMode, RPCMode) to a separate file (multiplayer.h), and bind them to the global namespace. Move the RPC handling code to its own class (RPCManager). Renames "get_rpc_sender_id" to "get_remote_sender_id".
* / [Net] Rename RPC "puppet" to "auth" (authority). Drop "master".Fabio Alessandrelli2021-08-301-5/+2
|/ | | | | | | | | | | | | | | | | | | | | | This commit completely removes the RPC_MODE_MASTER ("master" keyword), and renames the RPC_MODE_PUPPET to RPC_MODE_AUTHORITY ("auth" keyword). This commit also renames the "Node.[get|set]_network_master" methods to "Node.[get|set]_network_authority". This commit also renames the RPC_MODE_REMOTE constant to RPC_MODE_ANY. RPC_MODE_MASTER in Godot 3.x meant that a given RPC would be callable by any puppet peer on the master, while RPC_MODE_PUPPET meant that it would be callable by the master on any puppet. Beside proving to be very confusing to the user (referring to where it could be called instead of who can call it) the RPC_MODE_MASTER is quite useless. It is almost the same as RPC_MODE_REMOTE (anyone can call) with the exception that the network master cannot. While this could be useful to check in some case, in such a function you would anyway need to check in code who is the caller via get_rpc_sender_id(), so adding the check there for those rare cases does not warrants a dedicated mode.
* Merge pull request #51698 from Paulb23/text-editor-settingsRémi Verschelde2021-08-161-2/+2
|\ | | | | Reorganise text editor settings
| * Reorganise text editor settingsPaulb232021-08-161-2/+2
| |
* | Fix C# native instance bindings after recent re-writeIgnacio Roldán Etcheverry2021-08-161-90/+101
|/ | | | This was needed after: 44691448911f1d29d4d79dbdd5553734761e57c4
* Fix 'script_class' null access when reloading a deleted C# script312021-08-031-0/+7
|
* Use C++ iterators in the Mono moduleRaul Santos2021-07-271-57/+52
|