diff --git a/core/object/script_language.h b/core/object/script_language.h index 3ea6a6e4c3c..215e5880fa4 100644 --- a/core/object/script_language.h +++ b/core/object/script_language.h @@ -141,6 +141,7 @@ public: #ifdef TOOLS_ENABLED virtual Vector get_documentation() const = 0; + virtual String get_class_icon_path() const = 0; virtual PropertyInfo get_class_category() const; #endif // TOOLS_ENABLED diff --git a/core/object/script_language_extension.cpp b/core/object/script_language_extension.cpp index 0df9d583344..bf8bac476a3 100644 --- a/core/object/script_language_extension.cpp +++ b/core/object/script_language_extension.cpp @@ -52,6 +52,7 @@ void ScriptExtension::_bind_methods() { GDVIRTUAL_BIND(_reload, "keep_state"); GDVIRTUAL_BIND(_get_documentation); + GDVIRTUAL_BIND(_get_class_icon_path); GDVIRTUAL_BIND(_has_method, "method"); GDVIRTUAL_BIND(_get_method_info, "method"); diff --git a/core/object/script_language_extension.h b/core/object/script_language_extension.h index 1a0ec294798..7fa1fe68109 100644 --- a/core/object/script_language_extension.h +++ b/core/object/script_language_extension.h @@ -77,6 +77,7 @@ public: EXBIND1R(Error, reload, bool) GDVIRTUAL0RC(TypedArray, _get_documentation) + GDVIRTUAL0RC(String, _get_class_icon_path) #ifdef TOOLS_ENABLED virtual Vector get_documentation() const override { TypedArray doc; @@ -89,6 +90,12 @@ public: return class_doc; } + + virtual String get_class_icon_path() const override { + String ret; + GDVIRTUAL_CALL(_get_class_icon_path, ret); + return ret; + } #endif // TOOLS_ENABLED EXBIND1RC(bool, has_method, const StringName &) diff --git a/doc/classes/ScriptExtension.xml b/doc/classes/ScriptExtension.xml index 934cbf5a269..f7c8ecb3fbe 100644 --- a/doc/classes/ScriptExtension.xml +++ b/doc/classes/ScriptExtension.xml @@ -22,6 +22,11 @@ + + + + + diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 0b2c2bea154..ae90ae6a420 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -1122,8 +1122,14 @@ Ref EditorData::get_script_icon(const Ref