Commit Graph

53 Commits

Author SHA1 Message Date
Rémi Verschelde 8a9a26ef19
Merge pull request #93311 from dsnopek/gdextension-required-virtuals
GDExtension: Mark virtual function as `is_required` in `extension_api.json`
2024-09-27 13:53:16 +02:00
David Snopek c2af6bcb59 GDExtension: Mark virtual function as `is_required` in `extension_api.json`
Co-authored-by: Jovan Gerodetti <jovan.gerodetti@titannano.de>
2024-09-11 16:48:14 -05:00
Ryan 8835f326b1 Expose get_rpc_config and get_node_rpc_config
add documentation

Update doc/classes/Node.xml

change name of get_node_rpc_config to get_rpc_config

Co-Authored-By: moondog <159832633+dog-on-moon@users.noreply.github.com>
Co-Authored-By: Micky <66727710+Mickeon@users.noreply.github.com>
2024-09-04 15:45:22 -04:00
Jovan Gerodetti 21586da50e Make profiling_get_frame_data call the correct GDVIRTUAL method. 2024-06-18 00:53:25 +02:00
Chris Cranford fdc5b42646 Add default implementation of `ScriptLanguageExtension::preferred_file_name_casing`. 2024-05-04 18:50:04 -04:00
A Thousand Ships 64146cb7f3
[Core] Add iteration support to `Array` 2024-04-10 14:49:34 +02:00
A Thousand Ships 0c19d0f5a0
Add extension support for argument count to `ScriptInstance` 2024-03-13 22:40:09 +01:00
A Thousand Ships 59bcc2888c
Add methods to get argument count of methods
Added to:
* `Callable`s
* `Object`s
* `ClassDB`
* `Script(Instance)`s
2024-03-10 11:02:43 +01:00
RedMser 2bd714e34e
Allow configuring the script filename casing rule
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).
2024-03-05 09:43:29 +01:00
David Snopek 0badf07657 GDExtension: Pass count when freeing method and property lists for script instances 2024-03-02 10:13:37 -06:00
Rémi Verschelde 09df8f4a56
Merge pull request #87952 from paulloz/dotnet/byebye-signal-callback-generation
Disable signal callback generation in C#
2024-02-15 15:44:55 +01:00
Muller-Castro a8bc9f3e78 Add const lvalue ref to core/* container parameters 2024-02-14 11:20:36 -03:00
Paul Joannon 9fa2355cef
Disable signal callback generation in C# 2024-02-14 13:26:45 +01:00
Yuri Sizov c027aecc2e Merge pull request #86676 from rune-scape/sparse-script-reload
GDScript: Hot-reload changed scripts only
2024-01-17 18:52:54 +01:00
Muller-Castro 96a95cb974 Add const lvalue ref to container parameters 2024-01-05 14:49:57 -03:00
rune-scape cde478bda6 Hot-reload only changed scripts 2024-01-02 17:56:52 -08:00
msreis f1cc14d525 Fix missing time for some script functions in profiler
Fixes the issue by adding a mechanism by which the functions that were
previously disappearing can be profiled too. This is optional with
an editor setting, since collecting more information naturally slows the engine
further while profiling.

Fixes #23715, #40251, #29049
2023-12-19 19:42:21 +01:00
voidedWarranties e8309dd192 Add `path` option to `ScriptLanguageExtension::_validate` 2023-10-22 21:49:34 -07:00
Danil Alexeev de7cbe8789
Highlight doc comments in a different color 2023-10-08 19:26:10 +03:00
Danil Alexeev ed0b3c08e1
Core: Fix `Object::has_method()` for script static methods 2023-10-04 19:44:32 +03:00
David Snopek cbf939e121 GDExtension: Don't deprecate old method of getting script category 2023-10-02 09:23:27 -05:00
David Cambré 531f56e830 add GDExtensionScriptInstanceGetClassCategory
Change GetClassCategory so it is handled in native directly
2023-09-27 17:45:48 +02:00
Markus Sauermann d2bcde0407 Fix type of notification_func 2023-09-25 23:37:13 +02:00
Rémi Verschelde d759f91f8d
Merge pull request #81101 from 398utubzyt/dotnet/abstract-class-support
C#: Add abstract class support
2023-09-25 17:18:05 +02:00
398utubzyt 2df37a237a C#: Abstract script class support 2023-09-15 20:35:25 -07:00
Danil Alexeev 26ce861910
Editor: Remove unused Class Name field from Create Script dialog 2023-09-12 12:49:56 +03:00
David Snopek abef8e3874 Allow implementing `Object::_validate_property()` from GDExtension 2023-09-10 11:17:59 -05:00
David Snopek 3e7a6e058a Allow implementing `ScriptInstance::validate_property()` from GDExtension 2023-09-04 13:55:48 -05:00
David Snopek 83faf84ec9 GDExtension: Allocate `GDExtensionScriptInstanceInfo2` for compatibility on the heap to prevent crash 2023-08-31 15:19:31 -05:00
Markus Sauermann c4705a590b Fix Object::notification order
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>
2023-08-30 00:15:55 +02:00
Rémi Verschelde 76d318dbd1
Merge pull request #75778 from KoBeWi/_vp
Expose `_validate_property()` for scripting
2023-08-29 12:41:27 +02:00
kobewi 67db4693eb Expose _validate_property() for scripting 2023-08-28 15:18:48 +02:00
Yuri Sizov 2c77f07aaa Add a script method to get its class icon
Co-authored-by: Danil Alexeev <danil@alexeev.xyz>
2023-08-24 13:05:41 +02:00
David Cambré ceed30c442 Fix Ref<>.is_valid() for ScriptInstanceExtension
Only check the reference not the value.
2023-06-20 19:45:47 +02:00
voidedWarranties bd5ab9f9b4 Remove unused `ScriptLanguage` methods 2023-02-26 22:30:56 -08:00
Juan Linietsky dddd8d43f6 Support script global resource name in EditorFileSystem
* 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.
2023-01-21 14:19:27 +01:00
voidedWarranties 411719a399 Fix `ScriptInstanceExtension::get_property_default_value` return value 2023-01-06 19:55:02 -08:00
Rémi Verschelde d95794ec8a
One Copyright Update to rule them all
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".
2023-01-05 13:25:55 +01:00
Gilles Roudière be1c9d677d Rename all gdnative occurences to gdextension
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
2022-12-12 11:04:57 +01:00
Emmanuel Leblond 61c900ac6f
Fix const qualifier for parameters in GDExtension api functions 2022-12-02 23:00:01 +01:00
Emmanuel Leblond 39c039a363
Revert removal of GDNativeExtensionScriptInstanceInfo::get_property_type_func in GDExtension
This function pointer is needed to stay close to internal Godot's ScriptInstance class.
Besides, by removing this function pointer, we had to do property list create/free each time
we want to access type which is quadratic complexity :/
2022-11-12 04:18:21 +01:00
Emmanuel Leblond 1e8756c94b
Use StringName in the whole GDExtension API instead of const char * 2022-11-08 21:44:07 +01:00
Emmanuel Leblond 13c0a60747
Implement ScriptExtension::get_documentation 2022-10-11 08:22:25 +02:00
Rémi Verschelde 8017827144 SCons: Re-enable treating `#warning` as error with `werror`
Replace all TODO uses of `#warning` by proper TODO comments, and will open
matching bug reports to keep track of them.

We don't have a great track record fixing TODOs, but I'd wager we're even
worse for fixing these "TODO #warning" so we should prohibit this usage.
2022-10-10 16:12:26 +02:00
Yuri Sizov 980f5f32f4 Make `property_*_revert` methods multilevel and expose them for scripting 2022-08-18 00:03:53 +03:00
Hristo Stamenov 0e1f7e9f89 Removed faulty function update after get_property_list.
The function tried to rearrange properties but that lead to problems with duplication or deleted properties. Implemented the logic that that function did inside the get_property_list both for tool scripts and non-tool scripts.
2022-08-03 21:45:16 +03:00
Fabio Alessandrelli ca7d572908 [Net] Modularize multiplayer, expose MultiplayerAPI to extensions.
- 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.
2022-07-26 09:31:12 +02:00
Yuri Sizov a9098e6147 Add support for documenting built-in annotations 2022-07-04 20:21:39 +03:00
Jan Haller 60ffadd133 GDExtension: reuse code with constructor PropertyInfo(const GDNativePropertyInfo&) 2022-06-29 19:30:01 +02:00
reduz 45af29da80 Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
2022-05-20 22:40:38 +02:00