summaryrefslogtreecommitdiffstats
path: root/editor
diff options
context:
space:
mode:
authorDanil Alexeev <dalexeev12@yandex.ru>2024-11-22 14:03:21 +0300
committerDanil Alexeev <dalexeev12@yandex.ru>2024-11-22 14:03:21 +0300
commit03b05cf9acd69b7eeced919012c215b22cd901ab (patch)
tree19860a7e651b7b7a22772b8d02f08fd04479ce86 /editor
parentf952bfe9985ad8f507cc29b2c7601bbba18b8039 (diff)
downloadredot-engine-03b05cf9acd69b7eeced919012c215b22cd901ab.tar.gz
Core: Fix built-in enum constant bindings
Diffstat (limited to 'editor')
-rw-r--r--editor/doc_tools.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/editor/doc_tools.cpp b/editor/doc_tools.cpp
index 79e0c7ebd1..842c4acce0 100644
--- a/editor/doc_tools.cpp
+++ b/editor/doc_tools.cpp
@@ -908,6 +908,23 @@ void DocTools::generate(BitField<GenerateFlags> p_flags) {
c.properties.sort();
+ List<StringName> enums;
+ Variant::get_enums_for_type(Variant::Type(i), &enums);
+
+ for (const StringName &E : enums) {
+ List<StringName> enumerations;
+ Variant::get_enumerations_for_enum(Variant::Type(i), E, &enumerations);
+
+ for (const StringName &F : enumerations) {
+ DocData::ConstantDoc constant;
+ constant.name = F;
+ constant.value = itos(Variant::get_enum_value(Variant::Type(i), E, F));
+ constant.is_value_valid = true;
+ constant.enumeration = E;
+ c.constants.push_back(constant);
+ }
+ }
+
List<StringName> constants;
Variant::get_constants_for_type(Variant::Type(i), &constants);