summaryrefslogtreecommitdiffstats
path: root/modules/mono/csharp_script.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Allow configuring the script filename casing ruleRedMser2024-03-051-0/+4
| | | | | | Defaults to "Auto", which detects the casing based on the preference of the currently selected language (C# for example prefers PascalCase whereas GDScript prefers snake_case).
* Enhance cache modes in resource loadingPedro J. Estébanez2024-02-261-0/+2
| | | | | | | - Unify documentation, hoping to clear misconcepctions about about propagation of the cache mode across dependant loads. - Clarify in docs that `CACHE_MODE_REPLACE` now also works on the main resource (from #87008). - Add two recursive modes, counterparts of `CACHE_MODE_REPLACE` and `CACHE_MODE_IGNORE`, since it seems some need them (see #59669, #82830). - Let resources, even loaded with one of the ignore-cache modes, get a path, which is useful for tools.
* Fix Script Editor saves C# files as embedded scriptsNông Văn Tình2024-02-251-1/+16
| | | | | | | fixes: #88543 fixes: #88160 Because of the limitations of compiled programming languages like C#, when a newly created *.cs file hasn't been compiled, we don't have any information about its `Path` or `Type` in the `assemply`. This means we end up creating an invalid instance of this file whenever there's a request. Consequently, multiple instances of the script can exist. When a new instance takes over the path, it clears the `path_cache` of the previous instance, leading to undefined behavior.
* Merge pull request #87952 from paulloz/dotnet/byebye-signal-callback-generationRémi Verschelde2024-02-151-16/+5
|\ | | | | | | Disable signal callback generation in C#
| * Disable signal callback generation in C#Paul Joannon2024-02-141-16/+5
| |
* | Add const lvalue ref to core/* container parametersMuller-Castro2024-02-141-1/+1
| |
* | Improve handling of generic C# typesRaul Santos2024-02-081-66/+30
| | | | | | | | | | | | | | | | | | | | | | - Create CSharpScript for generic C# types. - `ScriptPathAttributeGenerator` registers the path for the generic type definition. - `ScriptManagerBridge` lookup uses the generic type definition that was registered by the generator. - Constructed generic types use a virtual `csharp://` path so they can be registered in the map and loaded as if there was a different file for each constructed type, even though they all share the same real path. - This allows getting the base type for a C# type that derives from a generic type. - Shows base scripts in the _Add Node_ and _Create Resource_ dialogs even when they are generic types. - `get_global_class_name` implementation was moved to C# and now always returns the base type even if the script is not a global class (this behavior matches GDScript). - Create `CSharpScript::TypeInfo` struct to hold all the type information about the C# type that corresponds to the `CSharpScript`, and use it as the parameter in `UpdateScriptClassInfo` to avoid adding more parameters.
* | C#: Fix crash when reloading scriptsRaul Santos2024-02-071-18/+7
|/ | | | | | The crash cond was accidentally moved to the `reload_scripts` method when it was only meant to be in the `reload_tool_script` method. Same about restarting the HotReloadAssemblyWatcher timer. Also removed the loop that checks if the script array contains a C# script because if we're in CSharpLanguage we can assume that at least one of them is.
* Fixed ~CSharpScript() holding on to a mutex longer than necessary, creating ↵Michael Wörner2024-01-281-3/+5
| | | | potential for a deadlock.
* Merge pull request #87550 from zaevi/fix_csharp_generic_reloadingRémi Verschelde2024-01-261-2/+8
|\ | | | | | | C#: Fix sorting for generic types when reloading assemblies.
| * C#: Fix sorting for generic types when reloading assemblies.Zae2024-01-261-2/+8
| |
* | Merge pull request #85504 from nongvantinh/fix-csharp-loaderRémi Verschelde2024-01-261-1/+4
|\ \ | |/ |/| | | Fix C# script loader does not work reliably
| * Fixes C# script loader does not work reliablyNông Văn Tình2024-01-221-1/+4
| |
* | Merge pull request #87286 from akien-mga/fix-preprocessor-if-ENABLED-checksYuri Sizov2024-01-171-3/+3
|\ \ | | | | | | | | | Fix `#if *_ENABLED` inconsistencies, should check if defined
| * | Fix `#if *_ENABLED` inconsistencies, should check if definedRémi Verschelde2024-01-171-3/+3
| | | | | | | | | | | | Co-authored-by: Caroline Joy Bell <halotroop2288@proton.me>
* | | Merge pull request #86676 from rune-scape/sparse-script-reloadYuri Sizov2024-01-171-3/+20
|\ \ \ | |/ / |/| | | | | GDScript: Hot-reload changed scripts only
| * | Hot-reload only changed scriptsrune-scape2024-01-021-3/+20
| |/
* | C#: Fix return type hint for methods.Zae2024-01-091-0/+2
| |
* | Add const lvalue ref to container parametersMuller-Castro2024-01-051-1/+1
| |
* | Inspector :warning: when C# props might be out of datePaul Joannon2023-12-221-0/+11
|/
* C#: Fail `callp` silently if script is not validRaul Santos2023-11-141-6/+6
|
* Merge pull request #83670 from raulsntos/notification-predelete-cleanupRémi Verschelde2023-11-091-10/+17
|\ | | | | | | Add `NOTIFICATION_PREDELETE_CLEANUP` notification to fix C# `Dispose()`
| * Add `NOTIFICATION_PREDELETE_CLEANUP` notificationRaul Santos2023-10-201-10/+17
| | | | | | | | New notification sent after `NOTIFICATION_PREDELETE` to let Objects cleanup at the very end, it should be the last notification sent.
* | Merge pull request #78157 from RedworkDE/net-shutting-down-abruptlyRémi Verschelde2023-10-311-0/+4
|\ \ | |/ |/| C#: Fix crash with `DisposablesTracker_OnGodotShuttingDown`
| * C#: Fix crash with `DisposablesTracker_OnGodotShuttingDown`RedworkDE2023-06-131-0/+4
| |
* | C#: Allow exporting games without C#Raul Santos2023-10-161-7/+7
| | | | | | | | When exporting a game that contains a C# solution, a feature is added so the exported game can check if it should initialize the .NET module. Otherwise, the module initialization is skipped so games without C# won't check for the assemblies and won't show alerts when they're missing.
* | Highlight doc comments in a different colorDanil Alexeev2023-10-081-0/+5
| |
* | Merge pull request #81101 from 398utubzyt/dotnet/abstract-class-supportRémi Verschelde2023-09-251-9/+12
|\ \ | | | | | | | | | C#: Add abstract class support
| * | C#: Abstract script class support398utubzyt2023-09-151-9/+12
| | |
* | | Merge pull request #78573 from dalexeev/editor-create-script-class-nameRémi Verschelde2023-09-251-4/+0
|\ \ \ | | | | | | | | | | | | Editor: Remove unused Class Name field from Create Script dialog
| * | | Editor: Remove unused Class Name field from Create Script dialogDanil Alexeev2023-09-121-4/+0
| |/ /
* | | Merge pull request #81783 from zaevi/fix-csharp-static-methodRémi Verschelde2023-09-201-0/+14
|\ \ \ | | | | | | | | | | | | C#: make C# static methods accessible.
| * | | C#: make C# static methods accessible.Zae2023-09-201-0/+14
| |/ /
* / / Editor: Improve signal callback generationDanil Alexeev2023-09-111-0/+5
|/ /
* | Merge pull request #81073 from raulsntos/dotnet/cached-string-namesRémi Verschelde2023-08-311-17/+7
|\ \ | | | | | | | | | C#: Replace `StringNameCache` with `SNAME`
| * | C#: Replace `StringNameCache` with `SNAME`Raul Santos2023-08-281-17/+7
| | |
* | | Fix Object::notification orderMarkus Sauermann2023-08-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the `p_reversed` parameter didn't influence the order in a correct way. Also script overridden _notification functions were not called in the correct order. To fix this some `notification` functions had to add a `p_reversed` parameter. This made it necessary to adjust cpp-bindings. Co-authored-by: David Snopek <dsnopek@gmail.com>
* | | Expose _validate_property() for scriptingkobewi2023-08-281-1/+20
|/ /
* | C#: Generate instance types for singletonsRaul Santos2023-08-061-1/+1
| |
* | 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>