summaryrefslogtreecommitdiff
path: root/core/object.cpp
AgeCommit message (Collapse)Author
2020-02-25Merge pull request #36481 from nekomatata/fix-crash-connect-callableRémi Verschelde
Fixed crash when connecting a signal in GDScript
2020-02-23Fixed crash when connecting a signal in GDScriptPouleyKetchoupp
2020-02-21Added StringName as a variant type.Juan Linietsky
Also changed all relevant properties defined manually to StringName.
2020-02-20Reworked signal connection system, added support for Callable and Signal ↵Juan Linietsky
objects and made them default.
2020-02-19Fix two signal errorsnathanwfranke
Update
2020-02-18PoolVector is gone, replaced by VectorJuan Linietsky
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
2020-02-15Changed logic and optimized ObjectID in ObjectDB and Variant, removed RefPtr.Juan Linietsky
2020-02-12ObjectID converted to a structure, fixes many bugs where used incorrectly as ↵Juan Linietsky
32 bits.
2020-02-05Remove duplicate ERR_PRINT macro.Marcel Admiraal
2020-01-22Make sure we know when deleting an emitting objectFabio Alessandrelli
We used a lock signals in the signal_map while emitting, because it was not allowed to disconnect them while being emitted. We used that lock to check if we where deleting an object during signal emission. Now that we allow to disconnect signals while they are being emitted, if an object first disconnects, then gets deleted we can't know that a signal was being emitted during the destructor. This commit adds a new `_emitting` boolean member to Object to be set while emitting and checked in the destructor, while removing the old signal lock which is now unused.
2020-01-13Object: Avoid error on emit_signal with freed targetRémi Verschelde
As advised by @reduz.
2020-01-13Object: Remove error on disconnect of locked signalsRémi Verschelde
According to https://github.com/godotengine/godot/commit/22637beb2ed625c3e43ab75ab5865b57d7470948#commitcomment-36651823 and as confirmed by @reduz, this seems not to be necessary now that we copy-on-write. This triggered freeze scenarios in cases where a node would be deleted while being used as a target in a signal emission. Fixes #34650. Fixes #34769. Now those two errors go back to reporting: ``` ERROR: emit_signal: Condition ' !target ' is true. Continuing..: At: core/object.cpp:1191. ```
2020-01-02Merge pull request #34745 from timothyqiu/vararg-return-nil-34743Rémi Verschelde
Allows to doc vararg method return type as void
2020-01-02Object::disconnect: Better errors when no signal or lockedRémi Verschelde
It will now give information about the originating object instance and when locked, the target callback. This should help debugging editor and game issues that are now being reported due to adding signal locking in 22637beb2ed625c3e43ab75ab5865b57d7470948.
2020-01-02Allows to doc vararg method return type as voidHaoyu Qiu
2020-01-01Update copyright statements to 2020Rémi Verschelde
Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
2019-12-18Suggest use of deferred or oneshot on disconnect if the signal is locked. ↵Juan Linietsky
Closes #34443.
2019-12-17Improve error message and do not spam forever.Juan Linietsky
2019-12-17Restore signal locking, for some reason missing.Juan Linietsky
2019-09-28Ensure object metadata is uniqueBojidar Marinov
Closes #32415
2019-09-25Added some obvious errors explanationsqarmin
2019-08-18Merge pull request #31423 from Calinou/improve-node-signal-group-tooltipRémi Verschelde
Improve the scene tree signals/groups tooltip
2019-08-17Improve the scene tree signals/groups tooltipHugo Locurcio
The tooltip now displays the number of connections and groups that are assigned to the hovered node.
2019-08-17Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in 'core/' and 'editor/'Braden Bodily
Condensed some if and ERR statements. Added dots to end of error messages Couldn't figure out EXPLAINC. These files gave me trouble: core/error_macros.h, core/io/file_access_buffered_fa.h (where is it?), core/os/memory.cpp, drivers/png/png_driver_common.cpp, drivers/xaudio2/audio_driver_xaudio2.cpp (where is it?)
2019-07-22Revert "Expose "meta" to the Inspector"Rémi Verschelde
2019-07-19Merge pull request #22642 from YeldhamDev/inspector_metadataRémi Verschelde
Expose "meta" to the Inspector
2019-07-01Merge pull request #30126 from qarmin/remove_unnecessary_codeRémi Verschelde
Remove unnecessary code and add some error explanations
2019-07-01Remove unnecessary code and add some error explanationsqarmin
2019-06-27Merge pull request #30096 from akien-mga/doc-misc-updatesRémi Verschelde
doc: Proofread and complete various nodes
2019-06-26doc: Proofread and complete various nodesRémi Verschelde
All 100% completed: MainLoop, Node, Object, Path, Performance, Reference, Resource, SceneState, SceneTree, UndoRedo. Also fixed some en_GB occurrences as the reference spelling is en_US.
2019-06-26Some code changed with Clang-Tidyqarmin
2019-05-20Merge pull request #27886 from LeonardMeagher2/obj_to_stringRémi Verschelde
Allow overriding how scripted objects are converted to strings
2019-05-16Fix Object::get_indexed for simple properties.Fabio Alessandrelli
Object::get_indexed was not correctly reporting invalid keys if the name was a direct property (not a subproperty), causing for example Tween to not report correctly a bad interpolate_property key.
2019-05-09Change "ID" to lowercase "id"Aaron Franke
Reasoning: ID is not an acronym, it is simply short for identification, so it logically should not be capitalized. But even if it was an acronym, other acronyms in Godot are not capitalized, like p_rid, p_ip, and p_json.
2019-05-03Allow overriding how scripted objects are converted to stringsLeonard Meagher
solves #26796 - ADD `String to_string()` method to Object which can be overriden by `String _to_string()` in scripts - ADD `String to_string(r_valid)` method to ScriptInstance to allow langauges to control how scripted objects are converted to strings - IMPLEMENT to_string for GDScriptInstance, VisualScriptInstance, and NativeScriptInstance - ADD Documentation about `Object.to_string` and `Object._to_string` - Changed `Variant::operator String` to use `obj->to_string()`
2019-04-26Undo support for locking and grouping for both 2D and 3DSintinium
2019-04-20Object::script may not be a valid Ref<Script>Hein-Pieter van Braam-Stewart
It appears that Object::script may be a valid ScriptInstance but not be castable to Ref<Script>. There were only 5 places in the code that made this assumption. This commit fixes that.
2019-04-09Style: Apply new changes from clang-format 8.0Rémi Verschelde
It seems to stay compatible with formatting done by clang-format 6.0 and 7.0, so contributors can keep using those versions for now (they will not undo those changes).
2019-03-05Print errors comming from callvBojidar Marinov
Fixes #18386
2019-02-24Ensure all properties are refreshed when setting a script, fixes #24845Juan Linietsky
2019-02-18Fix warnings seen with warnings=all and recent GCC 8.2.marxin
2019-02-13Fix typos with codespellRémi Verschelde
Using codespell 1.14.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang doubleclick lod nd numer que te unselect EOF $ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po" $ git diff // undo unwanted changes ```
2019-02-09Use script instance binding for objects constructed from C#Ignacio Etcheverry
Only possible if the object class is a "native type". If the object class is a user class (that derives a "native type") then a script is needed. Since CSharpLanguage does cleanup of script instance bindings when finished, cases like #25621 will no longer cause problems. Fixed ~Object() trying to free script instance bindings after the language has already been removed, which would result in a NULL dereference.
2019-02-03Mono: Lifetime fixes for CSharpInstance and instance binding dataIgnacio Etcheverry
Avoid CSharpInstance from accessing its state after self destructing (by deleting the Reference owner). It's now safe to replace the script instance without leaking or crashing. Also fixed godot_icall_Object_weakref return reference being freed before returning.
2019-01-01Update copyright statements to 2019Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-12-08Expose "meta" to the InspectorMichael Alexsander Silva Dias
2018-11-27Allow signal connecting even if script is invalid (only when compiled with ↵Juan Linietsky
tools), fixes #17070
2018-11-18Massive speed up on deleting nodes, fixes #18673Juan Linietsky
Also makes the editor exit faster
2018-11-16-Make sure monitorable cant be flipped while flushing queries, fixes #17330Juan Linietsky
-Also added set_deferred, this was missing.
2018-11-08-Moved EditorDefaultValue to ClassDB, made it coreJuan Linietsky
-Removed one and zero hints for properties, replaced by default value