Commit graph

281 commits

Author SHA1 Message Date
Juan Linietsky
33d3b7eea7 Fix Callable call error reporting.
* Fix potential crash when using bind in `Variant::get_callable_error_text()`
* Properly compute bound arguments so they can be properly shown.
* Add a function to obtain the actual bound arguments.
2023-01-10 13:56:27 +01:00
Juan Linietsky
0e0a6bb39b
Removed unused property hints and Object::get_translatable_strings()
* Remove unused `EditorPropertyMember` and related hints, previouly used by
  VisualScript. Such logic should be implemented in the VS module itself.
* As the above broke compatibility with the VS module, clean up the other
  hacks that were still in core in support of VisualScript.
* `PROPERTY_USAGE_INTERNATIONALIZED` was only used in Object's
  `get_translatable_strings()`, which is a legacy function not used anywhere.
  So both are removed.
* Reordered some usage flags after the above removal to minimize the diff.
* General clean up.

Fixes #30203.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2023-01-09 16:56:01 +01:00
Rémi Verschelde
31f94574d4
Merge pull request #70996 from reduz/properly-report-callable-bound-arguments
Properly report Callable bound arguments
2023-01-09 08:34:28 +01:00
Rémi Verschelde
e7905f4f48
Merge pull request #71045 from reduz/use-bitfield-in-core-types
Use BitField<> in core type masks
2023-01-09 08:33:26 +01:00
Juan Linietsky
0e0ca01bce Properly report Callable bound arguments
Fixes #63213
Adds a function: Callable::get_amount_of_arguments_bound() to query this in callables. Exposed to the engine API.
2023-01-08 23:35:11 +01:00
Juan Linietsky
2b815df3c1 Use BitField<> in core type masks
* All core types masks are now correctly marked as bitfields.
* The enum hacks in MouseButtonMask and many other types are gone. This ensures that binders to other languages non C++ can actually implement type safe bitmasks.
* Most bitmask operations replaced by functions in BitField<>
* Key is still a problem because its enum and mask at the same time. While it kind of works in C++, this most likely can't be implemented safely in other languages and will have to be changed at some point. Mostly left as-is.
* Documentation and API dump updated to reflect bitfields in core types.
2023-01-08 22:17:40 +01:00
voidedWarranties
411719a399 Fix ScriptInstanceExtension::get_property_default_value return value 2023-01-06 19:55:02 -08:00
Rémi Verschelde
163f6f5fe8
Merge pull request #68429 from KoBeWi/PropertySettings
Add PropertyInfo overload for GLOBAL_DEF
2023-01-06 22:59:29 +01:00
Rémi Verschelde
1816f49886
Merge pull request #64253 from heppocogne/Fix-native-enum-release-1
Register enum type names in release build
2023-01-06 00:10:31 +01: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
heppocogne
6f31f7b0bc Register native base class name of enum types when release build 2022-12-30 00:30:18 +09:00
Bastiaan Olij
7502e1dc0d Improve logic around using Ref<T> with GDExtension virtual functions 2022-12-13 10:54:29 +11:00
Rémi Verschelde
f1edd03d4c
Merge pull request #69718 from groud/finally_rename_gdnative_to_gdextension
Rename all gdnative occurences to gdextension
2022-12-12 11:43:59 +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
kobewi
7c6b659bd7 Add PropertyInfo overload for GLOBAL_DEF 2022-12-11 21:36:48 +01:00
Micky
885f2a4eca Fix unable to disconnect signal in Editor once created
Adds a CONNECT_INHERITED flag to connections, only available in editor builds. This flag denotes that the signal has been inherited from a previous Scene in the instancing hierarchy.
2022-12-08 13:36:48 +01:00
Rémi Verschelde
a50e4fed18
Merge pull request #69343 from YuriSizov/core-missing-property-revert-getters
Add missing public `property_*_revert` getters
2022-12-05 18:05:59 +01:00
Rémi Verschelde
a738f50886
Merge pull request #69357 from TokageItLab/byebye-trigger
Remove `UPDATE_TRIGGER` mode from `ValueTrack::UpdateMode` & Match behaviors between `AnimationTree` and `AnimationPlayer`
2022-12-05 00:06:23 +01:00
Emmanuel Leblond
61c900ac6f
Fix const qualifier for parameters in GDExtension api functions 2022-12-02 23:00:01 +01:00
Silc Renew
83135aa122 Remove UPDATE_TRIGGER & Match behaviors between AnimationTree/Player
#69357
2022-12-02 20:28:10 +09:00
Yuri Sizov
a9961b378a Add missing public property_*_revert getters 2022-11-29 23:07:40 +03:00
Rémi Verschelde
6fdbf79046
Merge pull request #67680 from haasanen/fix_physics_thread_race_condition
Fix physics/3d/run_on_separate_thread race condition in WorkerThreadPool (crash).
2022-11-29 13:41:56 +01:00
Rémi Verschelde
5d20dccade
Add MAKE_RESOURCE_TYPE_HINT macro to simplify binding arrays of resources 2022-11-24 14:06:00 +01:00
ocean (they/them)
9187f5c849 Fixes inability to assign script after clearing 2022-11-21 19:43:46 -05:00
Micky
b4324e7a45 Remove PROPERTY_HINT_IMAGE_COMPRESS constants
These were used in 3.x but there's no reference of them in the codebase, at all.
2022-11-15 15:28:49 +01:00
Rémi Verschelde
beed90ea6d
Merge pull request #67963 from KoBeWi/den_of_actions
Fix nested actions in EditorUndoRedoManager
2022-11-14 18:29:46 +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
Aaron Franke
a3e52925bf
Fix default values on virtual classes causing errors in projects 2022-11-09 01:59:53 -06:00
Emmanuel Leblond
1e8756c94b
Use StringName in the whole GDExtension API instead of const char * 2022-11-08 21:44:07 +01:00
Aaron Franke
3dc9474355
Fix default values not showing up on virtual classes 2022-11-06 15:05:36 -06:00
Aaron Franke
ba542444e3
Don't allow instancing virtual node types in the Create New Node dialog 2022-11-05 14:45:16 -05:00
Rémi Verschelde
632b3e974c
Merge pull request #67693 from Mickeon/slight-hint-shuffling
Fix unordered values of PROPERTY_HINT_INT_IS_POINTER & ARRAY_TYPE
2022-11-02 14:16:53 +01:00
Rémi Verschelde
5947f22be9
Merge pull request #67578 from KoBeWi/GEDITOR
Unify usage of GLOBAL/EDITOR_GET
2022-10-31 13:15:58 +01:00
kobewi
d7ebf725c9 Fix nested actions in EditorUndoRedoManager 2022-10-28 02:54:55 +02:00
Micky
9a1d87f66f Fix unordered values of PROPERTY_HINT_INT_IS_POINTER & ARRAY_TYPE 2022-10-21 01:10:38 +02:00
Simo Haasanen
4cc3489bc0 Fixes HashMap::erase related race condition in WorkerThreadPool when Physics 2D or 3D is selected to run on a separate thread. 2022-10-20 17:47:20 +01:00
kobewi
e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00
kobewi
4aaed4fee1 Minor code improvements 2022-10-18 16:44:57 +02:00
Ricardo Buring
1d5aa74ac3 GDExtension: add support for abstract and virtual classes 2022-10-16 09:02:49 +02:00
Rémi Verschelde
6ad5637ffc Merge pull request #66427 from Mickeon/object-methods-autocompletion
Add autocompletion to several Object methods
2022-10-13 18:41:24 +02:00
Rémi Verschelde
35670c36cf Merge pull request #67300 from Mickeon/indexed-objection
Rename `set`/`get_indexed`'s "property" to "property_path"
2022-10-12 14:45:05 +02:00
Micky
dc51ff8c5b Rename set/get_indexed's "property" to "property_path"
Also touches up the Documentation slightly.
2022-10-12 10:27:44 +02:00
Quentin Quaadgras
6bc16660cc Fix _unnamed_arg so that arguments defined by GDExtension show up in docs.
The Godot API (gdnative_interface.h) allows methods to be registered on
extension classes with

