diff options
author | Thaddeus Crews <repiteo@outlook.com> | 2024-11-22 14:54:31 -0600 |
---|---|---|
committer | Thaddeus Crews <repiteo@outlook.com> | 2024-11-22 14:54:31 -0600 |
commit | ea3154a0d4397fc68c2dc3874e1842dd8a6cffb2 (patch) | |
tree | 9be206ce53d64ae728c5290f4c0eaf70ce417e33 /editor | |
parent | 37305e40bcec774ad8d0948589f46f9f02be8c23 (diff) | |
parent | 03b05cf9acd69b7eeced919012c215b22cd901ab (diff) | |
download | redot-engine-ea3154a0d4397fc68c2dc3874e1842dd8a6cffb2.tar.gz |
Merge pull request #99424 from dalexeev/core-fix-builtin-enum-const-binds
Core: Fix built-in enum constant bindings
Diffstat (limited to 'editor')
-rw-r--r-- | editor/doc_tools.cpp | 17 |
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); |