Added Node name to print() when printing Nodes.

(cherry picked from commit 3ca25ffe8a)
This commit is contained in:
Eric M 2021-07-12 00:40:18 +10:00 committed by Rémi Verschelde
parent 970a66a0fd
commit 7b6b402a0c
No known key found for this signature in database
GPG key ID: C3336907360768E1
2 changed files with 14 additions and 0 deletions

View file

@ -1866,6 +1866,18 @@ Node *Node::get_deepest_editable_node(Node *p_start_node) const {
return node; return node;
} }
String Node::to_string() {
if (get_script_instance()) {
bool valid;
String ret = get_script_instance()->to_string(&valid);
if (valid) {
return ret;
}
}
return (get_name() ? String(get_name()) + ":" : "") + Object::to_string();
}
void Node::set_scene_instance_state(const Ref<SceneState> &p_state) { void Node::set_scene_instance_state(const Ref<SceneState> &p_state) {
data.instance_state = p_state; data.instance_state = p_state;
} }

View file

@ -314,6 +314,8 @@ public:
bool is_editable_instance(const Node *p_node) const; bool is_editable_instance(const Node *p_node) const;
Node *get_deepest_editable_node(Node *start_node) const; Node *get_deepest_editable_node(Node *start_node) const;
virtual String to_string();
/* NOTIFICATIONS */ /* NOTIFICATIONS */
void propagate_notification(int p_notification); void propagate_notification(int p_notification);