1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Include more attributes in the global class names cache

This commit is contained in:
Pedro J. Estébanez
2025-01-08 13:21:47 +01:00
parent aca5cfc913
commit 318af42020
16 changed files with 174 additions and 133 deletions

View File

@@ -2831,7 +2831,7 @@ bool GDScriptLanguage::handles_global_class_type(const String &p_type) const {
return p_type == "GDScript";
}
String GDScriptLanguage::get_global_class_name(const String &p_path, String *r_base_type, String *r_icon_path) const {
String GDScriptLanguage::get_global_class_name(const String &p_path, String *r_base_type, String *r_icon_path, bool *r_is_abstract, bool *r_is_tool) const {
Error err;
Ref<FileAccess> f = FileAccess::open(p_path, FileAccess::READ, &err);
if (err) {
@@ -2932,6 +2932,12 @@ String GDScriptLanguage::get_global_class_name(const String &p_path, String *r_b
if (r_icon_path) {
*r_icon_path = c->simplified_icon_path;
}
if (r_is_abstract) {
*r_is_abstract = false;
}
if (r_is_tool) {
*r_is_tool = parser.is_tool();
}
return c->identifier != nullptr ? String(c->identifier->name) : String();
}