summaryrefslogtreecommitdiff
path: root/core/object.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/object.cpp')
-rw-r--r--core/object.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/object.cpp b/core/object.cpp
index cdb2c6517a..6bb7973cef 100644
--- a/core/object.cpp
+++ b/core/object.cpp
@@ -1302,6 +1302,10 @@ Array Object::_get_signal_connection_list(const String& p_signal) const{
void Object::get_signal_list(List<MethodInfo> *p_signals ) const {
+ if (!script.is_null()) {
+ Ref<Script>(script)->get_script_signal_list(p_signals);
+ }
+
ObjectTypeDB::get_signal_list(get_type_name(),p_signals);
//find maybe usersignals?
const StringName *S=NULL;
@@ -1313,6 +1317,7 @@ void Object::get_signal_list(List<MethodInfo> *p_signals ) const {
p_signals->push_back(signal_map[*S].user);
}
}
+
}
@@ -1351,6 +1356,10 @@ Error Object::connect(const StringName& p_signal, Object *p_to_object, const Str
Signal *s = signal_map.getptr(p_signal);
if (!s) {
bool signal_is_valid = ObjectTypeDB::has_signal(get_type_name(),p_signal);
+ //check in script
+ if (!signal_is_valid && !script.is_null() && Ref<Script>(script)->has_script_signal(p_signal))
+ signal_is_valid=true;
+
if (!signal_is_valid) {
ERR_EXPLAIN("Attempt to connect nonexistent signal '"+p_signal+"' to method '"+p_to_method+"'");
ERR_FAIL_COND_V(!signal_is_valid,ERR_INVALID_PARAMETER);