Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Fix code editor wrong property tooltips

BrotherShortf3395f699019
diff --git a/modules/gdscript/editor/gdscript_docgen.cpp b/modules/gdscript/editor/gdscript_docgen.cpp
index 5f40c146d5a..7a724608b42 100644
--- a/modules/gdscript/editor/gdscript_docgen.cpp
+++ b/modules/gdscript/editor/gdscript_docgen.cpp
@@ -100,11 +100,14 @@ void GDScriptDocGen::_doctype_from_datatype(const DataType &p_datatype, String &
}
}
if (p_datatype.builtin_type == Variant::DICTIONARY && p_datatype.has_container_element_types()) {
- String key, value;
- _doctype_from_datatype(p_datatype.get_container_element_type_or_variant(0), key, r_enum);
- _doctype_from_datatype(p_datatype.get_container_element_type_or_variant(1), value, r_enum);
+ String key, value, key_enum, value_enum;
+ _doctype_from_datatype(p_datatype.get_container_element_type_or_variant(0), key, key_enum);
+ _doctype_from_datatype(p_datatype.get_container_element_type_or_variant(1), value, value_enum);
if (key != "Variant" || value != "Variant") {
r_type = "Dictionary[" + key + ", " + value + "]";
+ if (!key_enum.is_empty() || !value_enum.is_empty()) {
+ r_enum = "Dictionary[" + (key_enum.is_empty() ? key : key_enum) + ", " + (value_enum.is_empty() ? value : value_enum) + "]";
+ }
return;
}
}