diff options
Diffstat (limited to 'core/object')
-rw-r--r-- | core/object/script_language.h | 2 | ||||
-rw-r--r-- | core/object/script_language_extension.cpp | 2 | ||||
-rw-r--r-- | core/object/script_language_extension.h | 9 |
3 files changed, 13 insertions, 0 deletions
diff --git a/core/object/script_language.h b/core/object/script_language.h index 776a9bfaab..686ab5b8d3 100644 --- a/core/object/script_language.h +++ b/core/object/script_language.h @@ -350,6 +350,7 @@ public: LOOKUP_RESULT_CLASS_SIGNAL, LOOKUP_RESULT_CLASS_ENUM, LOOKUP_RESULT_CLASS_TBD_GLOBALSCOPE, + LOOKUP_RESULT_CLASS_ANNOTATION, LOOKUP_RESULT_MAX }; @@ -402,6 +403,7 @@ public: virtual void get_recognized_extensions(List<String> *p_extensions) const = 0; virtual void get_public_functions(List<MethodInfo> *p_functions) const = 0; virtual void get_public_constants(List<Pair<String, Variant>> *p_constants) const = 0; + virtual void get_public_annotations(List<MethodInfo> *p_annotations) const = 0; struct ProfilingInfo { StringName signature; diff --git a/core/object/script_language_extension.cpp b/core/object/script_language_extension.cpp index 5af79bbea3..ab8dd6d1ee 100644 --- a/core/object/script_language_extension.cpp +++ b/core/object/script_language_extension.cpp @@ -134,6 +134,7 @@ void ScriptLanguageExtension::_bind_methods() { GDVIRTUAL_BIND(_get_recognized_extensions); GDVIRTUAL_BIND(_get_public_functions); GDVIRTUAL_BIND(_get_public_constants); + GDVIRTUAL_BIND(_get_public_annotations); GDVIRTUAL_BIND(_profiling_start); GDVIRTUAL_BIND(_profiling_stop); @@ -160,6 +161,7 @@ void ScriptLanguageExtension::_bind_methods() { BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_SIGNAL); BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_ENUM); BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_TBD_GLOBALSCOPE); + BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_ANNOTATION); BIND_ENUM_CONSTANT(LOOKUP_RESULT_MAX); BIND_ENUM_CONSTANT(LOCATION_LOCAL); diff --git a/core/object/script_language_extension.h b/core/object/script_language_extension.h index 7eea48370e..2c53139ec2 100644 --- a/core/object/script_language_extension.h +++ b/core/object/script_language_extension.h @@ -580,6 +580,15 @@ public: p_constants->push_back(Pair<String, Variant>(d["name"], d["value"])); } } + GDVIRTUAL0RC(TypedArray<Dictionary>, _get_public_annotations) + virtual void get_public_annotations(List<MethodInfo> *p_annotations) const override { + TypedArray<Dictionary> ret; + GDVIRTUAL_REQUIRED_CALL(_get_public_annotations, ret); + for (int i = 0; i < ret.size(); i++) { + MethodInfo mi = MethodInfo::from_dict(ret[i]); + p_annotations->push_back(mi); + } + } EXBIND0(profiling_start) EXBIND0(profiling_stop) |