summaryrefslogtreecommitdiff
path: root/core/class_db.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/class_db.cpp')
-rw-r--r--core/class_db.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/core/class_db.cpp b/core/class_db.cpp
index 6cd7586a54..cd55219b53 100644
--- a/core/class_db.cpp
+++ b/core/class_db.cpp
@@ -538,9 +538,7 @@ void ClassDB::get_method_list(StringName p_class, List<MethodInfo> *p_methods, b
minfo.arguments.push_back(method->get_argument_info(i));
}
- if (method->get_argument_type(-1) != Variant::NIL) {
- minfo.return_val = method->get_argument_info(-1);
- }
+ minfo.return_val = method->get_return_info();
minfo.flags = method->get_hint_flags();
p_methods->push_back(minfo);
@@ -600,14 +598,23 @@ void ClassDB::bind_integer_constant(const StringName &p_class, const StringName
type->constant_map[p_name] = p_constant;
#ifdef DEBUG_METHODS_ENABLED
- List<StringName> *constants_list = type->enum_map.getptr(p_enum);
- if (constants_list) {
- constants_list->push_back(p_name);
- } else {
- List<StringName> new_list;
- new_list.push_back(p_name);
- type->enum_map[p_enum] = new_list;
+ String enum_name = p_enum;
+ if (enum_name!=String()) {
+ if (enum_name.find(".")!=-1) {
+ enum_name=enum_name.get_slicec('.',1);
+ }
+
+ List<StringName> *constants_list = type->enum_map.getptr(enum_name);
+
+ if (constants_list) {
+ constants_list->push_back(p_name);
+ } else {
+ List<StringName> new_list;
+ new_list.push_back(p_name);
+ type->enum_map[enum_name] = new_list;
+ }
+
}
type->constant_order.push_back(p_name);
@@ -680,7 +687,7 @@ StringName ClassDB::get_integer_constant_enum(const StringName &p_class, const S
List<StringName> &constants_list = type->enum_map.get(*k);
const List<StringName>::Element *found = constants_list.find(p_name);
if (found)
- return found->get();
+ return *k;
}
if (p_no_inheritance)