diff options
Diffstat (limited to 'core/object')
-rw-r--r-- | core/object/class_db.cpp | 9 | ||||
-rw-r--r-- | core/object/method_bind.h | 9 | ||||
-rw-r--r-- | core/object/object.cpp | 5 | ||||
-rw-r--r-- | core/object/script_language_extension.h | 11 |
4 files changed, 22 insertions, 12 deletions
diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp index 876635529c..6b84dfcee9 100644 --- a/core/object/class_db.cpp +++ b/core/object/class_db.cpp @@ -425,8 +425,8 @@ uint32_t ClassDB::get_api_hash(APIType p_api) { for (const StringName &F : snames) { MethodInfo &mi = t->signal_map[F]; hash = hash_murmur3_one_64(F.hash(), hash); - for (int i = 0; i < mi.arguments.size(); i++) { - hash = hash_murmur3_one_64(mi.arguments[i].type, hash); + for (const PropertyInfo &pi : mi.arguments) { + hash = hash_murmur3_one_64(pi.type, hash); } } } @@ -1856,8 +1856,9 @@ void ClassDB::add_virtual_method(const StringName &p_class, const MethodInfo &p_ if (p_arg_names.size() != mi.arguments.size()) { WARN_PRINT("Mismatch argument name count for virtual method: " + String(p_class) + "::" + p_method.name); } else { - for (int i = 0; i < p_arg_names.size(); i++) { - mi.arguments[i].name = p_arg_names[i]; + List<PropertyInfo>::Iterator itr = mi.arguments.begin(); + for (int i = 0; i < p_arg_names.size(); ++itr, ++i) { + itr->name = p_arg_names[i]; } } } diff --git a/core/object/method_bind.h b/core/object/method_bind.h index e97f4abc6a..2f9a2d1679 100644 --- a/core/object/method_bind.h +++ b/core/object/method_bind.h @@ -152,7 +152,7 @@ public: if (p_arg < 0) { return _gen_return_type_info(); } else if (p_arg < method_info.arguments.size()) { - return method_info.arguments[p_arg]; + return method_info.arguments.get(p_arg); } else { return PropertyInfo(Variant::NIL, "arg_" + itos(p_arg), PROPERTY_HINT_NONE, String(), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_NIL_IS_VARIANT); } @@ -193,10 +193,11 @@ public: Vector<StringName> names; names.resize(method_info.arguments.size()); #endif - for (int i = 0; i < method_info.arguments.size(); i++) { - at[i + 1] = method_info.arguments[i].type; + int i = 0; + for (List<PropertyInfo>::ConstIterator itr = method_info.arguments.begin(); itr != method_info.arguments.end(); ++itr, ++i) { + at[i + 1] = itr->type; #ifdef DEBUG_METHODS_ENABLED - names.write[i] = method_info.arguments[i].name; + names.write[i] = itr->name; #endif } diff --git a/core/object/object.cpp b/core/object/object.cpp index b6c8a87a22..ab89f96a0d 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -1302,9 +1302,8 @@ TypedArray<Dictionary> Object::_get_signal_connection_list(const StringName &p_s TypedArray<Dictionary> Object::_get_incoming_connections() const { TypedArray<Dictionary> ret; - int connections_amount = connections.size(); - for (int idx_conn = 0; idx_conn < connections_amount; idx_conn++) { - ret.push_back(connections[idx_conn]); + for (const Object::Connection &connection : connections) { + ret.push_back(connection); } return ret; diff --git a/core/object/script_language_extension.h b/core/object/script_language_extension.h index cc6b729ae8..8fd26c3d2c 100644 --- a/core/object/script_language_extension.h +++ b/core/object/script_language_extension.h @@ -389,7 +389,16 @@ public: EXBIND0RC(bool, can_make_function) EXBIND3R(Error, open_in_external_editor, const Ref<Script> &, int, int) EXBIND0R(bool, overrides_external_editor) - EXBIND0RC(ScriptNameCasing, preferred_file_name_casing) + + GDVIRTUAL0RC(ScriptNameCasing, _preferred_file_name_casing); + + virtual ScriptNameCasing preferred_file_name_casing() const override { + ScriptNameCasing ret; + if (GDVIRTUAL_CALL(_preferred_file_name_casing, ret)) { + return ret; + } + return ScriptNameCasing::SCRIPT_NAME_CASING_SNAKE_CASE; + } GDVIRTUAL3RC(Dictionary, _complete_code, const String &, const String &, Object *) |