diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-03-03 14:39:13 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-03-03 14:39:13 -0300 |
commit | 4d2198110b4af7f203eeef95697255569e49bce7 (patch) | |
tree | 452e4964f127643bf52610718fd956d8b55ed6ba /core | |
parent | 91faf8e21810c8995e4f6e3b6ba47a6482ab877e (diff) |
merges from okam repo
Diffstat (limited to 'core')
-rw-r--r-- | core/object.cpp | 8 | ||||
-rw-r--r-- | core/object.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/core/object.cpp b/core/object.cpp index 82144ab4be..2b83f728d1 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1033,6 +1033,13 @@ void Object::add_user_signal(const MethodInfo& p_signal) { signal_map[p_signal.name]=s; } +bool Object::_has_user_signal(const StringName& p_name) const { + + if (!signal_map.has(p_name)) + return false; + return signal_map[p_name].user.name.length()>0; +} + struct _ObjectSignalDisconnectData { StringName signal; @@ -1431,6 +1438,7 @@ void Object::_bind_methods() { // ObjectTypeDB::bind_method(_MD("call_deferred","method","arg1","arg2","arg3","arg4"),&Object::_call_deferred_bind,DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant())); ObjectTypeDB::bind_method(_MD("add_user_signal","signal","arguments"),&Object::_add_user_signal,DEFVAL(Array())); + ObjectTypeDB::bind_method(_MD("has_user_signal","signal"),&Object::_has_user_signal); // ObjectTypeDB::bind_method(_MD("emit_signal","signal","arguments"),&Object::_emit_signal,DEFVAL(Array())); diff --git a/core/object.h b/core/object.h index 97ca50cb1a..eb885f5d20 100644 --- a/core/object.h +++ b/core/object.h @@ -386,6 +386,7 @@ friend void postinitialize_handler(Object*); Dictionary metadata; void _add_user_signal(const String& p_name, const Array& p_pargs=Array()); + bool _has_user_signal(const StringName& p_name) const; Variant _emit_signal(const Variant** p_args, int p_argcount, Variant::CallError& r_error); Array _get_signal_list() const; Array _get_signal_connection_list(const String& p_signal) const; |