diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-08-18 10:55:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-18 10:55:16 +0200 |
commit | 5c853a45e632b0d912f3616c749120f28e29b66a (patch) | |
tree | a67ed67e4bb2446df12dd3070d3c3b67c86bb61e /core | |
parent | 343466c0159dc5e77ab1ce8ea313b1decbc5665b (diff) | |
parent | c62302a4321323625a00ba0f3e474db8a74e012f (diff) |
Merge pull request #31423 from Calinou/improve-node-signal-group-tooltip
Improve the scene tree signals/groups tooltip
Diffstat (limited to 'core')
-rw-r--r-- | core/object.cpp | 11 | ||||
-rw-r--r-- | core/object.h | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/core/object.cpp b/core/object.cpp index 5875a46ea2..62bfa31480 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1400,8 +1400,9 @@ void Object::get_signal_connection_list(const StringName &p_signal, List<Connect p_connections->push_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))) { @@ -1409,13 +1410,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<Connection> *p_connections) const { diff --git a/core/object.h b/core/object.h index 15c3ab94c5..ac8620757c 100644 --- a/core/object.h +++ b/core/object.h @@ -707,7 +707,7 @@ public: void get_signal_list(List<MethodInfo> *p_signals) const; void get_signal_connection_list(const StringName &p_signal, List<Connection> *p_connections) const; void get_all_signal_connections(List<Connection> *p_connections) const; - bool has_persistent_signal_connections() const; + int get_persistent_signal_connection_count() const; void get_signals_connected_to_this(List<Connection> *p_connections) const; Error connect(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method, const Vector<Variant> &p_binds = Vector<Variant>(), uint32_t p_flags = 0); |