mirror of
https://github.com/godotengine/godot.git
synced 2024-11-25 13:43:15 +00:00
b7c41f9ba1
This PR implements: * A new hint: PROPERTY_HINT_NODE_TYPE for variant type OBJECT, which can take specific node types as hint string. * The editor will show it as a node path, but will set it as a pointer to a node from the current scene if you select a path. * When scene is saved, the node path is saved, then restored as a pointer. NOTE: This is a proof of concept and this approach will most likely not work. The reason if that, if the node referenced is deleted, then when trying to edit this the node will become invalid. Potential workarounds: Since this uses the Variant API, it should obtain the pointer from the Variant object ID. Yet, this would either only really work in GDScript or it would need to be implemented with workarounds in every language. Alternative ways to make this work: Nodes could export an additional property with a node path (like for which_node, it could be which_node_path). Another alternative: Path editing could happen as a hidden metadata (ignoring the pointer). |
||
---|---|---|
.. | ||
callable_method_pointer.cpp | ||
callable_method_pointer.h | ||
class_db.cpp | ||
class_db.h | ||
make_virtuals.py | ||
message_queue.cpp | ||
message_queue.h | ||
method_bind.cpp | ||
method_bind.h | ||
object_id.h | ||
object.cpp | ||
object.h | ||
ref_counted.cpp | ||
ref_counted.h | ||
script_language_extension.cpp | ||
script_language_extension.h | ||
script_language.cpp | ||
script_language.h | ||
SCsub | ||
undo_redo.cpp | ||
undo_redo.h |