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. --- core/object.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'core/object.cpp') diff --git a/core/object.cpp b/core/object.cpp index 3367d6b6c3..8a6acff817 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1415,8 +1415,9 @@ void Object::get_signal_connection_list(const StringName &p_signal, Listpush_back(s->slot_map.getv(i).conn); } -bool Object::has_persistent_signal_connections() const { +int Object::get_persistent_signal_connection_count() const { + int count = 0; const StringName *S = NULL; while ((S = signal_map.next(S))) { @@ -1424,13 +1425,13 @@ bool Object::has_persistent_signal_connections() const { const Signal *s = &signal_map[*S]; for (int i = 0; i < s->slot_map.size(); i++) { - - if (s->slot_map.getv(i).conn.flags & CONNECT_PERSIST) - return true; + if (s->slot_map.getv(i).conn.flags & CONNECT_PERSIST) { + count += 1; + } } } - return false; + return count; } void Object::get_signals_connected_to_this(List *p_connections) const { -- cgit v1.2.3