summaryrefslogtreecommitdiffstats
path: root/core/object.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Added plurals and context support to TranslationSkyJJ2020-08-191-3/+15
|
* Merge pull request #40670 from vnen/remove-multilevel-callRémi Verschelde2020-07-261-93/+0
|\ | | | | Remove multilevel calls
| * Remove multilevel callsGeorge Marques2020-07-241-93/+0
| | | | | | | | | | | | In general they are more confusing to users because they expect inheritance to fully override parent methods. This behavior can be enabled by script writers using a simple super() call.
* | Show errors on Object.call_deferredWilson E. Alvarez2020-07-241-1/+1
|/
* Fix potential crash when listing leaked objectsPedro J. Estébanez2020-06-101-4/+11
| | | | | | | Note: Casting to the C++ classes and calling the methods there would work as well, but would require including he header files for the specific object types handled here, which wouldn't be OK either.
* Core: Add hints to run with --verbose when leaking nodes/resources at exitRémi Verschelde2020-06-081-2/+3
|
* Style: Remove unnecessary semicolons from `core`Rémi Verschelde2020-05-191-1/+1
| | | | | | | | | | Semicolons are not necessary after function definitions or control flow blocks, and having some code use them makes things inconsistent (and occasionally can mess up `clang-format`'s formatting). Removing them is tedious work though, I had to do this manually (regex + manual review) as I couldn't find a tool for that. All other code folders would need to get the same treatment.
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-73/+142
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+9
| | | | | | | | | | | | | | | | | | | | | | | I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-128/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Port member initialization from constructor to declaration (C++11)Rémi Verschelde2020-05-141-57/+23
| | | | | | | | | | Using `clang-tidy`'s `modernize-use-default-member-init` check and manual review of the changes, and some extra manual changes that `clang-tidy` failed to do. Also went manually through all of `core` to find occurrences that `clang-tidy` couldn't handle, especially all initializations done in a constructor without using initializer lists.
* Style: clang-format: Disable AllowShortIfStatementsOnASingleLineRémi Verschelde2020-05-101-1/+2
| | | | | | | Part of #33027, also discussed in #29848. Enforcing the use of brackets even on single line statements would be preferred, but `clang-format` doesn't have this functionality yet.
* Replace NULL with nullptrlupoDharkael2020-04-021-19/+19
|
* Added has_signal method for ObjectPouleyKetchoupp2020-03-231-0/+20
|
* Merge pull request #36481 from nekomatata/fix-crash-connect-callableRémi Verschelde2020-02-251-4/+10
|\ | | | | Fixed crash when connecting a signal in GDScript
| * Fixed crash when connecting a signal in GDScriptPouleyKetchoupp2020-02-231-4/+10
| |
* | Added StringName as a variant type.Juan Linietsky2020-02-211-13/+13
|/ | | | Also changed all relevant properties defined manually to StringName.
* Reworked signal connection system, added support for Callable and Signal ↵Juan Linietsky2020-02-201-130/+114
| | | | objects and made them default.
* Fix two signal errorsnathanwfranke2020-02-191-1/+0
| | | | | Update
* PoolVector is gone, replaced by VectorJuan Linietsky2020-02-181-2/+2
| | | | | Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
* Changed logic and optimized ObjectID in ObjectDB and Variant, removed RefPtr.Juan Linietsky2020-02-151-64/+115
|
* ObjectID converted to a structure, fixes many bugs where used incorrectly as ↵Juan Linietsky2020-02-121-5/+4
| | | | 32 bits.
* Remove duplicate ERR_PRINT macro.Marcel Admiraal2020-02-051-2/+2
|
* Make sure we know when deleting an emitting objectFabio Alessandrelli2020-01-221-7/+8
| | | | | | | | | | | | | | 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.
* Object: Avoid error on emit_signal with freed targetRémi Verschelde2020-01-131-7/+5
| | | | As advised by @reduz.
* Object: Remove error on disconnect of locked signalsRémi Verschelde2020-01-131-4/+0
| | | | | | | | | | | | | | | | | | 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. ```
* Merge pull request #34745 from timothyqiu/vararg-return-nil-34743Rémi Verschelde2020-01-021-2/+2
|\ | | | | Allows to doc vararg method return type as void
| * Allows to doc vararg method return type as voidHaoyu Qiu2020-01-021-2/+2
| |
* | Object::disconnect: Better errors when no signal or lockedRémi Verschelde2020-01-021-2/+4
|/ | | | | | | | | 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.
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | 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.
* Suggest use of deferred or oneshot on disconnect if the signal is locked. ↵Juan Linietsky2019-12-181-1/+1
| | | | Closes #34443.
* Improve error message and do not spam forever.Juan Linietsky2019-12-171-1/+4
|
* Restore signal locking, for some reason missing.Juan Linietsky2019-12-171-0/+2
|
* Ensure object metadata is uniqueBojidar Marinov2019-09-281-1/+1
| | | | Closes #32415
* Added some obvious errors explanationsqarmin2019-09-251-3/+3
|
* Merge pull request #31423 from Calinou/improve-node-signal-group-tooltipRémi Verschelde2019-08-181-5/+6
|\ | | | | Improve the scene tree signals/groups tooltip
| * Improve the scene tree signals/groups tooltipHugo Locurcio2019-08-171-5/+6
| | | | | | | | | | The tooltip now displays the number of connections and groups that are assigned to the hovered node.
* | Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in 'core/' and 'editor/'Braden Bodily2019-08-171-49/+19
|/ | | | | | | | | 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?)
* Revert "Expose "meta" to the Inspector"Rémi Verschelde2019-07-221-6/+3
|
* Merge pull request #22642 from YeldhamDev/inspector_metadataRémi Verschelde2019-07-191-3/+6
|\ | | | | Expose "meta" to the Inspector
| * Expose "meta" to the InspectorMichael Alexsander Silva Dias2018-12-081-3/+6
| |
* | Merge pull request #30126 from qarmin/remove_unnecessary_codeRémi Verschelde2019-07-011-4/+2
|\ \ | | | | | | Remove unnecessary code and add some error explanations
| * | Remove unnecessary code and add some error explanationsqarmin2019-07-011-4/+2
| | |
* | | Merge pull request #30096 from akien-mga/doc-misc-updatesRémi Verschelde2019-06-271-7/+1
|\ \ \ | |/ / |/| | doc: Proofread and complete various nodes
| * | doc: Proofread and complete various nodesRémi Verschelde2019-06-261-7/+1
| | | | | | | | | | | | | | | | | | | | | 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.
* | | Some code changed with Clang-Tidyqarmin2019-06-261-9/+4
|/ /
* | Merge pull request #27886 from LeonardMeagher2/obj_to_stringRémi Verschelde2019-05-201-0/+12
|\ \ | | | | | | Allow overriding how scripted objects are converted to strings
| * | Allow overriding how scripted objects are converted to stringsLeonard Meagher2019-05-031-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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()`
* | | Fix Object::get_indexed for simple properties.Fabio Alessandrelli2019-05-161-7/+5
| | | | | | | | | | | | | | | | | | 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.
* | | Change "ID" to lowercase "id"Aaron Franke2019-05-091-5/+5
| | | | | | | | | | | | 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.