diff options
-rw-r--r-- | editor/property_selector.cpp | 3 | ||||
-rw-r--r-- | modules/mono/csharp_script.cpp | 1 | ||||
-rw-r--r-- | modules/mono/mono_gd/gd_mono_class.cpp | 26 | ||||
-rw-r--r-- | modules/mono/mono_gd/gd_mono_class.h | 2 |
4 files changed, 11 insertions, 21 deletions
diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp index ff3fc64907..a8c97be936 100644 --- a/editor/property_selector.cpp +++ b/editor/property_selector.cpp @@ -210,9 +210,6 @@ void PropertySelector::_update_search() { methods.push_back(MethodInfo("*Script Methods")); Object::cast_to<Script>(obj)->get_script_method_list(&methods); - // TODO: Filter out things unsuitable for explicit calls, like constructors. - - // TODO: We should handle script class hierarchies somehow. Right now we don't; it's unclear where this functionality should live. } StringName base = base_type; diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index ba31f12d37..943d95bfc9 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -2479,6 +2479,7 @@ void CSharpScript::get_script_method_list(List<MethodInfo> *p_list) const { if (!script_class) return; + // TODO: Filter out things unsuitable for explicit calls, like constructors. const Vector<GDMonoMethod *> &methods = script_class->get_all_methods(); for (int i = 0; i < methods.size(); ++i) { p_list->push_back(methods[i]->get_method_info()); diff --git a/modules/mono/mono_gd/gd_mono_class.cpp b/modules/mono/mono_gd/gd_mono_class.cpp index 400735bb20..c55f9160bd 100644 --- a/modules/mono/mono_gd/gd_mono_class.cpp +++ b/modules/mono/mono_gd/gd_mono_class.cpp @@ -139,20 +139,6 @@ void GDMonoClass::fetch_attributes() { attrs_fetched = true; } -void GDMonoClass::fetch_method_list() { - - if (method_list_fetched) - return; - - void *iter = NULL; - MonoMethod *raw_method = NULL; - while ((raw_method = mono_class_get_methods(get_mono_ptr(), &iter)) != NULL) { - method_list.push_back(memnew(GDMonoMethod(mono_method_get_name(raw_method), raw_method))); - } - - method_list_fetched = true; -} - void GDMonoClass::fetch_methods_with_godot_api_checks(GDMonoClass *p_native_base) { CRASH_COND(!CACHED_CLASS(GodotObject)->is_assignable_from(this)); @@ -465,8 +451,16 @@ const Vector<GDMonoClass *> &GDMonoClass::get_all_delegates() { } const Vector<GDMonoMethod *> &GDMonoClass::get_all_methods() { - if (!method_list_fetched) - fetch_method_list(); + + if (!method_list_fetched) { + void *iter = NULL; + MonoMethod *raw_method = NULL; + while ((raw_method = mono_class_get_methods(get_mono_ptr(), &iter)) != NULL) { + method_list.push_back(memnew(GDMonoMethod(mono_method_get_name(raw_method), raw_method))); + } + + method_list_fetched = true; + } return method_list; } diff --git a/modules/mono/mono_gd/gd_mono_class.h b/modules/mono/mono_gd/gd_mono_class.h index 4199eb22c6..689001f494 100644 --- a/modules/mono/mono_gd/gd_mono_class.h +++ b/modules/mono/mono_gd/gd_mono_class.h @@ -102,8 +102,6 @@ class GDMonoClass { friend class GDMonoAssembly; GDMonoClass(const StringName &p_namespace, const StringName &p_name, MonoClass *p_class, GDMonoAssembly *p_assembly); - void fetch_method_list(); - public: static String get_full_name(MonoClass *p_mono_class); static MonoType *get_mono_type(MonoClass *p_mono_class); |