`classdb_register_extension_class_method`

a `GDNativeExtensionClassMethodInfo` can be provided to this function
along with a `get_argument_info_func` which according to the comment
indicates that argument names should be definable here.

Unfortunately, setting the name field in the `GDNativePropertyInfo`
struct has no effect on the editor documentation, which continues to
display "_unnamed_arg" for each argument.

I discovered that `get_argument_info` is responsible for this as it
always overrides the `info.name`. I've added an if condition that will
only override the name when it is empty. I've tested this with my
GDExtension module and I can confirm that with this commit, the argument
name shows up in the builtin docs. eg. in Lookup Symbol.
2022-10-12 21:23:34 +13: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
Rémi Verschelde
4e4e16f9a9 SCons: Cleanup GCC warnings configuration
- Outright disable spammy warnings due to past or present GCC bugs:
  * `-Wno-strict-overflow` for GCC 7.
  * `-Wno-type-limits` for GCC before 11 (regressed in 9/10, might work in
    earlier releases but at this stage we don't care).
  * `-Wno-return-type` for GCC 12/13 (regression, still not fixed).
- Enable extra warnings conditionally when broken on earlier GCC:
  * `-Wnoexcept` was removed due to an upstream regression in GCC 9, could
    be re-enabled (but commented out for now as we actually have `-Wnoexcept`
    warnings to fix.
  * `-Wlogical-op` was broken on our variadic templates before GCC 11, now
    seems fine.
2022-10-10 16:12:26 +02:00
Haoyu Qiu
48e0688d8f Validate input in ScriptServer::register_language 2022-10-08 14:12:25 +08:00
bruvzg
0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
Waridley
0863cf96e4 free NativeExtensionMethodBinds on unregister 2022-10-05 11:46:00 -05:00
Rémi Verschelde
9cd62741bb Merge pull request #66839 from aaronfranke/editor-prop-hide-slider
Fix `hide_slider` vs `no_slider` inconsistency in editor property code
2022-10-05 08:47:06 +02:00