summaryrefslogtreecommitdiff
path: root/scene/main/node.cpp
AgeCommit message (Collapse)Author
2022-05-20Add a new HashSet templatereduz
* Intended to replace RBSet in most cases. * Optimized for iteration speed
2022-05-16fix a bug in get_node_and_resourceBimDav
2022-05-16Replace most uses of Map by HashMapreduz
* Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
2022-05-06Cleanup metadata usagekobewi
2022-05-03Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`Hugo Locurcio
These typedefs don't save much typing compared to the full `Ref<Resource>` and `Ref<RefCounted>`, yet they sometimes introduce confusion among new contributors.
2022-04-26[Net] Allow branch-specific MultiplayerAPIs.Fabio Alessandrelli
Removes custom_multiplayer from Node. MultiplayerAPI overrides are now set at SceneTree level, and apply to whole branches. Impact on performance when using only the default multiplayer or overriding it is minimal, the use of branches can likely be further optimized by caching nodes and relevant MultiplayerAPI IDs.
2022-04-25Node: Re-add `find_node` as `find_child`, improve docsRémi Verschelde
The new name contrasts it better with `find_parent`, and makes it clear that it only matches child/descendant nodes. Also rename `find_nodes` to `find_children` accordingly.
2022-04-25Implement Scene Unique Nodesreduz
Implements https://github.com/godotengine/godot-proposals/issues/4096 * Nodes can be marked unique to the scene in the editor (or via code). * Unique nodes can be accessed via the **%** prefix at any point in the path. From that point in the path (depending on whether the scene of the path is), the unique node will be fetched. * Implementation is very optimal, as these nodes are cached.
2022-04-05[Input] Add extra `shortcut_input` input processing step to process Unicode ↵bruvzg
character input with Alt / Ctrl modifiers, after processing of shortcuts.
2022-03-31Merge pull request #59590 from Calinou/rename-print-stray-nodesRémi Verschelde
2022-03-31Rename `Node.print_stray_nodes()` to `Node.print_orphan_nodes()`Hugo Locurcio
The "orphan" terminology is already used elsewhere.
2022-03-30Make vararg method bind no return and returnPierre-Thomas Meisels
Type emit_signal exposed method return type set UndoRedo add_do_method and add_undo_method exposed return void Set TreeItem::_call_recursive_bind returns void Set _rpc_bind and _rpc_id_bind returns void in Node Set _call_group and _call_group_flags method returns void in SceneTree Set godot-cpp-test CI flag to false
2022-03-09Remove VARIANT_ARG* macrosreduz
* Very old macros from the time Godot was created. * Limited arguments to 5 (then later changed to 8) in many places. * They were replaced by C++11 Variadic Templates. * Renamed methods that take argument pointers to have a "p" suffix. This was used in some places and not in others, so made it standard. * Also added a dereference check for Variant*. Helped catch a couple of bugs.
2022-02-19Merge pull request #58042 from Sauermann/fix-viewport-border-notificationsRémi Verschelde
Fix Viewport mouse enter+exit notifications
2022-02-17Change 'find_node' to 'find_nodes' and Add 'type' parameterdiddykonga
Changed 'find_node' to 'find_nodes' which now returns an 'TypedArray<Node>', as well as Added a 'type' parameter to match against specific node types, which supports inheritance.
2022-02-15Connect notifications from Container to ViewportMarkus Sauermann
mouse enter+exit
2022-02-15Use `switch` consistently in `_notification` (`scene` folder)Rémi Verschelde
2022-02-12Improve compilation speed (forward declarations/includes cleanup)Hendrik Brucker
2022-02-09[Net] Allow to use strings as method name in RPC.Fabio Alessandrelli
Node::rpc and Node::rpc_id will now also accepts Strings instead of only accepting StringNames.
2022-02-04[Net] New replication interface, spawner and synchronizer nodes.Fabio Alessandrelli
Initial implementation of the MultiplayerReplicationInterface and its default implementation (SceneReplicationInterface). New MultiplayerSpawner node helps dealing with instantiation of scenes on remote peers (e.g. clients). It supports both custom spawns via a `_spawn_custom` virtual function, and optional auto-spawn of known scenes via a TypedArray<PackedScenes> property. New MultiplayerSynchornizer helps synchronizing states between the local and remote peers, supports both sync and spawn properties and is configured via a `SceneReplicationConfig` resource. It can also sync via path (i.e. without being spawned by a MultiplayerSpawner if both peers has it in tree, but will not send the spawn state in that case, only the sync one.
2022-02-04Cleanup and move char functions to the `char_utils.h` header.bruvzg
2022-02-02Add a signal to notify when children nodes enter or exit treereduz
-Allows more fine grained notifications (hence better performance) than using the global scene tree signals (node added and removed). -Required for #55950
2022-01-20Merge pull request #52134 from RandomShaper/fix_namingRémi Verschelde
2022-01-20Rename Variant::is_ref() to is_ref_counted()Pedro J. Estébanez
2022-01-19Rework Node::get_node to omit is_absolute() check in best case scenarioBartłomiej T. Listwon
2022-01-16Replicate load-as-placeholder state on node duplicationHaoyu Qiu
2022-01-05Clear only owners that are no longer in the same treePedro J. Estébanez
2022-01-05Merge pull request #55512 from RandomShaper/better_node_deleteRémi Verschelde
2022-01-04Merge pull request #54987 from KoBeWi/@@Node2D@@69@@420@@@Rémi Verschelde
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-12-09Replace String comparisons with "", String() to is_empty()Nathan Franke
Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings
2021-12-01Rationalize Node removals and deletionsPedro J. Estébanez
- Regarding preservation of owner, `free()` and `remove_child()` now behave the same: owner is kept during `tree_exiting` signal and `null` during `tree_exited`. - `tree_exited` is emitted in the same order as `tree_exiting`. - Superfluous code to handle cancelation of ownership is removed.
2021-11-25Merge pull request #52387 from Calinou/node-rename-path-changed-notificationMax Hilbrunner
Rename Node's `NOTIFICATION_PATH_CHANGED` to `NOTIFICATION_PATH_RENAMED`
2021-11-23Rename `remove()` to `remove_at()` when removing by indexLightning_A
2021-11-15Fix nodes being renamed into garbage upon conflictkobewi
2021-11-10Update editor description property flagmegalobyte
2021-11-08Merge pull request #52943 from RandomShaper/property_pin_control_naturalRémi Verschelde
2021-11-08Add property value pinningPedro J. Estébanez
2021-11-07Fix preview sun and environment nameskobewi
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-28Remove node_hrcr hackkobewi
2021-10-08[Net] Add call_local argument to Node.rpc_config.Fabio Alessandrelli
2021-10-04GDScript completion: Handle quote style ad-hoc to remove editor dependencyRémi Verschelde
`core` and `scene` shouldn't depend on `editor`, so they can't query this style setting in `get_argument_options`. But we can handle it after the fact in GDScript's completion code. Also cleans up a couple extra unused invalid includes in `core`.
2021-09-30Use range iterators for `Map`Lightning_A
2021-09-30Rename Node's `filename` property to `scene_file_path` for clarityHugo Locurcio
2021-09-17Merge pull request #49819 from nekomatata/fix-process-mode-inheritRémi Verschelde
2021-09-08Multiplayer networking renames/simplificationMax Hilbrunner
Removes _networking_ prefix from some methods and members, now that multiplayer has been largely moved out of Node and SceneTree and is seperated into its own set of classes.
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-06Fix process mode update when mode owner is set to InheritPouleyKetchoupp
Prevent the root node to be set to PROCESS_MODE_INHERIT, since it causes undefined behavior. Fix a case where the process owner node is wrongly set to the direct parent instead of the proper node. Add errors for all unhandled cases.