summaryrefslogtreecommitdiffstats
path: root/core/variant
diff options
context:
space:
mode:
Diffstat (limited to 'core/variant')
-rw-r--r--core/variant/callable.cpp7
-rw-r--r--core/variant/callable.h1
-rw-r--r--core/variant/variant_call.cpp1
3 files changed, 9 insertions, 0 deletions
diff --git a/core/variant/callable.cpp b/core/variant/callable.cpp
index 9dff5c1e91..bb2d0313f6 100644
--- a/core/variant/callable.cpp
+++ b/core/variant/callable.cpp
@@ -545,6 +545,13 @@ bool Signal::is_connected(const Callable &p_callable) const {
return obj->is_connected(name, p_callable);
}
+bool Signal::has_connections() const {
+ Object *obj = get_object();
+ ERR_FAIL_NULL_V(obj, false);
+
+ return obj->has_connections(name);
+}
+
Array Signal::get_connections() const {
Object *obj = get_object();
if (!obj) {
diff --git a/core/variant/callable.h b/core/variant/callable.h
index 63757d9d6e..e3c940a0e5 100644
--- a/core/variant/callable.h
+++ b/core/variant/callable.h
@@ -192,6 +192,7 @@ public:
Error connect(const Callable &p_callable, uint32_t p_flags = 0);
void disconnect(const Callable &p_callable);
bool is_connected(const Callable &p_callable) const;
+ bool has_connections() const;
Array get_connections() const;
Signal(const Object *p_object, const StringName &p_name);
diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp
index 178c0bc4ec..63fb5e8d94 100644
--- a/core/variant/variant_call.cpp
+++ b/core/variant/variant_call.cpp
@@ -2121,6 +2121,7 @@ static void _register_variant_builtin_methods_misc() {
bind_method(Signal, disconnect, sarray("callable"), varray());
bind_method(Signal, is_connected, sarray("callable"), varray());
bind_method(Signal, get_connections, sarray(), varray());
+ bind_method(Signal, has_connections, sarray(), varray());
bind_custom(Signal, emit, _VariantCall::func_Signal_emit, false, Variant);