From c62302a4321323625a00ba0f3e474db8a74e012f Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 16 Aug 2019 22:30:31 +0200 Subject: Improve the scene tree signals/groups tooltip The tooltip now displays the number of connections and groups that are assigned to the hovered node. --- scene/main/node.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'scene/main/node.cpp') diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 0aaba5491a..0b3a193d18 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -1716,14 +1716,17 @@ void Node::get_groups(List *p_groups) const { } } -bool Node::has_persistent_groups() const { +int Node::get_persistent_group_count() const { + + int count = 0; for (const Map::Element *E = data.grouped.front(); E; E = E->next()) { - if (E->get().persistent) - return true; + if (E->get().persistent) { + count += 1; + } } - return false; + return count; } void Node::_print_tree_pretty(const String &prefix, const bool last) { -- cgit v1.2.3