diff options
| author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2019-08-16 22:30:31 +0200 |
|---|---|---|
| committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2019-08-17 14:20:16 +0200 |
| commit | c62302a4321323625a00ba0f3e474db8a74e012f (patch) | |
| tree | c67d59e1412bd1199dc2cf586cf4acbda28d1fe9 /core | |
| parent | de8ce3e625e74833aec6a5d165e7e82100a1dbf3 (diff) | |
Improve the scene tree signals/groups tooltip
The tooltip now displays the number of connections and groups
that are assigned to the hovered node.
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 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, 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))) { @@ -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<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); |