summaryrefslogtreecommitdiff
path: root/core/object
AgeCommit message (Collapse)Author
2021-11-30Change gdnative interface so that Godot object initialization should be ↵Gilles Roudière
triggered from the extension side
2021-11-26Fix wrong comparison with default valuesRicardo Subtil
2021-11-23Rename `remove()` to `remove_at()` when removing by indexLightning_A
2021-11-17Fix the exceptions in signal disconnectionXwdit
Use the correct method to get SignalData to fix exceptions in signal disconnection
2021-11-14Merge pull request #53710 from ↵Hugo Locurcio
CaptainProton42/fix-extension-class-inspector-properties
2021-11-04Add is_built_in() method to Resourcekobewi
2021-11-03Rename `PROPERTY_USAGE_NOEDITOR` to `PROPERTY_USAGE_NO_EDITOR`Hugo Locurcio
This is consistent with other constants that include `NO`, such as `PROPERTY_HINT_COLOR_NO_ALPHA`.
2021-10-28CI: Update to clang-format 13 using LLVM repoRémi Verschelde
2021-10-28clang-format: Disable alignment of operands, too unreliableRémi Verschelde
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`.
2021-10-28Remove ItemList editor and replace it by a property arrayGilles Roudière
2021-10-26Save all 64 bits of get_ticks_msec() in more casesMax Hilbrunner
2021-10-18Fix memory leak in exported projectqarmin
2021-10-13Merge pull request #53757 from groud/fix_undoRémi Verschelde
2021-10-13Fix undo in inspector not workingGilles Roudière
2021-10-12Merge pull request #52293 from neikeq/class-db-api-type-bugRémi Verschelde
Fix ClassDB API type mismatch bug between --editor and player
2021-10-12Fetch extension class props from ClassDBCaptainProton42
Extension class properties that have been registered with ClassDB(`GDNativeInterface::classdb_register_extension_class_property`) were not fetched previously. (Only directly providing a property list using `GDNativeExtensionClassCreationInfo::get_property_list_func` would work.) This especially caused problems with the C++ bindings since they exclusively rely on ClassDB to register properties.
2021-10-12Fix useless debug printGilles Roudière
2021-10-12Add a way to force undo/redo operations to be kept in MERGE_ENDS modeGilles Roudière
2021-10-07Enable method type information on release buildsGeorge Marques
This is needed to ensure GDScript compilation works properly on release builds and make use of optimized typed instructions.
2021-10-05Improve error message when instantiating virtual classMaxime Lapointe
2021-10-01Merge pull request #47442 from Shatur/fix-connect-reference-countedRémi Verschelde
2021-09-30Use range iterators for `Map`Lightning_A
2021-09-22[ClassDB] Unify construct/extension retrieval.Fabio Alessandrelli
2021-09-22[Core] Add ClassDB functions to retrieve/construct extensions.Fabio Alessandrelli
Calling the constructor alone is not enough if the class to be instantiated is not a base class. This commit adds two functions, one for retrieving the the extension class reference, the other to construct an instance using the constructor and the extension class reference.
2021-09-07Merge pull request #52442 from Faless/mp/4.x_rpc_managerMax Hilbrunner
[Net] Move multiplayer classes to own subfolder. Split RPC from MultiplayerAPI.
2021-09-07[Net] Move multiplayer to core subdir, split RPCManager.Fabio Alessandrelli
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".
2021-09-07Implement properties arrays in the Inspector.Gilles Roudière
2021-09-05Apply set_read_only() to child classes of EditorProperty elementsSilc 'Tokage' Renew
2021-08-31Fix ClassDB API type mismatch bug between --editor and playerIgnacio Roldán Etcheverry
There are two ways a class can be added to ClassDB: - `A`: When an instance of the class is created for the first time. When this happends the class is not registered/exposed to scripts. - `B`: When calling `GDREGISTER_CLASS(ClassName)` or similar. When this happens the class is registered/exposed to scripts. ClassDB has an API type property to differentiate between the core and editor APIs. Up until now the API type was determined whenever the class is added to ClassDB (either `A` or `B`). The problem comes when a class is instantiated (`A`) before being registered (`B`). If at this point the current defined API is not the same as when the class is later registered, this will result in a mismatch between `--editor` and non-editor apps. This is specially bad for C# as it makes the editor player abort. This was happening with `EditorPaths` which, while being registered during the editor API classes registrations, it was also being instantiated earlier when running the editor or the project manager, via a call to `EditorPaths::create()`. This regression was introduced in 1074017f043ec9155b12ea97cd00cf11361ccdf0. This commit fixes this simply by re-assigning the class API type when the class is registered (`B`). This is correct because API type describes registered/exposed classes. It shouldn't cause any regressions as the API type should not be accessed of classes that are not (or not yet) registered/exposed. Code locations for reference: - Method to add a class to ClassDB: `ClassDB::_add_class2` - Code that adds classes to ClassDB post first initialization (`A`): `memnew` macros -> `Object::_postinitialize` -> `Object::initialize_class` -> `ClassDB::_add_class2`. - Code adds class to ClassDB and registers/exposes it to scripts: `GDREGISTER_CLASS` macros -> `ClassDB::register_class<T>` -> `Object::initialize_class` -> `ClassDB::_add_class2`.
2021-08-26Merge pull request #52107 from timothyqiu/overridenJuan Linietsky
Fix misspelled "overriden"
2021-08-26Fix misspelled "overriden"Haoyu Qiu
In recent GDVIRTUAL PR and SkeletonModification3DJiggle doc.
2021-08-24Implement error return documetationreduz
Adds ability to add error return documetation to the binder and class reference. Usage example: ```C++ void MyClass::_bind_method() { [..] BIND_METHOD_ERR_RETURN_DOC("load", ERR_FILE_CANT_OPEN, ERR_FILE_UNRECOGNIZED); } ``` One function of ConfigFile was changed as example.
2021-08-23Implement NativeExtension pointer argumentsreduz
* Allows calling into native extensions directly with a pointer * Makes it easier to implement some APIs more efficiently * Appears with a "*" in the documentation for the argument. * Implementing the pointer handling is entirely up to the implementation, although the extension API provides some hint. * AudioStream has been implemented as an example, allowing to create NativeExtension based AudioStreams.
2021-08-23Entirely removes BIND_VMETHOD in favor of GDVIRTUALreduz
* `_gui_input`, `_input`, `_unhandled_input` and `_unhandled_key_input` are now regular C++ virutal functions. * Everything else converted to GDVIRTUAL * BIND_VMETHOD is gone, always use the new syntax from now on. Creating `_gui_input` method and using the binder to register events will no longer work, simply override the virtual function now.
2021-08-22Replace BIND_VMETHOD by new GDVIRTUAL syntaxreduz
* New syntax is type safe. * New syntax allows for type safe virtuals in native extensions. * New syntax permits extremely fast calling. Note: Everything was replaced where possible except for `_gui_input` `_input` and `_unhandled_input`. These will require API rework on a separate PR as they work different than the rest of the functions. Added a new method flag METHOD_FLAG_OBJECT_CORE, used internally. Allows to not dump the core virtuals like `_notification` to the json API, since each language will implement those as it is best fits.
2021-08-19Fix capsule height/radius setters with linked propertiesPouleyKetchoupp
Capsule height and radius setters can modify each other, rather than using clamping, to avoid cases where values are not set correctly when loading a scene (depending on the order of properties). Inspector undo/redo: Added the possibility to link properties together in the editor, so they can be undone together, for cases where a property can modify another one. Gizmo undo/redo: Capsule handles pass both radius and height values so they can be undone together.
2021-08-18Merge pull request #51627 from mhilbrunner/todo-for-neikeqRémi Verschelde
2021-08-17Properly set up virtual calls for extensionsGeorge Marques
2021-08-17Namespaces instead of underscore prefix for bindsMax Hilbrunner
Thanks to neikeq for the initial work. Co-authored-by: Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com>
2021-08-17Improve Undo/Redo menu itemsHaoyu Qiu
* Make Undo/Redo menu items disabled when clicking it does nothing. * Context menu of `TextEdit` * Context menu of `LineEdit` * Editor's Scene menu * Script editor's Edit menu and context menu (for Script and Text) * Make editor undo/redo log messages translatable. * Mark `UndoRedo`'s `has_{un,re}do()` methods as `const`. * Expose `TextEdit`'s `has_{un,re}do()` to scripts since `{un,re}do()` are already available.
2021-08-16Fix C# native instance bindings after recent re-writeIgnacio Roldán Etcheverry
This was needed after: 44691448911f1d29d4d79dbdd5553734761e57c4
2021-08-05Add a instance callback for extensionsGeorge Marques
This sends the Godot object instance back to the extension so they can keep a pointer for function calls. Incidentally fix argument order on instance bindings callback for free()
2021-08-05Merge pull request #48615 from Razoric480/lsp-renameRémi Verschelde
Implement LSP didSave notification and rename request
2021-07-25Use const references where possible for List range iteratorsRémi Verschelde
2021-07-24Merge pull request #50786 from reduz/implement-resource-uidsRémi Verschelde
Implement Resource UIDs
2021-07-24Implement Resource UIDsreduz
* Most resource types now have unique identifiers. * Applies to text, binary and imported resources. * File formats reference both by text and UID (when available). UID always has priority. * Resource UIDs are 64 bits for better compatibility with the engine. * Can be represented and used textually, example `uuid://dapwmgsmnl28u`. * A special binary cache file is used and exported, containing the mappings. Example of how it looks: ```GDScript [gd_scene load_steps=2 format=3 uid="uid://dw86wq31afig2"] [ext_resource type="PackedScene" uid="uid://bt36ojelx8q6c" path="res://subscene.scn" id="1_t56hs"] ``` GDScript, shaders and other special resource files can't currently provide UIDs, but this should be doable with special keywords on the files. This will be reserved for future PRs.
2021-07-23Use C++ iterators for Lists in many situationsAaron Franke
2021-07-24Fix UndoRedo crash when clearing historyHaoyu Qiu
2021-07-22Make Object "meta" functions take StringName.Fabio Alessandrelli
The various get_meta, set_meta, has_meta, get_meta_list, remove_meta functions now uses StringName, allowing further optimizations via the SNAME macro when used from C++ (this PR does not change the various usage though).
2021-07-20Merge pull request #50655 from JFonS/sname_optRémi Verschelde
Editor StringName and Viewport optimizations